What is the correct path for rotatelogs on Apache 2.4 on Ubuntu 16.04?

On new Ubuntu 16.04 system installed Apache 2.4, however when using the same config as previous Ubuntu 12 with Apache 2.2 the Apache rotatelogs program is missing.

In previous 2.2 the path was /usr/sbin/rotatelogs.

Installed Apache on Ubuntu 16.04 with:

sudo apt-get install apache2 apache2-utils

Rotatelogs seems to be documented in 2.4. However the comments indicate path of bin/rotatelogs, but that results in error.


(2)No such file or directory: AH00089: Couldn't start ErrorLog process 'bin/rotatelogs /sites/mysite/apache_error_%Y.%m.%d.log 5M'. 
AH00015: Unable to open logs

In case there are questions the config lines:

Apache 2.2 (works on Ubuntu 12)

ErrorLog "|/usr/sbin/rotatelogs /sites/mysite/apache_error_%Y.%m.%d.log 5M"

Apache 2.4 (both don't work on Ubuntu 16)

ErrorLog "|/usr/sbin/rotatelogs /sites/mysite/apache_error_%Y.%m.%d.log 5M"

ErrorLog "|bin/rotatelogs /sites/mysite/apache_error_%Y.%m.%d.log 5M"

  • 1
    which rotatelogs on my 16.04 Apache server gives /usr/bin/rotatelogs. Server version is 2.4.18. – Jos Mar 9 '17 at 21:33
  • @Jos doh! that works – thames Mar 9 '17 at 22:09
  • For the sake of completeness, I will turn that into an answer. – Jos Mar 9 '17 at 22:11

To find the path of an executable, use which.

which rotatelogs on a default Apache installation version 2.4.18 on Ubuntu Server 16.04 gives /usr/bin/rotatelogs.

  • ErrorLog "|/usr/bin/rotatelogs /sites/mysite/apache_error_%Y.%m.%d.log 5M" – thames Mar 9 '17 at 22:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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