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.

It seems my server doesn't have error logs . i can't find them anywhere . in info.php file there is no mention about any error log. I tried commands like pico /usr/local/apache/logs/error_log ,but of course,no results. How can i find the apache error logs and view them ?

thanks for the help

share|improve this question

migrated from stackoverflow.com Jul 5 '11 at 11:16

This question came from our site for professional and enthusiast programmers.

    
this is a perfect question for Google I think :-) –  mnicky Jul 5 '11 at 8:29
    
ok, to help you a little bit: cyberciti.biz/faq/apache-logs ;-) –  mnicky Jul 5 '11 at 8:31
    
thanks,but i already tried that. nothing happens. maybe i do something wrong..i am a newbie .. –  whitelord Jul 5 '11 at 8:36
    
find your httpd.conf and try: grep 'ErrorLog\|CustomLog' httpd.conf –  mnicky Jul 5 '11 at 8:42
2  
On CentOS it should be /var/log/httpd/error_log and /var/log/httpd/access_log –  mnicky Jul 5 '11 at 9:04
show 9 more comments

2 Answers

Default apache error log location, by distro's:

RHEL / Red Hat / CentOS / Fedora - /var/log/httpd/error_log
Debian / Ubuntu - /var/log/apache2/error.log
FreeBSD - /var/log/httpd-error.log

To find exact apache error log file location, you can use grep command:

# grep ErrorLog /usr/local/etc/apache22/httpd.conf
# grep ErrorLog /etc/apache2/apache2.conf
# grep ErrorLog /etc/httpd/conf/httpd.conf

Sample output:

# ErrorLog: The location of the error log file.
# If you do not specify an ErrorLog directive within a 
ErrorLog "/var/log/httpd-error.log"

Source.

share|improve this answer
add comment

To add what is already given, you can try this (if you are not sure what distro you are running):

[root@centos ~]# httpd -V
Server version: Apache/2.2.3
Server built:   May  4 2011 06:51:15
Server's Module Magic Number: 20051115:3
Server loaded:  APR 1.2.7, APR-Util 1.2.7
Compiled using: APR 1.2.7, APR-Util 1.2.7
Architecture:   32-bit
Server MPM:     Prefork
  threaded:     no
    forked:     yes (variable process count)
Server compiled with....
 -D APACHE_MPM_DIR="server/mpm/prefork"
 -D APR_HAS_SENDFILE
 -D APR_HAS_MMAP
 -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
 -D APR_USE_SYSVSEM_SERIALIZE
 -D APR_USE_PTHREAD_SERIALIZE
 -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
 -D APR_HAS_OTHER_CHILD
 -D AP_HAVE_RELIABLE_PIPED_LOGS
 -D DYNAMIC_MODULE_LIMIT=128
 -D HTTPD_ROOT="/etc/httpd"
 -D SUEXEC_BIN="/usr/sbin/suexec"
 -D DEFAULT_PIDLOG="run/httpd.pid"
 -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
 -D DEFAULT_LOCKFILE="logs/accept.lock"
 -D DEFAULT_ERRORLOG="logs/error_log"
 -D AP_TYPES_CONFIG_FILE="conf/mime.types"
 -D SERVER_CONFIG_FILE="conf/httpd.conf"

Note DEFAULT_ERRORLOG line.

share|improve this answer
add comment

Your Answer

 
discard

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