Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm working on setting up a VPS with a Rails 3.1 application using nginx+passenger, and capistrano to boot strap it. At first, I installed nginx using a binary, forgetting that passenger installs it as well. When passenger asked me, I created a directory ~/opt/nginx for it to install into. Now, when I run the following:

sudo /etc/init.d/nginx stop
lsof -i:80

The server seems to stop, and nothing reports back at port 80. However, I then try to run

sudo ~/opt/nginx/sbin/nginx

And it says:

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

Any ideas what's going on? Note that I installed nginx this way because I am using a user rvm install, and therefore using sudo passenger-install-nginx-module would specify the wrong version of ruby.

share|improve this question
add comment

1 Answer

Did you run lsof with sudo?

Does this return anything listening on port 80?

netstat -an | grep LISTEN*

When you connect to port 80 do you get any message?

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.