Ubuntu Apache2監控可通過以下方式實現:
tail -f /var/log/apache2/access.log
和tail -f /var/log/apache2/error.log
實時查看訪問和錯誤日志,或用awk
、grep
等工具分析日志內容。mod_status
模塊(編輯/etc/apache2/apache2.conf
,添加LoadModule status_module
等配置并重啟Apache),通過http://服務器IP/server-status
查看狀態頁面。top
、htop
、vmstat
、iostat
、sar
、dstat
、glances
等命令監控CPU、內存、磁盤等系統資源使用情況。