I changed /etc/apache2/envars like this.

#export APACHE_LOG_DIR=/var/log/apache2$SUFFIX
export APACHE_LOG_DIR=/lv1/var/log/apache2$SUFFIX

And it seems to work. Logs appended in the new directory.

And I changed /etc/logrotate.d/apache2 like this.

/lv1/var/log/apache2/*.log {

And it seems not to work. Logs keep being appended to the same access.log.

How can I make logroate to work for this?

  • 1
    Have you tried running logrotate --debug manually? This could be anything from missing access rights to a syntax error in your file. Dec 27, 2016 at 5:20

1 Answer 1


Looking at the apache logging docs you need to restart the server when the logs are rotated for it to open the new file.

So you can put a postrotate section in with

        /path/to/apachectl graceful

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.