Analysing web server log files

Q I'm trying to set up a server log file analyser. It runs on one machine (10.0.0.14 on my LAN) but needs an entry in its configuration file to point to the access log file. This log is held on my web server (192.168.0.2 on my DMZ). I know it's a basic question, but what should this entry be? I don't know how to specify that the configuration file needs to look at a file held on another machine. For anybody with a similar system, I'm trying to set up Analog.

A The simplest solution to sharing a file across a LAN is to use NFS, although you'll need to ensure that you can route between your internal network and your DMZ. You can mount your log file directory from Apache on the system running Analog, then point to the appropriate access_log file. You can add a line to /etc/exports on the web server to permit NFS mounts:

/var/log/apache          10.0.0.14(ro,no_
root_squash)

Now perform exportfs -r in order to refresh the Exports list. Mounting this directory on your internal system is as easy as mounting a CD.

# mount 192.168.0.2:/var/log/apache
/var/log/apache

The other option is to use rsync, which can be configured to sync files across a network, without requiring any authentication. This allows it to work very effectively from a cron job script without any user input, and it will transfer all of the changes to the log file each time it's executed.

Follow us on Identi.ca or Twitter

Username:   Password:
Create Account | About TuxRadar