一看到网站连接失败是绝望的。一开始还以为是nginx停止的原因,那nginx重启了一遍又一遍发现无济于事
/usr/local/webserver/nginx/sbin/nginx -s reload # 重新载入配置文件
/usr/local/webserver/nginx/sbin/nginx -s reopen # 重启 Nginx
/usr/local/webserver/nginx/sbin/nginx -s stop # 停止 Nginx
然后又排查了权限和nginx.conf 发现都没问题!那就奇怪了。。
最后抱着摸着石头过河的心态用/root/nginx-1.9.9/sbin/nginx -c /root/nginx-1.9.9/conf/nginx.conf 命令来启动下Nginx。
发现了几个错误(总比没错误摸索好)
nginx: [emerg] bind() to 0.0.0.0:8080 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:8080 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:8080 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:8080 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:8080 failed (98: Address already in use)
nginx: [emerg] still could not bind()
貌似是端口的问题。将/conf/nginx.conf 里面的监听端口改为80 。OK正常访问
已root权限启动的用 1024以下的端口,没有用1024以上