Configuring mod_dumpio with apache2 in Ubuntu

 mod_dumpio allows for the logging of all input received by Apache and/or all output sent by Apache to be logged (dumped) to the error.log file.

The data logging is done right after SSL decoding (for input) and right before SSL encoding (for output). As can be expected, this can produce extreme volumes of data, and should only be used when debugging problems.

To configure mod_dumpio you need to enable dump_io.

$ sudo a2enmod dump_io

Next add below mentioned 3 lines in /etc/apache2/apache2.conf

#To capture http request
DumpIOInput On

#To capture http response
DumpIOOutput On 

#To capture everything
DumpIOLogLevel debug

Now change LogLevel in your /etc/apache2/sites-enabled/000-default or /etc/apache2/sites-available/default file to debug.

LogLevel debug

After doing all above changes restart apache2.

$ service apache2 restart

To view logs you need to check /var/log/apache2/error.log

$ tail -f /var/log/apache2/error.log

To test make a dummy request as shown below and at the same time view error.log file where you can lot of lines related to this request.

$ curl -d group=user -d sort=name

Since dump_io will create log of disk io, enabling it in production servers is not a good idea. It will slow down your production server.

2 comments on “Configuring mod_dumpio with apache2 in Ubuntu

  1. I got this error when trying to enable DumpIOLogLevel:

    Feb 01 05:59:17 ubuntu apache2[36963]: AH00526: Syntax error on line 230 of /etc/apache2/apache2.conf:
    Feb 01 05:59:17 ubuntu apache2[36963]: Invalid command ‘DumpIOLogLevel’, perhaps misspelled or defined by a module not included in the server configuration

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s