# Can you make Mongrel listen on a specific IP

**URL:** <https://www.ruby-forum.com/t/can-you-make-mongrel-listen-on-a-specific-ip/162101>\
**Category:** Mongrel\
**Created:** [March 5, 2009, 6:33pm UTC](https://www.ruby-forum.com/t/can-you-make-mongrel-listen-on-a-specific-ip/162101 "2009-03-05T18:33:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jngo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e95f7d/32.png) [@jngo](https://www.ruby-forum.com/u/jngo)\
**Post date:** [March 5, 2009, 6:33pm UTC](https://www.ruby-forum.com/t/can-you-make-mongrel-listen-on-a-specific-ip/162101/1 "2009-03-05T18:33:46Z")

</div>

Shared hosting environment where each domain has it’s own IP. Some use  
mongrel server to run their rails apps. Mongrels of course listen on  
their own port. But …

If [client1.com](http://client1.com) has a mongrel listening on 12001 you can go to  
[client2.com:12001](http://client2.com:12001) and see client1’s site.

Not a huge issue but it’s kinda funky.

I don’t see an ip in mongrel’s startup options but perhaps I’m missing a  
way to get the mongrel server to only listen on a specific ip address.

Or has anyone else run into this and come up with a good solution?

---

<div class="post-metadata">

**Author:** ![jngo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e95f7d/32.png) [@jngo](https://www.ruby-forum.com/u/jngo)\
**Post date:** [March 5, 2009, 8:18pm UTC](https://www.ruby-forum.com/t/can-you-make-mongrel-listen-on-a-specific-ip/162101/2 "2009-03-05T20:18:29Z")

</div>

John Nestoriak wrote:

> way to get the mongrel server to only listen on a specific ip address.
> 
> Or has anyone else run into this and come up with a good solution?

The --address /-a option sounds like what you’re looking for.

mongrel\_rails start --help  
…  
-a, --address ADDR Address to bind to  
…

usage example: mongrel\_rails start --address 127.0.0.1 -p 12001
