Thursday, October 30, 2014

Configure qslog with Apache (2.2.24)


Description:

The qslog tool, which is part of the support utilities of mod_qos, may be used to gather request statistics from Apache's access log data. This includes data such as the number of denied requests or new VIP session creations per minute but also total requests per second and other data.

These support utilities will be available in the src folder of mod_qos installable.

ex:  /softwares/mod_qos-10.29/tools/src contains qslog,qslog.c,qslog.o

Installation and configuration of qslog:

In case, If you have not configured mod_qos.so module with Apache, then click on steps to install and configure mod_qos with Apache 2.2.24.

Following are the steps to install and configure the qslog with apache: 
  
export LD_LIBRARY_PATH=/usr/lib:/usr/sfw/lib
export LD_LIBRARY_PATH_64=/usr/lib/64:/usr/sfw/lib/64
export CC=gcc
export CFLAGS='-m64 -O3'
export CPP_FLAGS='-m64 -O3'
export LDFLAGS="-L/usr/sfw/lib -R/usr/sfw/lib"

./configure --prefix=/apache_path --with-apr=/apr-1.4.6 --with-apr-util=/apr-util-1.4.1 --with-pcre=/pcre

make

make install

After the completion of make install the qslog script will be created in bin folder of the apache.

Making install in src
test -z "/opt/web/apache_fp/apache/bin" || .././install-sh -c -d "/apache/bin"
  .././install-sh -c qsfilter2 qslog qspng qsrotate qssign qstail qsgrep qsexec qscheck qsgeo qslogger qshead 'apache/bin'

Configuration in the httpd.conf log:

LogFormat "%t %h \"%r\" %>s %b \"%{User-Agent}i\" %T"
TransferLog "|/apache/bin/qslog -f ..IRSB.T -o /apache/logs/stat_log"

Errors:

Incase if the following error is seen in the logs after installing the apache

piped log program 'apache/bin/qslog -f ..IRSB.T -o /apache/logs/stat_log' failed unexpectedly
ld.so.1: qslog: fatal: libapr-1.so.0: open failed: No such file or directory
Killed

Add the APR and APR lib folder path to the LD_LIBRARY_PATH variable.


                                                                         (: Happy learning :)






0 comments:

Post a Comment