We can implement logging option at apache-httpd level to keep record of request and response byte count.
To implement logging modules mod_logio and mod_log_config in to existing httpd, we need to upgrade existing apache by yum update . This 'll automatically install all modules needed by httpd. httpd.conf default logger need to be changes as follows
Procedure to follow :
First check whether mod_log_config module is installed on apache using command
httpd -l
if its present go ahead for installing mod_logio module
if not present install mod_log_config using following method ( change mod_logio.c to mod_log_config.c )
1. Copy the apache-httpd source to /usr/local ( if its not available)
2. Add module mod_logio.c to existing apache-httpd using following commads.
apxs -c $httpd-2.2.3/modules/loggers/mod_logio.c
apxs -i -a -n mod_logio $httpd-2.2.3/modules/loggers/mod_logio.la
3. Load shared object files needed.
ldconfig
This 'll add below line in file /etc/httpd/conf/httpd.conf
LoadModule logio_module lib/apache/mod_logio.so
4. Log format in /etc/httpd/conf/httpd.conf
By default ( something like this ):
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
should be changed to ( %I %O should be appended ) :
LogFormat "%h %l %u %t \"%r\" %>s %b %T \"%{Referer}i\" \"%{User-agent}i\" %I %O" combined
5. restart apache-httpd
6. Check for access logs for change
We need to make sure while installing new httpd we should use these options to get request , response bytes.
./configure --enable-layout=RedHat --enable-auth-digest --enable-deflate --enable-proxy --enable-rewrite --enable-so --enable-status --enable-info --enable-logio
Its advisable to try the same on local machine before trying out on live server.
Let me know if in issue while installing/upgrading...
THANK YOU!
ReplyDeleteWelcome !
ReplyDeleteThis is the simplest way to install. now a days, latest OSs are getting it by default. good to use for servers configs.