LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   how to disable apache error_log (http://www.linuxquestions.org/questions/linux-software-2/how-to-disable-apache-error_log-4175454129/)

nuttynibbles 03-14-2013 10:42 PM

how to disable apache error_log
 
hi,

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 11:09 PM

Quote:

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

nuttynibbles 03-14-2013 11:15 PM

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

eklavya 03-15-2013 01:02 AM

If you open php.ini, you will find
Code:

log_errors = On
change it to
Code:

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

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

nuttynibbles 03-15-2013 01: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 02: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.
Example
Code:

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 02:26 AM.