[英]Nginx running or not?
我很惊讶,因为:
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
启动Nginx时,所以我认为Nginx或其他端口正在运行。 我已经测试过:
lsof -i :80
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
nginx 13557 www-data 8u IPv4 100729 0t0 TCP *:http (LISTEN)
nginx 13558 www-data 8u IPv4 100729 0t0 TCP *:http (LISTEN)
所以是的,Nginx正在运行,实际上网页正在运行。 都是完美的,但是...不是!
这怎么可能呢?
service nginx status
[FAIL] nginx is not running ... failed!
没跑吗 但是我无法启动任何其他实例,因为它正在运行! 发生了什么?
重新启动时相同:
service nginx restart
Restarting nginx: Enter PEM pass phrase:
Enter PEM pass phrase:
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
提前致谢。
检查nginx是否正在运行:
ps aux | grep nginx
如果nginx进程存在,那么它肯定正在运行。 使用lsof验证的内容仅证明80端口被某些进程(例如apache httpd或某些其他http服务器)占用。 如果nginx进程未运行,但仍在使用80端口,这也说明了为什么无法启动nginx。 在这种情况下,您需要在进程列表中查找以查看哪个Web服务器已经在运行。 杀死它并重新启动nginx,然后它应该可以正常工作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.