10

I did the following to try to set mod_dumpio up properly:

  1. Used a2enmod to enable mod_dumpio
  2. Changed LogLevel to "debug" in apache2.config
  3. Added "DumpIOInput On", "DumpIOOutput On" and "DumpIOLogLevel debug" to apache2.config
  4. Issued "/etc/init.d/apache2 restart" to restart Apache
  5. Issued "apache2ctl -t -D DUMP_MODULES" to make sure mod_dumpio was loaded

I'm watching /var/log/apache2/error.log, but not seeing much there, and certainly not a dump of all input and output.

Can anyone help?

1
  • I don't know the answer to this, but I wanted to suggest that you also try www.serverfault.com. Those guys know servers.
    – TCCV
    Commented Aug 10, 2010 at 1:39

4 Answers 4

25

The problem was apparently that just one of my VirtualHosts (as defined in /etc/apache2/sites-enabled) had a LogLevel declared that was something other than debug, thus interfering with the overall behavior of mod_dumpio for reasons that escape me :)

0
12

Mirroring @bland328 I had the same problem, my sub-conf file had "LogLevel debug" and this over-rode the global "LogLevel dumpio:trace7" that seems to be required for Apache 2.4.7. Note that much of the online help is in reference to earlier Apaches and 2.4 has some different syntax.

For reference using an out-of-the-box install on Ubuntu 13.04 I've got a vhosts conf and this is where I had to add the 3 DumpIO lines:

#conf-available/other-vhosts-access-log.conf 
# Define an access log for VirtualHosts that don't define their own logfile
CustomLog ${APACHE_LOG_DIR}/other_vhosts_access.log vhost_combined

LogLevel dumpio:trace7
DumpIOInput On
DumpIOOutput On

After this a sudo service apache2 restart and a curl with --data caused a lot of debug lines to appear in \var\log\apache2\error.log including the POST body, looking like:

[Thu Jul 03 14:39:58.878429 2014] [dumpio:trace7] [pid 12890] mod_dumpio.c(103): [client 10.84.17.174:51824] mod_dumpio:  dumpio_in (data-HEAP): {"bob":42}
1
  • Putting this in other_vhosts_access.log does work, I also found that you could just put it in the VirtualHost configuration file but as mentioned by bland328 the other sites when enabled would clobber the configuration for some reason. I disabled all sites, enabled the one site I wanted and changed its virtual host configuration and no other changes were necessary. The output also showed up in the virtual host specified ErrorLog file.
    – Craig
    Commented Aug 1, 2021 at 20:54
7

Typically the debug level is set to warn in your sites-enabled/default*, so the following code might help (e.g. as /etc/apache2/conf.d/dumpio.conf):

<IfModule dumpio_module>
  DumpIOInput On
  DumpIOOutput On
  DumpIOLogLevel warn
</IfModule>

Or to change the log level in your sites-enabled/default from LogLevel warn to LogLevel debug.

1
6

Nobody talks about Windows (easyphp, xampp, etc) but the configuration is slightly different:

  1. Edit "httpd.conf" apache configuration file :

    • Uncomment "LoadModule dumpio_module modules/mod_dumpio.so"
    • Add section:

      <IfModule dumpio_module>
        DumpIOInput On
        DumpIOOutput On
        #DumpIOLogLevel warn #NOT THIS LINE, DEPRECATED in apache 2.4 !
      </IfModule>
      
    • Change "LogLevel warn" to "LogLevel warn dumpio:trace7"

    • stop/start apache server

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.