Apache Log POST Data To A Log File
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_dumpioStep # 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:
- How do I find out syntax errors in my Apache web server configuration file?
- Howto rebuild Apache for Cpanel Linux / UNIX Server (Control Panel)
- Forbidden - You don’t have permission to access this page error and solution
- Run shell script from web page
- Set Apache Password Protected Directories With .htaccess File
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!
Tags: /etc/init.d/apache2, a2enmod command, apache 2, apache log, apache module, apache version, apache web server, debian linux, egrep, input data, linux apache, logs, module mod, mod_dumpio, root user ~ Last updated on: April 17, 2008



Recent Comments
Today ~ 3 Comments
Today ~ 19 Comments
Today ~ 2 Comments
Today ~ 37 Comments
Today ~ 46 Comments