Logging with Apache vhosts file

Discussion in 'Apache Migration/Compatibility' started by Gerry, Feb 5, 2008.

  1. Gerry

    Gerry Member

    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:
    Code:
    /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:
    Code:
    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.

    Is there a solution for these problems?
  2. mistwang

    mistwang LiteSpeed Staff

    Are you using a control panel? or a customed one.
  3. Gerry

    Gerry Member

    We have built our own control panel which still uses Apache as a webserver until now.
  4. mistwang

    mistwang LiteSpeed Staff

    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?
  5. Gerry

    Gerry Member

    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!
  6. mistwang

    mistwang LiteSpeed Staff

    Please download our latest 3.3.5 build see if works, just change the version number in the download link.
  7. Gerry

    Gerry Member

    It seems to do exactly what we expect it to do!
    Thank you very much!

Share This Page