Apache Configuration (Ubuntu 18.04 Bionic Beaver)

Enable the below

/usr/sbin/a2enmod headers rewrite socache_shmcb


Original vs Modified (Original < and Modified >)

> <Directory /data/www/>
>       Options Indexes FollowSymLinks
>       AllowOverride None
>       Require all granted
> </Directory>
> LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" proxycomb
> LogFormat "%h %t %>s %B %D %k" performance
> LogFormat "%{X-Forwarded-For}i %t %>s %B %D %k" proxyperf
> SetEnvIf X-Forwarded-For "^.*\..*\..*\..*" forwarded
< IncludeOptional conf-enabled/*.conf
> #IncludeOptional conf-enabled/*.conf
> Include conf-enabled/
< IncludeOptional sites-enabled/*.conf
> #IncludeOptional sites-enabled/*.conf
> Include sites-enabled/


No differences


Create New file /etc/apache2/conf-available/httpd.conf

ServerName localhost
ExtendedStatus On
<Location /server-status>
    SetHandler server-status
    AuthType basic
    AuthName "Apache status"
    AuthUserFile /etc/apache2/conf-available/serverstatus.htpasswd
    Require valid-user
    Order deny,allow
    Deny from all
    Allow from

Link this file to conf-enabled directory

cd /etc/apache2/conf-enabled
ln -s ../conf-available/httpd.conf httpd.conf
htpasswd -c serverstatus.htpasswd <username>

/etc/apache2/mods-available & mods-enabled

You can ignore differences here.


No changes to:

  • 000-default.conf &
  • default-ssl.conf

Note: Custom configuration that I have. Add these to directories: domaintemplate & localdomain

Ref: Old Configuration

QR Code
QR Code tech:linux:apache_configuration (generated for current page)