프로그래밍

nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)

흰색앵초 2012. 5. 26. 15:09

nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)

Today I’m facing the following error message after added custom module to nginx
1root@ibnuyahya:~# sudo /etc/init.d/nginx restart
2 * Stopping Web Server nginx [OK]
3 * Starting Web Server nginx                                                                                                                                                         nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
4nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
5nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
6nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
7nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
8nginx: [emerg] still could not bind()

solution?
check running pid

1fuser -n tcp 80
280/tcp:              26621 26622

Kill

1root@ibnuyahya:~# kill -9 26621
2root@ibnuyahya:~# kill -9 26622

restart nginx

1root@ibnuyahya:~# sudo /etc/init.d/nginx restart