httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oliver Marshall <Oliver.Marsh...@g2support.com>
Subject RE: [users@httpd] 0 byte logs
Date Tue, 29 Sep 2009 15:29:56 GMT
Thanks Mick.

That helped. The if line returned;

ERROR: APACHE_PID_FILE needs to be defined in /etc/apache2/envvars

So I added the following to envvars;

APACHE_PID_FILE=/var/run/apache2.pid
export APACHE_PID_FILE

and checked that /var/run/apache2.pid had the pid of apache2 in it. 


I've forced logrotate to roll the logs and so it appears to be working.

Thanks for the help.

--
G2 Support
Network Support : Online Backups : Server Management

Web: www.g2support.com
Twitter: g2support
Newsletter: www.g2support.com/newsletter


-----Original Message-----
From: Mick Sheppard [mailto:Mick.Sheppard@cpp.co.uk] 
Sent: 29 September 2009 15:37
To: users@httpd.apache.org
Subject: RE: [users@httpd] 0 byte logs



> -----Original Message-----
> From: Oliver Marshall [mailto:Oliver.Marshall@g2support.com]
> Sent: 29 September 2009 15:09
> To: users@httpd.apache.org
> Subject: RE: [users@httpd] 0 byte logs
> 
> Hi Mick,
> 
> We are using logrotate to rotate the logs using the following conf
file;
> 
> *********************
> /var/log/apache2/*.log {
>         weekly
>         missingok
>         rotate 12
>         compress
> #       delaycompress
>         notifempty
>         create 640 www-data www-data
>         sharedscripts
>         postrotate
>                 if [ -f "`. /etc/apache2/envvars ; echo
> ${APACHE_PID_FILE:-/var/run/apache2.pid}`" ]; then
>                         /etc/init.d/apache2 reload > /dev/null
>                 fi
>         endscript
> }
> **********************
> 
> The log that was just rolled doesn't continue to grow. It's gzip'd and
> then sits there. A new log is created but then doesnt grow. The
listing
> shows this;
> 
> -rw-r----- 1 www-data www-data       0 2009-09-27 06:38 access.log
> -rw-r----- 1 www-data www-data 1119157 2009-09-27 00:19
access.log.1.gz
> -rw-r----- 1 www-data www-data  167234 2009-09-22 05:25
access.log.2.gz
> 
> Any ideas ?

I'm not familiar with logrotate, except what I've just googled so bare
that in mind.

It looks as though your postrotate script isn't reloading Apache. This
is the cause of your 0 byte logs. Apache is still attempting to write to
the old log file, now compressed so non-existent in its original form.
It's only with the apachectl graceful you are issuing that Apache knows
to use the new log file.

What does the test in the if statement return if you run it outside
logrotate? Its being used to determine whether there is a running Apache
server that needs to be reloaded.

Mick

This is an email from the CPP Group Plc, Holgate Park, York, YO26 4GA; telephone +44 (0)1904
544500.
This message may contain information that is confidential. If you are not the intended recipient,
you may not peruse, use, disseminate, distribute or copy this message. If you have received
this
message in error, please notify the sender immediately by email, facsimile or telephone and
either
return or destroy the original message.

The CPP Group Plc accepts no responsibility for any changes made to this message after it
has been
sent by the original author.  This email has been scanned for all viruses by the MessageLabs

Email Security System.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message