# Nginx won't stop

**URL:** <https://www.ruby-forum.com/t/nginx-wont-stop/214602>\
**Category:** NGINX\
**Created:** [December 7, 2011, 1:30am UTC](https://www.ruby-forum.com/t/nginx-wont-stop/214602 "2011-12-07T01:30:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [December 7, 2011, 1:30am UTC](https://www.ruby-forum.com/t/nginx-wont-stop/214602/1 "2011-12-07T01:30:48Z")

</div>

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?!

---

<div class="post-metadata">

**Author:** ![mansfiem](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/fbc32d/32.png) [@mansfiem](https://www.ruby-forum.com/u/mansfiem)\
**Post date:** [December 7, 2011, 4:20am UTC](https://www.ruby-forum.com/t/nginx-wont-stop/214602/2 "2011-12-07T04:20:53Z")

</div>

On Wed, Dec 7, 2011 at 7:30 AM, Matthew M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) 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](http://www.asciiribbon.org)

---

<div class="post-metadata">

**Author:** ![mansfiem](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/fbc32d/32.png) [@mansfiem](https://www.ruby-forum.com/u/mansfiem)\
**Post date:** [December 7, 2011, 5:38am UTC](https://www.ruby-forum.com/t/nginx-wont-stop/214602/3 "2011-12-07T05:38:34Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![mansfiem](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/fbc32d/32.png) [@mansfiem](https://www.ruby-forum.com/u/mansfiem)\
**Post date:** [December 7, 2011, 5:47am UTC](https://www.ruby-forum.com/t/nginx-wont-stop/214602/4 "2011-12-07T05:47:55Z")

</div>

On Wed, Dec 7, 2011 at 11:38 AM, Matthew M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
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](http://www.asciiribbon.org)
