Ticket #2187: logio-for-debian.patch

File logio-for-debian.patch, 1.5 KB (added by kilburn, 2 years ago)

Patch to enable mod_logio accounting in debian (must ispcp-update to make it effective)

  • configs/debian/apache/httpd.conf

     
    1515# 
    1616 
    1717LogFormat "%B" traff 
    18 LogFormat "%v %b %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" ispcplog 
     18LogFormat "%v %b %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" ispcplog 
    1919 
    2020CustomLog "| /var/www/ispcp/engine/ispcp-apache-logger" ispcplog 
    2121ErrorLog "| /var/www/ispcp/engine/ispcp-apache-logger -e" 
  • configs/debian/ispcp.conf

     
    257257 
    258258APACHE_GROUP = www-data 
    259259 
     260APACHE_LOGIO_ACTIVE = yes 
     261 
    260262# 
    261263# Postfix MTA Data 
    262264# 
  • engine/ispcp-apache-logger

     
    137137        } 
    138138        while ( my $log_line = <STDIN> ) { 
    139139                my ($vhost, $size, $line) = $log_line =~ m/^(\S+) (\d+|-) (.*)$/s; 
     140                # Handle mod_logio output if available 
     141                if ( exists($main::cfg{'APACHE_LOGIO_ACTIVE'}) && $main::cfg{'APACHE_LOGIO_ACTIVE'} eq 'yes' ) { 
     142                        my ($in, $out) = $log_line =~ m/(\d+|-) (\d+|-)$/s; 
     143                        $size = $in + $out; 
     144                } 
    140145 
    141146                if( !defined($vhost) || !defined($size) ){ 
    142147                        print STDERR "[ispcp-apache-logger] Trouble line:\n\t$log_line\n";