啟動nginx服務提示98: Address already in use
2016-06-29 21:45:27
15169
今天在做LNMP的時候,啟動nginx服務,無法開啟,導致網(wǎng)頁打不開。把服務從起一下發(fā)現(xiàn)提示錯誤如下:
Starting 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()
問題描述:地址已被使用??赡躰ginx服務卡死了,導致端口占用,出現(xiàn)此錯誤。
解決方法:首先用lsof:80看下80端口被什么程序占用。lsof返回結(jié)果如下:
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
nginx 3274 root 6u IPv4 10664 0t0 TCP *:http (LISTEN)
nginx 3547 nginx 6u IPv4 10664 0t0 TCP *:http (LISTEN)
發(fā)現(xiàn)是nginx程序,所以我們把nginx服務k掉,重新啟動服務。。命令如下:
kill -9 3274
kill -9 3547
service nginx start
Starting nginx: [ OK ]
OK了,服務成功啟動!~~