About Linux FAQ

Browse More FAQs:

Apache Log POST Data To A Log File

Posted by Vivek on Thursday April 17, 08 (4 weeks ago) @6:28 pm

Q. How do I log POST data submitted by our user registration form to a log file under Debian Linux Apache 2 Web Server?

A. You can use mod_security or mod_dumpio module under Apache web server to dump POST data.

Apache mod_dumpio Module

This module 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.

WARNING! These examples requires apache version 2.1.3 or above along with mod_dumpio

Step # 1: Enable mod_dumpio module

Type the following command as the root user:
$ sudo a2enmod dump_io
OR
# a2enmod dump_io
Restart Apache Web server:
# /etc/init.d/apache2 force-reload

Step # 2: Configuration

Open httpd.conf or apache2.conf file:
# vi apache2.conf
Enable dumping of all input data:
DumpIOInput On
Enable dumping of all output at a specific LogLevel level such as notice or debug:
DumpIOLogLevel debug
If you want to enable dumping of all output, enter:
DumpIOOutput On
Save and close the file. Just restart Apache2:
# /etc/init.d/apache2 restart

How do I view logs?

All data is logged to error log file,
# tail -f /var/log/apache2/error.log
OR
# egrep -iw 'one|two' /var/log/apache2/error.log

Further readings:

Subscribe to our free e-mail newsletter or RSS feed to get all updates. You can Email this page to a friend.

Related Linux / UNIX FAQ:

Leave a Reply

We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Please do not use the comment form to ask for help / question. Ask your question on the excellent Linux tech support forum. Thank you very much for stopping by our site!

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word

Tags: , , , , , , , , , , , , , , ~ Last updated on: April 17, 2008

Copyright © 2006-2008 nixCraft. All rights reserved - TOS/Disclaimer - Privacy policy - Sitemap - Powered by Open source software.