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.
Related Posts:
- Disable Apache Log Files
- Exclude a Sub-directory in Tar Command
- Recursively FTP Files
- More About Apache Log File Rotation
- Separate Log Files for Virutal Host
- Move a Server
- Hide Apache and PHP Information in HTTP Headers
- Apache and Google
Filed Under: Apache