Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Error_log


My error_log is now at 40MB. I would like to reduce this file size.

I'm trying to locate the error log so that I can edit and remove content of the file. But that's easier said than done.

In my httpd.conf file, the location of the log file is set to logs/error_log. But I'm not able to locate any folder called logs.

I do have the folder var/log/httpd/, but the largest error_log file is only at 670KB.

So how can I reduce the filesize of my error_log?

Log Rotation


I discovered that Log Rotatio was switched off. So I switched this on and set the size to be about 4MB. But today, the log file was still at 40MB.

Now I have set it to log Weekly and maksimum of 52 files.

But when does this come in effect? When does it create a new log file? It obviously did not do that when I set it to maks 4MB.

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted
  • To find out where is the logs directory, you have to search for the ServeRoot directive, under the ServerRoot you will normally have the logs directory.
  • If you want your changes to take effects, you have to restart the Apache server process every time you change the configuration.
  • You can even specify the full path of the error_log and even a name you like more:

    ErrorLog /var/log/httpd/error_log
    or
    ErrorLog /var/log/httpd/idontlikeerrors_log

Edit

A note for whom works with Plesk

Customizable httpd.include per domain

In Plesk each domain has virtual hosts configuration stored in a separate file:

/home/httpd/vhosts//conf/httpd.include

This file is overwritten each time the virtual host configuration is changed, thus any manual alterations made to the file are discarded. To use custom directives or redefine those inserted by Plesk, you need to create the files vhost.conf and/or vhost_ssl.conf with necessary directives in the directory /home/httpd/vhosts//conf/

If any (or both) of these files exist by the time the main configuration file is generated, Plesk inserts the appropriate directive Include /home/httpd/vhosts//conf/vhost.conf or Include /home/httpd/vhosts//conf/vhost_ssl.conf into the HTTP and/or HTTPS virtual host context respectively.

For security reasons, only root can create the vhost.conf and vhost_ssl.conf files.

For the changes to take effect, you need to run the following:

/usr/local/psa/admin/sbin/websrvmng --reconfigure-vhost --vhost-name=

share|improve this answer
    
Ah, the reset it is. I'm using plesk (not Telnet), so I don't think I have the search option. Should I change path of ErrLog in httpd.conf or in httpd.include ? –  Steven Jan 25 '11 at 11:32
    
@steven I don't know well Plesk (I know apache), but I think it's http.include –  tmow Jan 25 '11 at 12:09
    
Thanks for your help :) –  Steven Jan 25 '11 at 16:08
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.