我用 this tutorial 安装了 LEMP我已经完成了它所说的一切,但是当我在浏览器中输入我的服务器 ip 地址时,加载页面需要一些时间,而且我的浏览器似乎正在执行一些进程来加载页面,但最后页面是空白的。
我又检查了一遍所有的安装,都安装好了。
我过去安装过 apache,如果你输入服务器 ip 地址,我知道 apache 服务器显示“apache 正在运行”,但这是我第一次安装 nginx;我想安装 DirectAdmin,但我不知道 nginx 是否已安装。
如果有人熟悉 nginx 并且可以帮助我,我将不胜感激。
更新:当我使用 service nginx status
时,它显示 nginx 正在运行。
更新:我的检查结果如下:
netstat -tulpn | 的结果grep:80
:
tcp 0 0 0.0.0.0:80 0.0.0.0:*
LIST EN 10302/nginx
ps aux | 的结果grep nginx
:
nginx 8556 0.0 0.0 222416 3552 ? S 09:04 0:00 php-fpm: pool w ww
nginx 8557 0.0 0.0 222416 3552 ? S 09:04 0:00 php-fpm: pool w ww
nginx 8558 0.0 0.0 222416 3552 ? S 09:04 0:00 php-fpm: pool w ww
nginx 8559 0.0 0.0 222416 3552 ? S 09:04 0:00 php-fpm: pool w ww
nginx 8560 0.0 0.0 222416 3552 ? S 09:04 0:00 php-fpm: pool w ww
root 10302 0.0 0.0 96032 1980 ? Ss 09:11 0:00 nginx: master p rocess /usr/sbin/nginx -c /etc/nginx/nginx.conf
nginx 10304 0.0 0.0 96436 2692 ? S 09:11 0:00 nginx: worker p rocess
nginx 10305 0.0 0.0 96436 2692 ? S 09:11 0:00 nginx: worker p rocess
nginx 10306 0.0 0.0 96436 2660 ? S 09:11 0:00 nginx: worker p rocess
nginx 10307 0.0 0.0 96436 2672 ? S 09:11 0:00 nginx: worker p rocess
root 12564 0.0 0.0 103312 856 pts/0 S+ 09:59 0:00 grep nginx
最佳答案
FIIIIINNNNNNAAAAAALLLLLLLY 我发现了问题!
问题出在我的防火墙上。
如果其他人有同样的问题,那可能是像我一样的防火墙设置问题所以请执行以下操作来解决此问题:
vim /etc/sysconfig/iptables
在打开的文件中找到这一行:
-A INPUT -m state --state NEW -p tcp --dport 80 -j ACCEPT
检查 --dport 80
是否设置为您在 /etc/nginx/conf.d/default.conf
中输入的端口,如果是 --dport 22
将其更改为您的默认端口。
更新:
更改端口后,您应该运行此代码:
service iptables restart
关于linux - nginx 已安装但站点未加载,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39102934/