-   Linux - Software (
-   -   how to disable apache error_log (

nuttynibbles 03-14-2013 09:42 PM

how to disable apache error_log

will someone help me to turn off apache error_log? i have been trying to disable apache error_log in /var/log/apache2/error_log but unsuccessful. im doing it temporary to debug a system problem. i have tried out different methods like commenting error_log and setting "error_log /dev/null" in /etc/apache2/httpd.conf and /etc/apache2/vhosts.d/vhost.conf but still not successful.

i have nagios installed and its nagios.conf is in /etc/apache2/conf.d/nagios.conf. i tried setting error_log /dev/null within <direcotry> but got an error.

kirukan 03-14-2013 10:09 PM


ErrorLog /dev/null
How you used the line error_log or ErrorLog?

nuttynibbles 03-14-2013 10:15 PM

hey sorry typo, i used ErrorLog /dev/null. its not working tho

eklavya 03-15-2013 12:02 AM

If you open php.ini, you will find

log_errors = On
change it to

log_errors = Off
and restart apache.
as well as you can comment following line in your apache2.conf

ErrorLog ${APACHE_LOG_DIR}/error.log
Restart apache.

nuttynibbles 03-15-2013 12:28 AM

hi, im not using php. in fact im working with cgi. i discover that cgi output is written to the error_log file. i read that scriptlog is responsible for it but where can i disable it??

eklavya 03-15-2013 01:15 AM

ScriptLog Directive
Description: Location of the CGI script error logfile
Syntax: ScriptLog file-path
Context: server config, virtual host
Status: Base
Module: mod_cgi, mod_cgid

The ScriptLog directive sets the CGI script error logfile. If no ScriptLog is given, no error log is created. If given, any CGI errors are logged into the filename given as argument. If this is a relative file or path it is taken relative to the ServerRoot.

ScriptLog logs/cgi_log
This log will be opened as the user the child processes run as, i.e. the user specified in the main User directive. This means that either the directory the script log is in needs to be writable by that user or the file needs to be manually created and set to be writable by that user. If you place the script log in your main logs directory, do NOT change the directory permissions to make it writable by the user the child processes run as.

Note that script logging is meant to be a debugging feature when writing CGI scripts, and is not meant to be activated continuously on running servers. It is not optimized for speed or efficiency, and may have security problems if used in a manner other than that for which it was designed.

All times are GMT -5. The time now is 06:45 AM.