# How can I run url without using port?

**URL:** <https://www.ruby-forum.com/t/how-can-i-run-url-without-using-port/141772>\
**Category:** Ruby\
**Created:** [June 30, 2008, 3:07pm UTC](https://www.ruby-forum.com/t/how-can-i-run-url-without-using-port/141772 "2008-06-30T15:07:05Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![zangsdev](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/a5b964/32.png) [@zangsdev](https://www.ruby-forum.com/u/zangsdev)\
**Post date:** [June 30, 2008, 3:07pm UTC](https://www.ruby-forum.com/t/how-can-i-run-url-without-using-port/141772/1 "2008-06-30T15:07:05Z")

</div>

Hello,

I have developed 2-3 sample ruby application…

and my server name is like [http://www.mydomain.com](http://www.mydomain.com)

Now when I run one of my the ruby application say “first\_app”,  
then I have to use [http://www.mydomain.com:3000/](http://www.mydomain.com:3000/)

And for the 2nd application I have shutdown the service for first one  
and then have to start service for 2nd app.  
And have to use same url [http://www.mydomain.com:3000/](http://www.mydomain.com:3000/)

Any one can help me what should I do if I want to run the url like  
[http://www.mydomain.com/first\_app](http://www.mydomain.com/first_app)

[http://www.mydomain.com/second\_app](http://www.mydomain.com/second_app)

Please help me… I really need this asap…

Thanks in Advance

Regards  
Zangs D.

---

<div class="post-metadata">

**Author:** ![zangsdev](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/a5b964/32.png) [@zangsdev](https://www.ruby-forum.com/u/zangsdev)\
**Post date:** [July 1, 2008, 12:07pm UTC](https://www.ruby-forum.com/t/how-can-i-run-url-without-using-port/141772/2 "2008-07-01T12:07:24Z")

</div>

Hello all

no one here have the ability to help me ?

Zangs D. wrote:

> Hello,
> 
> I have developed 2-3 sample ruby application…
> 
> and my server name is like [http://www.mydomain.com](http://www.mydomain.com)
> 
> Now when I run one of my the ruby application say “first\_app”,  
> then I have to use [http://www.mydomain.com:3000/](http://www.mydomain.com:3000/)
> 
> And for the 2nd application I have shutdown the service for first one  
> and then have to start service for 2nd app.  
> And have to use same url [http://www.mydomain.com:3000/](http://www.mydomain.com:3000/)
> 
> Any one can help me what should I do if I want to run the url like  
> [http://www.mydomain.com/first\_app](http://www.mydomain.com/first_app)
> 
> [http://www.mydomain.com/second\_app](http://www.mydomain.com/second_app)
> 
> Please help me… I really need this asap…
> 
> Thanks in Advance
> 
> Regards  
> Zangs D.

---

<div class="post-metadata">

**Author:** ![zangsdev](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/a5b964/32.png) [@zangsdev](https://www.ruby-forum.com/u/zangsdev)\
**Post date:** [July 1, 2008, 12:40pm UTC](https://www.ruby-forum.com/t/how-can-i-run-url-without-using-port/141772/3 "2008-07-01T12:40:02Z")

</div>

On Tue, Jul 1, 2008 at 12:04, Zangs D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > And for the 2nd application I have shutdown the service for first one  
> > and then have to start service for 2nd app.  
> > And have to use same url [http://www.mydomain.com:3000/](http://www.mydomain.com:3000/)
> > 
> > Any one can help me what should I do if I want to run the url like  
> > [http://www.mydomain.com/first\_app](http://www.mydomain.com/first_app)
> > 
> > [http://www.mydomain.com/second\_app](http://www.mydomain.com/second_app)

Hi,

1. is your application written in Ruby ON RAILS? This question is  
important because  
there are many frameworks for this and the solution to your problem  
depends on the framwork used.

2. If it is rails indeed, you might want to check Rails-specific forum  
(google for rails-talk)  
There are people with specific knowledge that can help you better.

3. If it is rails: for start, edit your environment.rb so that you use  
different ports for your apps. 3000 for the first,  
3001 for the second, etc. To use /first\_app, etc. you need to have  
another server proxying the requests to your apps.  
There are a lot of tutorials out there. GIYF, keywords: rails multiple  
apps, more keywords: mongrel, reverse proxy, load balancer, ngnix,  
lighttpd

J.

---

<div class="post-metadata">

**Author:** ![zangsdev](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/a5b964/32.png) [@zangsdev](https://www.ruby-forum.com/u/zangsdev)\
**Post date:** [July 1, 2008, 1:05pm UTC](https://www.ruby-forum.com/t/how-can-i-run-url-without-using-port/141772/4 "2008-07-01T13:05:15Z")

</div>

On Tue, Jul 1, 2008 at 12:46, Zangs D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Thanks Jano for the reply and help…
> 
> My application is written in Ruby ON RAILS…
> 
> My problem is… I don’t want to use port anymore in my url…
> 
> for ex. I want to run my sites like \>\>  
> [http://www.mydomain.com/first\_app](http://www.mydomain.com/first_app)  
> OR  
> [http://www.mydomain.com/](http://www.mydomain.com/)

> > To use /first\_app, etc. you need to have  
> > another server proxying the requests to your apps.  
> > There are a lot of tutorials out there. GIYF[1], keywords: rails multiple  
> > apps, more keywords: mongrel, reverse proxy, load balancer, ngnix,  
> > lighttpd

[1] [google.com](http://google.com)  
[Peak Obsession](http://wiki.rubyonrails.com/rails/pages/Howtos#deployment)  
[Peak Obsession](http://wiki.rubyonrails.com/rails/pages/HowToInstallApplicationsInSubdirectories)

The thing is not easy to do, and depends on lots of other things -  
your webserver, how do you run your rails apps,  
etc. so the best way is to go through the docs on rails site, and  
google some tutorials (there are plenty of them),  
and if that doesn’t help, try asking on the rails forum. As I said,  
there are more knowledgable people.  
I don’t do much with rails, so I can only show you where to look. They  
will know first-hand (just don’t forget to do  
your homework before you ask!)

Good luck!

---

<div class="post-metadata">

**Author:** ![zangsdev](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/a5b964/32.png) [@zangsdev](https://www.ruby-forum.com/u/zangsdev)\
**Post date:** [July 1, 2008, 12:48pm UTC](https://www.ruby-forum.com/t/how-can-i-run-url-without-using-port/141772/5 "2008-07-01T12:48:16Z")

</div>

Thanks Jano for the reply and help…

My application is written in Ruby ON RAILS…

My problem is… I don’t want to use port anymore in my url…

for ex. I want to run my sites like \>\>  
[http://www.mydomain.com/first\_app](http://www.mydomain.com/first_app)  
OR

> **[Web Hosting, Domain Name Registration - MyDomain.com](https://www.mydomain.com/)**
>
> Small business web hosting offering additional business services such as: domain name registrations, email accounts, web services, and various small business solutions.

Without using port… So please help me…

Thanks again…

Jano S. wrote:

> On Tue, Jul 1, 2008 at 12:04, Zangs D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > > And for the 2nd application I have shutdown the service for first one  
> > > and then have to start service for 2nd app.  
> > > And have to use same url [http://www.mydomain.com:3000/](http://www.mydomain.com:3000/)
> > > 
> > > Any one can help me what should I do if I want to run the url like  
> > > [http://www.mydomain.com/first\_app](http://www.mydomain.com/first_app)
> > > 
> > > [http://www.mydomain.com/second\_app](http://www.mydomain.com/second_app)
> 
> Hi,
> 
> 1. is your application written in Ruby ON RAILS? This question is  
> important because  
> there are many frameworks for this and the solution to your problem  
> depends on the framwork used.
> 
> 2. If it is rails indeed, you might want to check Rails-specific forum  
> (google for rails-talk)  
> There are people with specific knowledge that can help you better.
> 
> 3. If it is rails: for start, edit your environment.rb so that you use  
> different ports for your apps. 3000 for the first,  
> 3001 for the second, etc. To use /first\_app, etc. you need to have  
> another server proxying the requests to your apps.  
> There are a lot of tutorials out there. GIYF, keywords: rails multiple  
> apps, more keywords: mongrel, reverse proxy, load balancer, ngnix,  
> lighttpd
> 
> J.

---

<div class="post-metadata">

**Author:** ![zangsdev](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/a5b964/32.png) [@zangsdev](https://www.ruby-forum.com/u/zangsdev)\
**Post date:** [July 1, 2008, 1:11pm UTC](https://www.ruby-forum.com/t/how-can-i-run-url-without-using-port/141772/6 "2008-07-01T13:11:15Z")

</div>

Thanks so much again…

Now I will try in google and rails forum…

> [1] [google.com](http://google.com)  
> [Peak Obsession](http://wiki.rubyonrails.com/rails/pages/Howtos#deployment)  
> [Peak Obsession](http://wiki.rubyonrails.com/rails/pages/HowToInstallApplicationsInSubdirectories)
> 
> The thing is not easy to do, and depends on lots of other things -  
> your webserver, how do you run your rails apps,  
> etc. so the best way is to go through the docs on rails site, and  
> google some tutorials (there are plenty of them),  
> and if that doesn’t help, try asking on the rails forum. As I said,  
> there are more knowledgable people.  
> I don’t do much with rails, so I can only show you where to look. They  
> will know first-hand (just don’t forget to do  
> your homework before you ask!)
> 
> Good luck!

---

<div class="post-metadata">

**Author:** ![zangsdev](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/a5b964/32.png) [@zangsdev](https://www.ruby-forum.com/u/zangsdev)\
**Post date:** [July 1, 2008, 2:01pm UTC](https://www.ruby-forum.com/t/how-can-i-run-url-without-using-port/141772/7 "2008-07-01T14:01:02Z")

</div>

On Jul 1, 4:35 pm, Ron F. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > > I don’t do much with rails, so I can only show you where to look. They
> 
> - Show quoted text -

Thanks Ron for your help.

But what I want is different…

suppose you are running your ruby applicaiton in your local by this  
url \>\>  
[http://localhost:3000/](http://localhost:3000/) right ?

I want to run this url like [http://localhost/testproject](http://localhost/testproject)

Without using Port. Is that any solution I can use my own url  
without port to run the project ?

Thanks  
Zangs D.

---

<div class="post-metadata">

**Author:** ![zangsdev](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/a5b964/32.png) [@zangsdev](https://www.ruby-forum.com/u/zangsdev)\
**Post date:** [July 2, 2008, 1:41pm UTC](https://www.ruby-forum.com/t/how-can-i-run-url-without-using-port/141772/8 "2008-07-02T13:41:02Z")

</div>

All browsers I’m aware of will treat  
[http://somehost/page](http://somehost/page)

as [http://somehost:80/page](http://somehost:80/page)

and  
[https://somehost/page](https://somehost/page)

as  
[https://somehost:443/page](https://somehost:443/page)

It’s the nature of URLs, and the nature of browsers.

That’s one of many reasons why in rails deployment, one often  
uses a proxy web server that forwards URL’s on 80/443 to the  
actual rails web servers.

e.g. in my applications I’ve set up  
Apache with proxy-balancer. Apache takes the request, load balances  
it out to one of my rails servers which are running on a range of  
ports on a set of server systems.

This provides scalability and also the URL re-writing you’re after,it  
can be tricky to set up but a bit of googling should point you at some  
recipes for doing it.

RF

---

<div class="post-metadata">

**Author:** ![zangsdev](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/a5b964/32.png) [@zangsdev](https://www.ruby-forum.com/u/zangsdev)\
**Post date:** [July 1, 2008, 1:41pm UTC](https://www.ruby-forum.com/t/how-can-i-run-url-without-using-port/141772/9 "2008-07-01T13:41:05Z")

</div>

Use port 80 if you just want to test with URL’s that don’t have ports.
