Recipe Apache Logs


 Apache configuration

In the logs directory add a robots.txt

User-agent: *
Disallow: /

Edit /etc/httpd/conf/httpd.conf  (Location may be different depending on OS)

Note: Change log location

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{User-Agent}i\" %T" combined

CustomLog /home/sakaiqa/qa/sakai-demo-2.7.0-SNAPSHOT/logs/access_log combined
ErrorLog /home/sakaiqa/qa/sakai-demo-2.7.0-SNAPSHOT/logs/error_log

 Check the sanity of the changes and then stop/start service

/etc/init.d/httpd configtest
Syntax OK
/etc/init.d/httpd stop
/etc/init.d/start

Installing a log analyser (http://www.analog.cx/)

Note: Example location of logfile and outfile only

sudo apt-get install analog

edit /etc/analog.cfg

APACHELOGFORMAT (%h %l %u %t \"%r\" %>s %b \"%{User-Agent}i\" %T)

LOGFILE /home/alan/Desktop/test/access_log
OUTFILE /home/alan/Desktop/test/qa1-nl_2.7.0.m1.html