Differences

This shows you the differences between two versions of the page.


tech:linux:apache_configuration [2022/02/13 12:28] (current) – created - external edit 127.0.0.1
Line 1: Line 1:
 +====== Apache Configuration (Ubuntu 18.04 Bionic Beaver) ======
 +===== Enable the below =====
 +<code bash>
 +/usr/sbin/a2enmod headers rewrite socache_shmcb
 +</code>
 +
 +===== /etc/apache2/apache2.conf =====
 +Original vs Modified (Original ''<'' and Modified ''>'')
 +<code diff>
 +175a176,181
 +> <Directory /data/www/>
 +>       Options Indexes FollowSymLinks
 +>       AllowOverride None
 +>       Require all granted
 +> </Directory>
 +>
 +213a220
 +> LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" proxycomb
 +216a224,227
 +> LogFormat "%h %t %>s %B %D %k" performance
 +> LogFormat "%{X-Forwarded-For}i %t %>s %B %D %k" proxyperf
 +>
 +> SetEnvIf X-Forwarded-For "^.*\..*\..*\..*" forwarded
 +222c233,234
 +< IncludeOptional conf-enabled/*.conf
 +---
 +> #IncludeOptional conf-enabled/*.conf
 +> Include conf-enabled/
 +225c237,238
 +< IncludeOptional sites-enabled/*.conf
 +---
 +> #IncludeOptional sites-enabled/*.conf
 +> Include sites-enabled/
 +</code>
 +
 +===== /etc/apache2/ports.conf =====
 +No differences
 +
 +===== /etc/apache2/conf-available/httpd.conf =====
 +Create New file ''/etc/apache2/conf-available/httpd.conf''
 +<code>
 +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 192.168.1.1/24
 +</Location>
 +</code>
 +
 +Link this file to ''conf-enabled'' directory
 +<code bash>
 +cd /etc/apache2/conf-enabled
 +ln -s ../conf-available/httpd.conf httpd.conf
 +htpasswd -c serverstatus.htpasswd <username>
 +</code>
 +
 +===== /etc/apache2/mods-available & mods-enabled =====
 +You can ignore differences here.
 +
 +===== /etc/apache2/sites-available =====
 +No changes to:
 +  * 000-default.conf &
 +  * default-ssl.conf
 +
 +Note: Custom configuration that I have. Add these to directories: domaintemplate & localdomain
 +
 +----
 +
 +Ref: [[tech:linux:apache_old_config|Old Configuration]]
 +
 +
  

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