Debian LNMP故障排查可按以下步驟進行:
systemctl status nginx
、systemctl status mysql
、systemctl status php-fpm
確認各服務是否正常運行。/var/log/nginx/error.log
/var/log/mysql/error.log
/var/log/php-fpm.log
nginx -t
檢查語法,確保 fastcgi_pass
等配置正確。/etc/mysql/my.cnf
中的 datadir
、socket
等參數。listen
地址與Nginx配置一致,檢查 pm.max_children
等參數。netstat -tuln
確認Nginx(80/443)、MySQL(3306)端口監聽正常。ufw status
或 iptables -L
檢查防火墻是否放行相關端口。top
/htop
查看CPU、內存占用,確認無資源耗盡。www-data
)對網站目錄有讀寫權限:chown -R www-data:www-data /var/www/html
。ping
測試網絡連通性,curl
或瀏覽器訪問網站測試基礎訪問。info.php
(<?php phpinfo(); ?>
)驗證PHP是否正常解析。request_terminate_timeout
或增加進程數。www-data
用戶可訪問。參考來源:[1,2,3,5,6,7,8,9,10,11,13,15]