Assuming you already have Apache up and running, it’s really easy to enable mod_log_forensic in order to look in detail at the http(s) requests that are being made to your website.
This module provides detailed logs of every http request – and can be very useful to developers when debugging benign requests which are not processed correctly (and result in errors) – and also for looking in more detail at malicious requests that are intended to compromise the security of your website.
All you need to do is add the following to /etc/apache2/apache2.conf:
Then, as root (or using ‘sudo’ if appropriate for your setup) , run:
a2enmod log_forensic service apache2 restart
After enabling this module, detailed information about the http requests placed against your web site are are logged to /var/log/apache2/forensic_log.log