Apache

Control Apache

Start and stop
sudo service apache2 restart
sudo systemctl reload apache2
Enable and disable a site
sudo a2ensite example.com.conf
sudo a2dissite example.com.conf

Custom log format

Logs to /var/log/apache2
Use directive

CustomLog ${APACHE_LOG_DIR}/access.log chrisdebug

example

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{Host}i\" \"%{User-agent}i\"" chrisdebug

example

LogFormat "\nNEW ENTRY:\nReferer: \"%{Referer}i\"\nHost: \"%{Host}i\"\nX-Forwarded-Host: \"%{X-Forwarded-Host}i\"\nX-Forwarded-For: \"%{X-Forwarded-For}i\"\nX-Forwarded-Proto: \"%{X-Forwarded-Proto}i\"\nX-Forwarded-Port: \"%{X-Forwarded-Port}i\"" chrisdebug