0

If I go on and delete the file"/var/log/apache2/error.log". Then obviously the errors won't be logged.

But the question is:-

when the apache tries to write the errors to the file(error.log) which is missing in this case, won't it throw some error ?? If so where will it be stored? If not then why ??

1 Answer 1

1

If you do this while apache is running, the directory entry for the file will be deleted, but not the file itself (since the server has it open). This usually bites people when they do it to free up disk space, because the file still takes up space, can grow, and it will only truly go away once everybody who has it open closes it.

If you delete the file while apache is not running, it'll just create it when starting. If you prevent apache from being able to write to it, the server will simply not start, if I recall correctly.

So in summary, a missing file is not a problem as long as apache can create it, and in fact, this is how logfile rotation usually works. (Rename file, tell server to close and open the logfile. Closing closes the old renamed one, opening will open a fresh one.)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .