温馨提示×

CentOS中Apache日志在哪查看

小樊
37
2025-08-30 19:25:48
栏目: 智能运维

CentOS中Apache日志默认路径为:

  • 访问日志/var/log/httpd/access_log
  • 错误日志/var/log/httpd/error_log

查看方式

  • 实时查看sudo tail -f /var/log/httpd/access_log(访问日志)或 sudo tail -f /var/log/httpd/error_log(错误日志)。
  • 分页查看sudo less /var/log/httpd/access_log(支持上下翻页、搜索)。
  • 搜索关键词sudo grep "关键字" /var/log/httpd/access_log(替换为需查找的内容)。

注意:若日志路径因虚拟主机配置不同,可通过命令 grep -R "Log" /etc/httpd/ 查找自定义路径。

0