httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Julian Hall <>
Subject Strange logging problem
Date Thu, 11 Jul 2002 11:50:32 GMT
Can anyone help me with this?

I have a rather bizarre problem with logging on my cobalt RaQ4.  I am 
using the latest cobalt-supplied version of apache which is 1.3.20 with 
some patches applied (not sure exactly which ones, to be honest).

I am running several virtual hosts on a single IP using NameVirtualHost. 
 Each host has its own TransferLog, in a custom format set by a 
LogFormat directive.  The format, however, does not make any difference 
to the problem.

The problem is essentially that no entries are stored in the access log 
for each virtual host.  Other information about the system:

- the 'main' access log at /var/log/httpd/access still receives details 
of any requests that don't specify a virtual host.
- whenever an access is made, the time stamp on the relevant log file is 
updated, but no data becomes visible.  the size of the file does not change.
- all of my virtual hosts stopped logging simultaneously (at a time when 
I wasn't in the office, so I don't know what changed to cause this) with 
various sizes of log file.
- the file system is not full, and there are plenty of free inodes.  No 
quotas are in force.
- if I manually append data to one of the files (eg by running 'echo >> 
access_log'), logging will start again in that file, but stop after 1024 
bytes are logged.
- logging generally stops in the middle of a line in the log file
- the only non-standard modules I am using are php & chillisoft ASP.
- the OS is Linux 2.2.16C32_III and the hardware is IA32 platform.
- the virtual host error logs are also affected.

Cut down to its most basic, this is my httpd.conf (with comment lines 

LoadModule env_module modules/
LoadModule define_module modules/
LoadModule config_log_module modules/
LoadModule mime_module modules/
LoadModule negotiation_module modules/
LoadModule status_module modules/
LoadModule includes_module modules/
LoadModule autoindex_module modules/
LoadModule dir_module modules/
LoadModule frontpage_module modules/
LoadModule cgi_module modules/
LoadModule asis_module modules/
LoadModule imap_module modules/
LoadModule action_module modules/
LoadModule userdir_module modules/
LoadModule alias_module modules/
LoadModule rewrite_module modules/
LoadModule access_module modules/
LoadModule pam_external_auth_module modules/
LoadModule auth_module modules/
LoadModule unique_id_module modules/
LoadModule setenvif_module modules/
LoadModule casp2_module modules/
LoadModule php4_module modules/
LoadModule ssl_module modules/
AddModule mod_php4.c
ServerType standalone
Port 80
HostnameLookups off
User httpd
Group httpd
ServerRoot /etc/httpd
ErrorLog /var/log/httpd/error
LogLevel notice
LogFormat "%v %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" 
\"%{User-Agent}i\"" comb
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
LogFormat "%h;%t;%U;%b;%{Referer}i;%{User-agent}i" acr
LogFormat "%h;%t;%U;%b;%{Referer}i;%{User-agent}i"
CustomLog /var/log/httpd/access combined
PidFile /var/run/
ScoreBoardFile /var/log/httpd/httpd_status
UseCanonicalName off
Timeout 300
KeepAlive On
MaxKeepAliveRequests 0
KeepAliveTimeout 15
MinSpareServers 5
MaxSpareServers 20
StartServers 5
MaxClients 300
MaxRequestsPerChild 300000
Listen 80
Listen 443
<IfModule mod_ssl.c>
SSLSessionCache         dbm:/var/log/httpd/ssl_scache
SSLSessionCacheTimeout  300
SSLMutex                file:/var/log/httpd/ssl_mutex
SSLRandomSeed startup   file:/dev/urandom 512
SSLRandomSeed connect   builtin
use Apache::PerlSections();
use Cobalt::Ssl;
my (@ssl_conf,$ip,$group,$rewrite_rules,$proto,$ret);
open(HTTPD_CONF,"/etc/httpd/conf/httpd.conf") ||
    die "What ? We can't read our own configuration file?: $!";
while(<HTTPD_CONF>) {
    if (/^<VirtualHost [\d\.]+>$/ ... /^<\/VirtualHost>$/) {
        if ( /^<VirtualHost ([\d\.]+)>/o ) {
            # New section. Clean up.
            $ip = $1;
            @ssl_conf = ();
            $group = undef;

        # Skip this bit, we don't need it now..
        next if (/^<VirtualHost/);

        # Just need to grab the group name out before we get on with
        # the real work.
        if ( /DocumentRoot \/home\/sites\/([^\/]+)\/web/ ){
            $group = $1;

        # These two are for the rewrite options
        s/http/https/go if (/^Rewrite/);
        s/80/443/go if (/^Rewrite/);
        push @ssl_conf, $_;

        # Hardcoded, issues with mod_perl and cobalt modules.
        if (/^<\/Virtual/ and (-f "/etc/httpd/ssl/$group")) {
            $ret = ssl_cert_check("/home/sites/$group/certs/");
            if ($ret=~/^2/o) {
                $PerlConfig .= "Listen $ip:443\n";
                $PerlConfig .= "<VirtualHost $ip:443>\n";
                $PerlConfig .= "SSLengine on\n";
                $PerlConfig .= "SSLCertificateFile 
                $PerlConfig .= "SSLCertificateKeyFile 
                $PerlConfig .= join('', @ssl_conf);
            } elsif (ssl_cert_check("/home/sites/home/certs/") =~ /^2/ ) {
                $PerlConfig .= "Listen $ip:443\n";
                $PerlConfig .= "<VirtualHost $ip:443>\n";
                $PerlConfig .= "SSLengine on\n";
                $PerlConfig .= "SSLCertificateFile 
                $PerlConfig .= "SSLCertificateKeyFile 
                $PerlConfig .= join('', @ssl_conf);
            } else {
                print STDERR "Site $group has invalid certificate: $ret\n";
if ( ssl_cert_check("/home/sites/home/certs/") =~ /^2/ ) {
    $proto = 'https';
} else {
    $proto = 'http';
$rewrite_rules =
'RewriteEngine On
RewriteCond %{HTTP_HOST}                ^([^:]+)
RewriteCond %{DOCUMENT_ROOT}            !-d
RewriteRule .*                          
idden.html [L,R]
RewriteCond %{HTTP_HOST}                ^([^:]+)
RewriteRule ^/admin/?$                  
index.html [L,R]
RewriteCond %{HTTP_HOST}                ^([^:]+)
RewriteRule ^/siteadmin/?$              
/%1/index.html [L,R]
RewriteCond %{HTTP_HOST}                ^([^:]+)
RewriteRule ^/personal/?$               
ndex.html [L,R]
RewriteCond %{HTTP_HOST}                ^([^:]+)
RewriteRule ^/.cobalt/(.+)              proto://servername:81/.cobalt/$1 
RewriteCond %{HTTP_HOST}                ^([^:]+)
RewriteRule ^/cgi-bin/.cobalt/(.+)      
$rewrite_rules =~ s/servername/%1/g;
$rewrite_rules =~ s/proto/$proto/g;
$PerlConfig .= $rewrite_rules;
if ( -f "/etc/DEBUG" ) {
    print STDERR Apache::PerlSections->dump();

ServerAdmin admin
DocumentRoot /home/sites/home/web
RewriteEngine on
RewriteCond %{HTTP_HOST}                !^$
RewriteCond %{HTTP_HOST}                !^$
RewriteRule ^/(.*)            $1 [L,R]
RewriteOptions inherit
AliasMatch ^/~([^/]+)(/(.*))? /home/sites/home/users/$1/web/$3
AddHandler cgi-script .cgi
<Directory /home/web/sites/*/public>
        Options +All +ExecCGI
<Files *.inc>
        Order deny,allow
        deny from all
        allow from none
CustomLog /home/web/sites/morsenorris/logs/access_log acr

errorlog /home/web/sites/morsenorris/logs/error_log
documentroot /home/web/sites/morsenorris/public

sslengine on
SSLCertificateKeyFile /home/web/sites/morsenorris/conf/privatekey
SSLCertificateFile /home/web/sites/morsenorris/conf/certificate
transferlog /home/web/sites/morsenorris/logs/access_log
errorlog /home/web/sites/morsenorris/logs/error_log
documentroot /home/web/sites/morsenorris/public/secure

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message