2016-12-23 87 views
0

我想,如下所示nginx的啓動後:nginx的:EMERG] bind()的,以0.0.0.0:80失敗(98:地址已在使用),甚至使用殺死進程端口80

[email protected]:~$ which nginx 
/usr/sbin/nginx 
[email protected]:~$ sudo /usr/sbin/nginx 
nginx: [emerg] bind() to 0.0.0.0:80 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:80 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:80 failed (98: Address already in use) 
nginx: [emerg] still could not bind() 

在此之後EasyEngine tutorial,我試着用fuser -k殺死使用端口80的過程:

[email protected]:~$ sudo fuser -k 80/tcp 
80/tcp:    31924 31925 31926 

然而,之後重新運行sudo /usr/sbin/nginx我得到完全相同的錯誤消息。

我試過幾個其他的「診斷」描述here,使用fuserlsof -inetstat

[email protected]:~$ fuser 80/tcp 
[email protected]:~$ lsof -i :80 | grep LISTEN 
[email protected]:~$ netstat -tulpn | grep --color :80 
(Not all processes could be identified, non-owned process info 
will not be shown, you would have to be root to see it all.) 
tcp  0  0 0.0.0.0:80    0.0.0.0:*    LISTEN  -    
tcp  0  0 127.0.0.1:8080   0.0.0.0:*    LISTEN  -    
tcp  0  0 0.0.0.0:8060   0.0.0.0:*    LISTEN  -  

只有netstat命令給出的結果,但是我無法推斷來自它的進程ID。

關於如何讓nginx工作的任何想法?

回答

4

您應該運行此

[email protected] ~ $ sudo netstat -tulpn | grep --color :80 

它會告訴你進程ID

tcp6  0  0 :::80     :::*     LISTEN  2063/apache2 

2063/Apache2的 - PID /進程名

相關問題