Apache log

Discussion in 'Feature Requests' started by Davide, Jul 29, 2006.

  1. Davide

    Davide Member HowtoForge Supporter

    It would be great to get merged the following directives in apache's isp log configuration

    LogFormat "%{Client-ip}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" proxy:%h" proxy

    SetEnvIf Client-ip . client-ip-request

    CustomLog /var/log/apache/access_log combined env=!client-ip-request
    CustomLog /var/log/apache/access_log proxy env=client-ip-request


    They're used to count as a visit every different client behind a transparent proxy, avoiding to count all users as one single visit.
     
    Last edited: Jul 29, 2006
  2. falko

    falko Super Moderator ISPConfig Developer

    You can modify your Apache configuration with these directives, I don't see a problem here.
     
  3. Davide

    Davide Member HowtoForge Supporter

    But...
    Can I make ispconfig use them for all virtual hosts?

    Thank you
     
    Last edited: Jul 30, 2006
  4. falko

    falko Super Moderator ISPConfig Developer

    In your main Apache configuration, in the part that was added by the ISPConfig installler, you can find these two lines:

    Code:
    LogFormat "%v||||%b||||%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined_ispconfig
    CustomLog "|/root/ispconfig/cronolog --symlink=/var/log/httpd/ispconfig_access_log /var/log/httpd/ispconfig_access_log_%Y_%m_%d" combined_ispconfig
    You could change that to
    Code:
    SetEnvIf Client-ip . client-ip-request
    
    LogFormat "%v||||%b||||%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined_ispconfig
    LogFormat "%{Client-ip}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" proxy:%h" proxy
    
    CustomLog "|/root/ispconfig/cronolog --symlink=/var/log/httpd/ispconfig_access_log /var/log/httpd/ispconfig_access_log_%Y_%m_%d" combined_ispconfig env=!client-ip-request
    CustomLog /var/log/apache/access_log proxy env=client-ip-request
    You'd then have two different access logs, /var/log/httpd/ispconfig_access_log and /var/log/apache/access_log.
     
  5. Davide

    Davide Member HowtoForge Supporter

    But I suposse webalizer will still use the one in /var/log/httpd/ispconfig_access_log for generating charts
     
  6. falko

    falko Super Moderator ISPConfig Developer

    Yes. But you have two different log formats, so you can't log into the same file.
     

Share This Page