TECHIES WORLD

For Techs.... Techniques.... Technologies....

ApacheBashCpanelLinux

How to log request header in Apache

Sometimes its required to analyze the the request headers as the part of troubleshooting purposes. But Apache will not log the request headers by default.

We can enable the request header log using the log_forensic_module. This module will be installed with Apache by deafult and it will be disabled state.

For RHEL/Centos systems we just need to uncomment the following line in Apache configuration to enable it.

LoadModule log_forensic_module modules/mod_log_forensic.so
ForensicLog logs/forensic_log

For Debian systems we can use the following command to enable this module.

#a2enmod log_forensic

Since there is a modification in Apache configuration, the service need to be restarted irrespective of the Linux distributions.

#systemctl restart apache

Apache will start logging all request headers now.

That's all…

Leave a Reply