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/
查找自定義路徑。