Apache Log Format

nappa

Verified User
Joined
Jun 10, 2003
Messages
32
I'm new to apache, and the dedicated server things. I would like to know how to change the way the users are logged. Ie.

Right now, apache logs IPs of the visiotrs. I woudl like to catch more than that. in webalizer, only thier ips show up. I know that I need to change the apache log format, but how do I do it?
 
DirectAdmin is currently using the "common" log format. What you're probably looking for is the "combined" log format. If you want to change the log format, I would recommend that chose one of those two so that webalizer is able to parse them properly.

To change the log type, copy the 4 files:
/usr/local/directadmin/data/templates/virtual_host*.conf

into:
/usr/local/directadmin/data/templates/custom/virtual_host*.conf
(where * is all combinations that match. You may have to create the "custom" directory)

Then edit those 4 custom files and replace "common" with "combined". After that, you'll need to rewrite everyones httpd.conf files, so run:

echo 'action=rewrite&value=httpd' >> /usr/local/directadmin/data/task.queue

which will force a rewrite for everyone. After this webalizer should clue in that you've changed the log format and parse the logs correctly.

I might change the default to use the combined log at some point, as a few people have requested the extra details.

John
 
I might change the default to use the combined log at some point, as a few people have requested the extra details.

I would vote for changing. I'm trying to install awstats, which prefers the combined format:

# 4 - Apache or Squid native common log format (NCSA common/CLF log format)
# With LogFormat=4, some features (browsers, os, keywords...) can't work.

And as a reseller rather than admin, I don't think it's going to be easy for me to get the log format changed.
 
Back
Top