Web Hosting Talk







View Full Version : virtualhost logfile size


vanHelsing
09-14-2004, 11:50 AM
Im configuring my apache virtualhosts logfile settings. I want that new logfile is started every time log files hits 30mb size and old logfiles is named something like access.1, access.2...

My current setup, now here it will just grow that 1 logfile to the end of time :)

<VirtualHost *:80>
ServerAdmin admin@myserver.com
DocumentRoot /home/user/html
ServerName user.myserver.com
IndexOptions FancyIndexing IconHeight IconWidth SuppressDescription IconsAreLinks NameWidth=35 FoldersFirst
ErrorLog /var/log/apache/user/error.log
CustomLog /var/log/apache/user/access.log common
</VirtualHost>

RexAdmin
09-14-2004, 01:42 PM
You need to setup logrotate for your logs.

/etc/logrotate.d and /etc/logrotate.conf are the files.

Good luck.

vanHelsing
09-14-2004, 10:42 PM
Thx. So in /etc/logrotate.d i now have this:

/var/log/apache/*.log {
weekly
missingok
rotate 52
compress
delaycompress
notifempty
create 640 root adm
sharedscripts
postrotate
/etc/init.d/apache reload > /dev/null
endscript
}

Is this the correct way to edit this? All my logs are in apache sub-folders like this /var/log/apache/user/access.log. Would this make effect on them also?

/var/log/apache/*.log {
size 30 mb
create 640 root adm
}