Operating System - HP-UX
1822143 Members
3333 Online
109640 Solutions
New Discussion юеВ

Apache2 Log Rotation not working

 
SOLVED
Go to solution
Leon A. Howorth
Advisor

Apache2 Log Rotation not working

I am running Apache 2.0.45 on HP-UX 11.11.
I am trying to implement log rotation with the
following directives (disregard line wrapping):
ErrorLog "|/opt/hpws/apache/bin/rotatelogs logs/error_log 86400"
CustomLog "|/opt/hpws/apache/bin/rotatelogs logs/access_log 86400" common

The web server starts but no logs are created. If I use the simpler:
ErrorLog logs/error_log
CustomLog logs/access_log common
then logs are created as expected. How can I get log rotation to work and actually create logs?
3 REPLIES 3
Steven E. Protter
Exalted Contributor

Re: Apache2 Log Rotation not working

Tried to post didn't work due to trouble at this end....

I rotate logs with a cron script. The general flow is thus:

mv access_log /home/logs
mv error_log /home/logs

touch access_log
touch error_log

repeat for all sub-sites/virtual hosts

# restart httpd server
# for hp that is as follows:
/sbin/init.d/hpapache2 stop
/sbin/init.d/hpapache2 start

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Dan Wick
New Member

Re: Apache2 Log Rotation not working

Try enable just the access log rotation, using standard error logging & see what shows up in the error_log.
CSS2, IHL Dresden
New Member
Solution

Re: Apache2 Log Rotation not working

rotatelogs requires a full path of logfiles:

ErrorLog "|/opt/hpws/apache/bin/rotatelogs /opt/hpws/apache/logs/error_log 86400" should properly rotate your logs.

fish