PDA

View Full Version : Logging with Apache vhosts file


Gerry
02-05-2008, 07:06 AM
We are trying to get Litespeed to act as our current Apache setup. We got almost everything to work as we want, however, there is one issue we can't seem to solve: logging.

We use the following files:

/etc/apache/sites.conf - VirtualHost definitions
/etc.apache/httpd.conf - Apache main configuration, which includes the sites.conf file


If we put the following in httpd.conf, nothing happens. Litespeed does not take it into account:

LogFormat "%v %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
CustomLog /var/log/lsws/access.log combined


However, if we put the "CustomLog" directive in a VirtualHost definition, then it works. Is there a way to tell Litespeed to use the same log format for ALL Apache VirtualHosts? We would like to keep the same layout for the VirtualHost definitions and to avoid adding extra lines per VirtualHost that would be the same every time anyway.

Furthermore, Litespeed does not seem to use the %v directive. This is very important to us, as we use it to split the logfiles afterwards. More information can be found here (http://httpd.apache.org/docs/2.2/mod/mod_log_config.html#formats).

Is there a solution for these problems?

mistwang
02-05-2008, 01:09 PM
Are you using a control panel? or a customed one.

Gerry
02-05-2008, 01:49 PM
We have built our own control panel which still uses Apache as a webserver until now.

mistwang
02-05-2008, 04:54 PM
OK, I see, we could make the log configuration in the main httpd.conf the default for all vhosts. Does all vhost log to the same log file in your setup?

Gerry
02-06-2008, 01:19 AM
That would be great if that was possible! :)
Yes, indeed, all virtual hosts log to the same logfile. Could you also have a look at the %v directive in the LogFormat? This is also very important to us.

Thank you for your replies, by the way!

mistwang
02-06-2008, 06:11 PM
Please download our latest 3.3.5 build see if works, just change the version number in the download link.

Gerry
02-07-2008, 06:41 AM
It seems to do exactly what we expect it to do!
Thank you very much!