# Path to rails app question

**URL:** <https://www.ruby-forum.com/t/path-to-rails-app-question/150702>\
**Category:** Deployment\
**Created:** [October 11, 2008, 7:19pm UTC](https://www.ruby-forum.com/t/path-to-rails-app-question/150702 "2008-10-11T19:19:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jschank](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/96bed5/32.png) [@jschank](https://www.ruby-forum.com/u/jschank)\
**Post date:** [October 11, 2008, 7:19pm UTC](https://www.ruby-forum.com/t/path-to-rails-app-question/150702/1 "2008-10-11T19:19:16Z")

</div>

[Post copied from other groups (Capistrano, and Rails Talk) Trying to  
find the right venue for this question, I apologize to anyone who’s  
seen this before]

Hello,

I’m finally ready to deploy my first rails app. I’m deploying to my  
own server (so I have root access) which is a mac mini running  
apache2, MySQL, etc. This server sits at the end of a static IP  
address.

At the moment I have static content served from apache. For example:  
[http://www.myserver.com/](http://www.myserver.com/) gets my home website.  
[http://www.myserver.com/ical](http://www.myserver.com/ical)  
is where I stuff such things as shared ical calendars. I have some  
php  
apps deployed also, at addresses like  
[http://www.myserver.com/bugtracker/index.php](http://www.myserver.com/bugtracker/index.php)

I’m deploying using capistrano, (using git, and mongrel), to a  
directory that is completely separate from the normal web docs folder.  
(for example: /Volumes/SomeDrive/MyRailsApp. Here is what has me  
confused…

When I deploy, using cap deploy. I end up with:  
My normal static content shows up if I hit [http://www.myserver.com](http://www.myserver.com)  
If I use [http://www.myserver.com:3000](http://www.myserver.com:3000), then my rails app is served  
up.

This is probably completely normal…

What I want is have my rails app served when the url is something  
else, like [http://www.myserver.com/myrailsappname](http://www.myserver.com/myrailsappname) And I’d like to not  
have to specify the port in the address. Finally, I would like my  
normal static content to be served when the url is  
[http://www/myserver.com](http://www/myserver.com),  
and I’d like the things deployed to be unaffected (the bug tracker,  
and ical stuff mentioned above)

Can someone point me in the right direction for solving these  
mysteries?

Do I need to adjust my routes for my rails app, so that is has the  
extra bits at the front ? such as map.root “/myrailsappname” or  
something?

Should I be using VirtualServer in my apache config ?, if so, should I  
use port 3000 instead of 80 ?

Mostly I’m looking for the right topics and keywords to research to  
solve this.

Thanks,  
John Schank

---

<div class="post-metadata">

**Author:** ![jschank](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/96bed5/32.png) [@jschank](https://www.ruby-forum.com/u/jschank)\
**Post date:** [October 11, 2008, 7:24pm UTC](https://www.ruby-forum.com/t/path-to-rails-app-question/150702/2 "2008-10-11T19:24:32Z")

</div>

John,

You would need to use a virtual host entry in Apache with the  
appropriate name for it to respond to, and have then entry pass the  
connection on using ProxyPass. (You’ll actually want ProxyPass,  
ProxyPassReverse, and ProxyPreserveHost.)

However, this is a very inefficient way of doing things. If you’re  
going to be using Apache for the foreseeable future, you should just  
get Phusion Passenger and have it handle your Rails apps. (I’d suggest  
pulling down Enterprise Ruby along with it as well.)

If you’re just using this as a learning experience, at this point  
learning to proxy mongrel to Apache is largely useless these days. The  
two primary deployment methods still in use are going to be nginx  
+mongrel or Apache+Passenger.

Hope that helps.

–  
Alex Malinovich  
Director of Deployment Services

PLANET ARGON, LLC  
design // development // hosting

> **[Planet Argon](https://www.planetargon.com)**
>
> Planet Argon is a Ruby on Rails development agency specializing in maintenance and support for existing Rails apps. Based in Portland, OR, Planet Argon has been a member of the Rails community since 2004.

[http://www.the-love-shack.net](http://www.the-love-shack.net) [blog]

+1 503 445 2457  
+1 877 55 ARGON [toll free]  
+1 815 642 4068 [fax]
