FreeBSD Apache Configuration

httpd-default.conf
sed -i '' -e 's/^Timeout .*/Timeout 15/' -e 's/^ServerTokens .*/ServerTokens Prod/' -e 's/^ServerSignature .*/ServerSignature Off/' /usr/local/etc/apache22/extra/httpd-default.conf

Configuration

Configuration files

  • /usr/local/etc/apache22/httpd.conf
  • /usr/local/etc/apache22/extra/httpd-default.conf
  • /usr/local/etc/apache22/extra/httpd-info.conf
  • /usr/local/etc/apache22/extra/httpd-mpm.conf
  • /usr/local/etc/apache22/extra/httpd-ssl.conf
  • /usr/local/etc/apache22/extra/httpd-vhosts.conf

httpd.conf

Default configuration settings:

ServerRoot /usr/local
DocumentRoot /usr/local/www/apache22/data
Options Indexes FollowSymLinks
AllowOverride None
ErrorLog /var/log/httpd-error.log
CustomLog /var/log/httpd-access.log combined
ScriptAlias /cgi-bin/ /usr/local/www/apache22/cgi-bin/

Changes:

  • Disable libexec/apache22/cgi_module

httpd-default.conf

Default configuration settings:

Timeout 300
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 5
ServerTokens Full
ServerSignature On
  • Change Timeout to 15
  • Change KeepAlive to Off
  • Change ServerTokens to Prod
  • Change ServerSignature to Off

httpd-info.conf

  • Update ExtendedStatus to On
  • Add Allow from localhost to manual and info

httpd-ssl.conf

  • Remove default virtual hosts

httpd-vhosts.conf

  • Remove default virtual host entries

Logging

Log files:

  • /var/log/httpd-error.log
  • /var/log/httpd-access.log