Nginx + uWSGI on a fresh Ubuntu install - bind error port 80

Posted by knuckfubuck on Server Fault See other posts from Server Fault or by knuckfubuck
Published on 2011-02-09T02:07:59Z Indexed on 2011/02/10 7:27 UTC
Read the original article Hit count: 586

Filed under:
|
|
|
|

I know this is a common problem usually having to do with apache or another service already running on port 80 and I have done a lot of searching and running netstat and still have not figured out why I am getting this error.

I rebuilt my slice, did a fresh install of Ubuntu 10.04 and setup nginx + uwsgi. It worked and I was able to see my Django site. I then installed Postgres8.4 and the rest of the stack needed for Geodjango from this link.

After that was done I tried to restart nginx and I get this error:

sudo /etc/init.d/nginx start
Starting nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
configuration file /usr/local/nginx/conf/nginx.conf test is successful
[emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use)
[emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use)
[emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use)
[emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use)
[emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use)
[emerg]: still could not bind()

I have nginx set to listen 80. Here's an output from netstat -l --numeric-ports | grep 80:

tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN     
tcp        0      0 127.0.0.1:8000          0.0.0.0:*               LISTEN

Output from sudo lsof +M -i4:

nginx    2330     root    8u  IPv4   3195      0t0  TCP *:www (LISTEN)
nginx    2331 www-data    8u  IPv4   3195      0t0  TCP *:www (LISTEN)
uwsgi    2335        s    4u  IPv4   3259      0t0  TCP localhost:8000 (LISTEN)
uwsgi    2352        s    4u  IPv4   3259      0t0  TCP localhost:8000 (LISTEN)
uwsgi    2353        s    4u  IPv4   3259      0t0  TCP localhost:8000 (LISTEN)
uwsgi    2354        s    4u  IPv4   3259      0t0  TCP localhost:8000 (LISTEN)
uwsgi    2355        s    4u  IPv4   3259      0t0  TCP localhost:8000 (LISTEN)

Anyone have any other ideas how I can figure out what is blocking port 80?

edit

Paste of my /etc/init.d/nginx script here: http://dpaste.com/hold/400937/

© Server Fault or respective owner

Related posts about ubuntu

Related posts about nginx