# Stopping Nginx

**URL:** <https://www.ruby-forum.com/t/stopping-nginx/191688>\
**Category:** Rails\
**Created:** [July 16, 2010, 8:52am UTC](https://www.ruby-forum.com/t/stopping-nginx/191688 "2010-07-16T08:52:32Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![paulbutcher](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a5b964/32.png) [@paulbutcher](https://www.ruby-forum.com/u/paulbutcher)\
**Post date:** [July 16, 2010, 8:52am UTC](https://www.ruby-forum.com/t/stopping-nginx/191688/1 "2010-07-16T08:52:32Z")

</div>

I’m trying to get rails running with Nginx. I have Nginx installed using  
Macports and I can get it running. But I can’t stop it. This will not  
work:

alias nginx-stop=“sudo launchctl unload  
/Library/LaunchDaemons/org.macports.nginx.plist”

I get “launchctl: Error unloading: nginx”.

Using “killall nginx” didn’t stop it either, before. Now it suddenly  
does. Is this a good way to stop it?

---

<div class="post-metadata">

**Author:** ![paulbutcher](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a5b964/32.png) [@paulbutcher](https://www.ruby-forum.com/u/paulbutcher)\
**Post date:** [July 16, 2010, 5:55pm UTC](https://www.ruby-forum.com/t/stopping-nginx/191688/2 "2010-07-16T17:55:36Z")

</div>

Not sure if this will help as I am running nginx in Ubuntu, but it took  
me a  
bit to find this. These are the commands that work for me:

Stop nginx: sudo /opt/nginx/sbin/nginx -s stop  
Start nginx: sudo /opt/nginx/sbin/nginx

2010/7/16 PÃ¥l BergstrÃ¶m [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![paulbutcher](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a5b964/32.png) [@paulbutcher](https://www.ruby-forum.com/u/paulbutcher)\
**Post date:** [July 16, 2010, 9:25pm UTC](https://www.ruby-forum.com/t/stopping-nginx/191688/3 "2010-07-16T21:25:49Z")

</div>

David K. wrote:

> Not sure if this will help as I am running nginx in Ubuntu, but it took

I run it on my mac but I plan to install it on a VPS with Debian 5 so  
it’s good to know. Did you install it using Passenger or apt?

---

<div class="post-metadata">

**Author:** ![paulbutcher](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a5b964/32.png) [@paulbutcher](https://www.ruby-forum.com/u/paulbutcher)\
**Post date:** [July 16, 2010, 10:17pm UTC](https://www.ruby-forum.com/t/stopping-nginx/191688/4 "2010-07-16T22:17:16Z")

</div>

## Ok, first, yes, I am using Passenger/Nginx combination. Maybe this will help

If you are not planning on using SSL with it then you can

gem install passenger  
passenger-install-nginx-module

And this worked great until I tried to get ssl up. As I found out the  
hard  
way, if you want ssl you have to compile it from source.

2010/7/16 PÃ¥l BergstrÃ¶m [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![paulbutcher](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a5b964/32.png) [@paulbutcher](https://www.ruby-forum.com/u/paulbutcher)\
**Post date:** [July 17, 2010, 1:59am UTC](https://www.ruby-forum.com/t/stopping-nginx/191688/5 "2010-07-17T01:59:30Z")

</div>

Hello together,

in CentOs i have to send a “kill -9 2134”. The last number is nginx’s  
process id.

Maybe that helps someone.

---

<div class="post-metadata">

**Author:** ![paulbutcher](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a5b964/32.png) [@paulbutcher](https://www.ruby-forum.com/u/paulbutcher)\
**Post date:** [July 17, 2010, 2:02am UTC](https://www.ruby-forum.com/t/stopping-nginx/191688/6 "2010-07-17T02:02:32Z")

</div>

Dan Lenz wrote:

> Hello together,
> 
> in CentOs i have to send a “kill -9 2134”. The last number is nginx’s  
> process id.
> 
> Maybe that helps someone.

also tried in a ubuntu vm a second ago. also works this way here… so  
it should also work in debian.
