找不到apache错误日志

看来我的服务器没有错误日志。 我无法在任何地方find他们。 在info.php文件中没有提及任何错误日志。 我尝试像pico / usr / local / apache / logs / error_log这样的命令,但是当然没有结果。 我怎样才能findApache的错误日志,并查看他们?

谢谢您的帮助

默认的apache错误日志位置,由发行版的:

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

要find确切的apache错误日志文件位置,可以使用grep命令:

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

示例输出:

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

来源 。

要添加已经给出的内容,你可以试试这个(如果你不确定你在运行什么发行版):

 [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" 

注意DEFAULT_ERRORLOG行。