centos

Apache2在CentOS上的错误日志在哪

小樊
31
2025-05-12 23:20:18
栏目: 智能运维

在 CentOS 上,Apache2(通常称为 Apache HTTP Server)的错误日志通常位于以下路径:

/var/log/httpd/error_log

要查看错误日志,您可以使用 tail 命令实时查看日志的最后几行,例如:

sudo tail -f /var/log/httpd/error_log

这将显示错误日志的最新条目,并在新的错误条目添加到日志时实时更新。如果您想查看特定数量的行,可以将 -f 选项替换为 -n,后跟要显示的行数,例如:

sudo tail -n 100 /var/log/httpd/error_log

这将显示错误日志的最后 100 行。

0
看了该问题的人还看了