How delete Apache Log?

eConcept-Web

Verified User
Joined
Jan 31, 2004
Messages
63
Hi everybody, i woud like delete the apache error log. How we do that? thx all and Direct Admin is the best panel :)
 
/var/log/httpd/*

Delete what you need - main ones should be access_log and error_log

Chris
 
I just check the size of my log dirs with: du -h mydir | grep mydir$

Well, I just see that the size of this log dirs are a little big higher.

The /var/log/httpd dir is 35 Megs, /var/log/exim is 41 Megs and the /var/log dir is 92 Megs. The question is how can I make the dir /var/log not to exceed 20 MB (I don't even know if this is enough).

I am waiting for some suggestions, about what should be normaly the size for the /var/log dir and how can I keep that size to that value, so I do not have problems with the server functionality.

Thanks.
 
We use logrotate - it works fine on average volume servers

pico -w /etc/logrotate.conf

daily
rotate 2
create
compress

leave the remainder of the file and add any additional log files you require rotation for there also.

Chris
 
My /etc/logrotate.conf file looks like this:
Code:
# rotate log files weekly
weekly

# keep 4 weeks worth of backlogs
rotate 1

# create new (empty) log files after rotating old ones
create

# uncomment this if you want your log files compressed
#compress

# RPM packages drop log rotation information into this directory
include /etc/logrotate.d

# no packages own wtmp -- we'll rotate them here
/var/log/wtmp {
    monthly
    create 0664 root utmp
    rotate 1
}

# system-specific logs may be also be configured here.

Does this mean that all the file from /var/log directory are rotated once a week, or do I have to specify the dirs from /var/log which I need to be rotated.
 
That will configure all your main logs - on a standard redhat install it should cover all (if not, most) of the logs in /var/log when you install additional software that doesnt rotate its logs then you can configure them at the bottom of that file and it will include them also.

Chris
 
Back
Top