找不到 apache 错误日志

3 logging apache-2.2

看来我的服务器没有错误日志。我在任何地方都找不到它们。在 info.php 文件中没有提到任何错误日志。我尝试了 pico /usr/local/apache/logs/error_log 之类的命令,但当然没有结果。如何找到 apache 错误日志并查看它们?

谢谢您的帮助

And*_*ovs 6

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

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

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

# grep ErrorLog /usr/local/etc/apache22/httpd.conf
# grep ErrorLog /etc/apache2/apache2.conf
# grep ErrorLog /etc/httpd/conf/httpd.conf
Run Code Online (Sandbox Code Playgroud)

示例输出:

# ErrorLog: The location of the error log file.
# If you do not specify an ErrorLog directive within a 
ErrorLog "/var/log/httpd-error.log"
Run Code Online (Sandbox Code Playgroud)

来源