Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Recently I have implement apache 2.4.1 in my web server.The problem is the rotate logs seems to be not functioning.Here is the output in the error_log:

[core:error] [pid 13060:tid 47015847145408] (2)No such file or directory

The command line that i have put in the httpd.conf are such as below:

CustomLog "|bin/rotatelogs -l /var/log/logfile.%Y.%m.%d 86400" combined

Is there anything wrong here with my setup?For your information I've already tested it in apache 2.2.22 and everythings is perfectly working.


share|improve this question

It looks like the user context you are running Apache under does not have rights to create a file in the /logs directory. You can validate this quickly by switching to the user that Apache is running under (sudo su - <username>) and running

touch /logs/testfile
share|improve this answer

Where is the rotatelogs binary located on your system?

You don't have a leading slash on your path, which doesn't seem intended - and the file not being found supports that. You're probably looking for something more along these lines:

CustomLog "|/bin/rotatelogs -l /var/log/logfile.%Y.%m.%d 86400" combined
share|improve this answer
On my CentOS6 box, it's /usr/sbin/rotatelogs, but that's part of the httpd-2.2 package. It's possible the OP compiled 2.4 himself and stashed it someplace like /usr/local/bin/rotatelogs or /usr/local/sbin. – cjc Mar 23 '12 at 3:33
I 've already put the full path and tested it.Still not working and gives the same error.Here the command that i have put : CustomLog "|/usr/local/apache2/bin/rotatelogs /logs/logfile.%Y.%m.%d 86400" combined – Mar 23 '12 at 3:40
/logs/logfile? Does that path exist? – Shane Madden Mar 23 '12 at 3:42
Sorry my bad, I have changed into this one:CustomLog "|/usr/local/apache2/bin/rotatelogs /usr/local/apache2/logs/logfile.%Y.%m.%d 86400" and yet it still not working – Mar 23 '12 at 4:43

Use logrotate, which is included by default (if period is ok)

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.