I have a file on my Ubuntu system called access.log that file get all my errors on my website.

The problem is that file its to big right now so I renamed for access-old.log and create a new file called access.log.

But access-old.log still getting the errors, my question is why? and why the new access.log I created don't get my errors now?

  • also look at the logrotate package; it can do this for you automatically. – meuh Sep 29 '15 at 12:35

You need to tell your web server to close and re-open its log files. e.g. if you're running apache, you'd run apachectl graceful

  • thanks for the help, actually that command line did not work :( I don't know why, but that one works: sudo /etc/init.d/apache2 restart , thanks for the help. – raduken Sep 29 '15 at 9:33

apachectl graceful will wait until all the current active connection finished & closed, so it may take a while to work

apachectl restart will force to restart without waiting, same as /etc/init.d/httpd restart

  • Each answer should stand on its own and answer the question.  The above doesn’t make much sense except as an adjunct to cas’s answer, and, as such, might make more sense as a comment; however, you need more reputation for the privilege to comment on any post.  You may be able to make this an answer by expanding it, adding detail and focusing on what the question is asking; contributing something that’s not present in the other answer.  For example, can you explain the relationship between /etc/init.d/apache2 and /etc/init.d/httpd? – G-Man Feb 14 '16 at 6:21

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.