Tuesday, July 03, 2007

Webserver(lighttpd) access log

We have installed lighttpd and made the basic configuration to serve plain html pages and later while setting up vnstat PHP front end, we made changes to enable cgi module and php.

Now let us configure the access logging (just to know who is looking at our website)

First create a place on the USB HDD to hold the log files
mkdir /opt/log/lighttpd

Install the accesslog module
ipkg install lighttpd-mod-accesslog

modify /etc/lighttpd.conf

uncomment server.modules
and the corresponding closing brace (if you did not install PHP)

insert the line
mod_accesslog
before the closing brace

at the end of the file insert the lines
#### Access log
accesslog.filename = "/opt/log/lighttpd/access.log"

restart lighttpd server
/etc/init.d/S80lighttpd stop
/etc/init.d/S80lighttpd start

you will now have the lighttpd access log in /opt/log/lighttpd/access.log

No comments: