Home > Apache > Move Apache Log Files

Move Apache Log Files

June 10, 2005 Posted by KP

When I checked emails with Outlook Express today, all POP3 accounts on my two servers gave me an error message “Invalid username or password”, which really freaked me out. Later I found it’s because /var file system used up again.

My ISP assigned 4GB to /var by default, I thought it’s enough after I linked /var/db to other place, obviously I underestimated Apache log files - which can consume 4GB in a couple of weeks. To avoid any possible strange errors, also to make /var/log cleaner (I placed Apache logs file under /var/log/), I decide to move out Apache log files too.

This is quite simple though, make a folder /home/apachelog/, link it to /var/log/www. In order to keep it more flexible, I didn’t use /home/apachelog/ directly in httpd.conf file.

Detailed Steps
1. # mkdir /home/apachelog
2. # ln -s /home/apachelog /var/log/www
3. Make a global replace in Apache configuration file.
vi command: :%s/\/var\/log/\/var\/log\/www/g
4. Restart Apache
5. Modify Awstats configuration files for every domain.

By the way, I’m reading the book “Mastering FreeBSD and OpenBSD Security”, only finished a small part so far, but I find it’s a great book, I hope I can learn some practical tips soon.

Bookmark and Share


Related Posts:

Filed Under: Apache

Leave a Comment









*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word




Categories

Archives

Meta