Nginx won't stop

Hello everyone,

I’ve spent the last few hours on what I thought was the end of a
Rails/Passenger/Nginx setup but I have had absolutely no luck.

When I try to restart nginx (using /etc/init.d/nginx restart) I get:

Restarting 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()
nginx.

If I stop the server, it seems successful, but if I run the command
“lsof -i :80” as root I see:

COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
nginx 2801 root 6u IPv4 7489 0t0 TCP *:www (LISTEN)
nginx 2802 nobody 6u IPv4 7489 0t0 TCP *:www (LISTEN)

If I manually kill the nginx process and then start it, it works but
does NOT take into account any changes I’ve made to my configuration
files. So far, I seem completely unable to make any changes to my
configuration work. Even removing default from sites-enabled did
nothing.

At this point I’m so frustrated I’m close to heaving my computer out a
window. Any ideas?!

On Wed, Dec 7, 2011 at 7:30 AM, Matthew M. [email protected] wrote:

If I manually kill the nginx process and then start it, it works but
does NOT take into account any changes I’ve made to my configuration
files. So far, I seem completely unable to make any changes to my
configuration work. Even removing default from sites-enabled did
nothing.

sounds like nginx you started manually read different config file. try
nginx -V

Also, providing the nginx.conf would help.


O< ascii ribbon campaign - stop html mail - www.asciiribbon.org

Ok so I think you’re right.

I’m using the passenger-install-nginx-module command, with a target
directory of /opt/nginx. I removed /etc/nginx, /opt/nginx,
/usr/sbin/nginx, and tried to reinstall fresh.

Fresh install initially seemed to work, with the first restart working
fine, but a second time it is the exact same as it was before.

Before when I ran nginx -v I got 1.0.5, but now I get

-bash: /usr/sbin/nginx: No such file or directory

because I deleted it obviously. Any thoughts of how I can go about
finding the other installation and removing it or just being absolutely
sure I’ve removed everything?

On Wed, Dec 7, 2011 at 11:38 AM, Matthew M. [email protected]
wrote:

-bash: /usr/sbin/nginx: No such file or directory

Restart bash: exec bash

Also what do you mean by “second time (restart)”?


O< ascii ribbon campaign - stop html mail - www.asciiribbon.org

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs