# Help with sub-domain deployment?

**URL:** <https://www.ruby-forum.com/t/help-with-sub-domain-deployment/86924>\
**Category:** Deployment\
**Created:** [February 26, 2007, 10:35pm UTC](https://www.ruby-forum.com/t/help-with-sub-domain-deployment/86924 "2007-02-26T22:35:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![goodieboy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/ecc23a/32.png) [@goodieboy](https://www.ruby-forum.com/u/goodieboy)\
**Post date:** [February 26, 2007, 10:35pm UTC](https://www.ruby-forum.com/t/help-with-sub-domain-deployment/86924/1 "2007-02-26T22:35:49Z")

</div>

K,

I have a host (A2 Hosting) that allows me to point different domains  
at sub-folders for add-on domain hosting. I’d like to be able to run  
diferent rails apps in each of those folders and one in the root also.  
I figure I just need to make sure that the first url fragment never  
has the name of a sub-folder/site set as a route name?

I’m a little confused on deployment. A2 Hosting says to do a “ln -s  
rails\_app/public public\_html”, but that seems too easy. Not sure what’s  
happening there…

They also have Mongrel, which I’m assuming is a server for rails apps?  
Is this correct? If so, would it be better to use mongrel? Can mongrel  
be setup so a subfolder of the web servers www directory can have  
another separate rails app? Like this:

[mainsite.com](http://mainsite.com) - /public\_html  
[addonsite.com](http://addonsite.com) - /public\_html/addonsite

Also, do I need Capistrano? Is that just a deployment helper? Not a  
server is it? Ugh, this is all so confusing. And I thought it was soooo  
easy to build my first rails app! 🙂

- matt

---

<div class="post-metadata">

**Author:** ![goodieboy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/ecc23a/32.png) [@goodieboy](https://www.ruby-forum.com/u/goodieboy)\
**Post date:** [March 1, 2007, 12:33pm UTC](https://www.ruby-forum.com/t/help-with-sub-domain-deployment/86924/2 "2007-03-01T12:33:07Z")

</div>

Matt,

```
 Building the first Rails app is usually easy, deploying it

```

not 🙂

```
 I am not sure about A2 setup, most of the shared hosting services

```

offering cheap accounts with support for Rails use Apache + FastCGI.  
This means that Apache administers your Rails app starting it when a  
request is received, letting it live for a while and then sutting it  
down if no more requests reach Apache for a while (persistent process  
are expensive)

```
 What does Apache + FastCGI expect from your app? A public

```

directory, including a .htaccess that routes the “dinamic” part of the  
app (not the JS and imgaes usually) to dispatach.fcgi. This scripts is  
responsible of handling the dinamic stuff in your app, initializing  
Rails and feeding it with the request info, waiting for a response and  
passing it back to Apache.

```
If you have a app at your top domain just replace the public_html

```

(as it is usually named) with a symbolic link to your app public  
folder. Be sure to check:

```
- The path to Ruby interpreter at the top of the script to match

```

the actual path of the server  
- That .htaccess is setup to use the fcgi handler and not the cgi  
handler (too slow)  
- That you force the production mode in the Rails configuration

```
About the other apps living in subdomains, I am not sure if they

```

will be resolved if you create symbolics links in the app/public  
folder to their public folder… Give it a try.

```
I would recommend not to use Capistrano for the first time, until

```

you finally defined the layout of your setup. Then start working with  
Capistrano to automate the deployment process. Capistranos has to be  
added to your app, and configured. It relies eavily in SSH and SVN and  
in shared hostings it could be a little more difficult to setup.

```
Good luck.

```

–  
Aníbal Rojas

> **[RUBYCORNER.COM](https://www.rubycorner.com/)**
>
> RUBYCORNER.COM - Contact us for any business inquiries

> **[Home - Has Many Developers](https://hasmanydevelopers.com/)**
>
> We are the best choice for your building design and development

On Feb 26, 5:35 pm, Matt M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
