排查 CentOS 上的 LNMP(Linux, Nginx, MySQL, PHP)故障可以通过以下步骤进行:
systemctl status nginx
tail -f /var/log/nginx/error.log
systemctl status mysqld
tail -f /var/log/mysqld.log
systemctl status php-fpm
tail -f /var/log/php-fpm/error.log
chown -R nginx:nginx /path/to/your/website
chmod -R 755 /path/to/your/website
sestatus
tail -f /var/log/audit/audit.log | grep avc
ping 命令检查服务器是否可达:ping your_server_ip
telnet 或 nc 检查端口是否开放:telnet your_server_ip 80
# 或者
nc -zv your_server_ip 80
firewall-cmd --state
firewall-cmd --list-all
nslookup 或 dig 检查域名解析:nslookup yourdomain.com
# 或者
dig yourdomain.com
php.ini 文件:cat /etc/php.ini
php -m
cat /etc/nginx/nginx.conf
nginx -t
systemctl restart nginx
systemctl restart mysqld
systemctl restart php-fpm
通过以上步骤,你可以逐步排查并解决 CentOS 上的 LNMP 故障。如果问题依然存在,可以考虑查看系统日志或寻求社区帮助。