# Deploying for dummies

**URL:** <https://www.ruby-forum.com/t/deploying-for-dummies/128800>\
**Category:** Rails\
**Created:** [February 11, 2008, 5:46pm UTC](https://www.ruby-forum.com/t/deploying-for-dummies/128800 "2008-02-11T17:46:48Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![reacher](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/0ea827/32.png) [@reacher](https://www.ruby-forum.com/u/reacher)\
**Post date:** [February 11, 2008, 5:46pm UTC](https://www.ruby-forum.com/t/deploying-for-dummies/128800/1 "2008-02-11T17:46:48Z")

</div>

I’m kinda newb when it comes to apache. I’ve been tasked with  
creating a website to manage some local web applications. This site  
will be running just on our local LAN (it will _never_ be accessed  
from outside this LAN). We have Kubuntu 7.10 running on this machine  
and need a setup that enables us to do the following:

1. Root website - [http://ip.address.of.machine](http://ip.address.of.machine)  
A basic web page that will have links to different web applications  
that we will create
2. Rails app 1 - [http://ip.address.of.machine/railsapp1](http://ip.address.of.machine/railsapp1)  
A Rails app
3. Rails app 2 - [http://ip.address.of.machine/railsapp2](http://ip.address.of.machine/railsapp2)  
Another Rails app
4. Django app 1 - [http://ip.address.of.machine/djangoapp1](http://ip.address.of.machine/djangoapp1)  
A Django app  
…

The URLs I have denoted are what I envision, although in reality I  
guess they could (should?) be different ([http://railsapp1](http://railsapp1),  
[http://djangoapp1](http://djangoapp1),  
etc.) Initially, I don’t think I’ll need a mongrel\_cluster or  
anything of the like, chances are at most 10 people could be accessing  
these apps at once, and in reality probably no more than 2-4 at any  
given time.

Again, I’m a complete newb when it comes to apache config files  
( and the like). I can find gobs of howto’s on deploying  
1 app or the other, but not for the custom setup I have described  
above. If I need to break down and buy an Apache book and spend a  
month or two learning, I guess I can.

---

<div class="post-metadata">

**Author:** ![reacher](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/0ea827/32.png) [@reacher](https://www.ruby-forum.com/u/reacher)\
**Post date:** [February 11, 2008, 6:05pm UTC](https://www.ruby-forum.com/t/deploying-for-dummies/128800/2 "2008-02-11T18:05:44Z")

</div>

On Feb 11, 2008 8:46 AM, Reacher [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> The URLs I have denoted are what I envision, although in reality I  
> guess they could (should?) be different ([http://railsapp1](http://railsapp1), [http://djangoapp1](http://djangoapp1),

should. For both your users’ sake, and in case you want/need to  
move an app to another machine.

> Again, I’m a complete newb when it comes to apache config files  
> ( and the like). I can find gobs of howto’s on deploying  
> 1 app

OK, deploy one. Test. Deploy second app. Test. Deploy… 🙂

Seriously, there’s not that much to configuring a mod\_proxy setup,  
and multiple proxies, even within one virtual host, are just a couple  
more lines. Try it, come back if you have specific questions.

–  
Hassan S. ------------------------ removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![reacher](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/0ea827/32.png) [@reacher](https://www.ruby-forum.com/u/reacher)\
**Post date:** [February 11, 2008, 9:03pm UTC](https://www.ruby-forum.com/t/deploying-for-dummies/128800/3 "2008-02-11T21:03:31Z")

</div>

I’m using [Hostingrails.com](http://Hostingrails.com) and had to create a symbolic link that  
redirects to the app from the console. Read this tutorial to see how -

> 

Make your app’s public folder the public\_html  
[http://www.hostingrails.com/forums/wiki\_thread/1#symlink](http://www.hostingrails.com/forums/wiki_thread/1#symlink)

---

<div class="post-metadata">

**Author:** ![reacher](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/0ea827/32.png) [@reacher](https://www.ruby-forum.com/u/reacher)\
**Post date:** [February 12, 2008, 3:14am UTC](https://www.ruby-forum.com/t/deploying-for-dummies/128800/4 "2008-02-12T03:14:54Z")

</div>

Thanks everyone for the tips. I did get a single rails app deployed  
on our Linux system using Apache2 and FastCGI. I’m not at work now,  
but tomorrow I will post what I did to get it to work.

---

<div class="post-metadata">

**Author:** ![reacher](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/0ea827/32.png) [@reacher](https://www.ruby-forum.com/u/reacher)\
**Post date:** [February 11, 2008, 10:38pm UTC](https://www.ruby-forum.com/t/deploying-for-dummies/128800/5 "2008-02-11T22:38:58Z")

</div>

VirtualHost is your friend…

Apache config(there is more to this but this should get you  
started… ):

PS You should have a include directive in the main conf/httpd.conf and  
add conf files for each of the apps in conf/extra/httpd-app1.conf.  
This way you can move/add or disable single apps to apache.

\<Proxy balancer://app1\_cluster\>  
BalancerMember [http://127.0.0.1:8100](http://127.0.0.1:8100)

\<Proxy balancer://app2\_cluster\>  
BalancerMember [http://127.0.0.1:8200](http://127.0.0.1:8200)

NameVirtualHost \*:80

\<VirtualHost \*:80\>  
ServerName app1

```
<Directory "/opt/rails_apps/app1/public">
  Options FollowSymLinks
  AllowOverride None
  Order allow,deny
  Allow from all
</Directory>

RewriteEngine on
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
RewriteRule ^/app1(.*)$ balancer://app1_cluster%{REQUEST_URI}

```

[P,QSA,L]

 ServerName app2

```
<Directory "/opt/rails_apps/app2/public">
  Options FollowSymLinks
  AllowOverride None
  Order allow,deny
  Allow from all
</Directory>

RewriteEngine on
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
RewriteRule ^/app2(.*)$ balancer://app2_cluster%{REQUEST_URI}

```

[P,QSA,L]

Start Mongrels as needed like this(Read about Monit to manage this  
better):

/usr/local/bin/ruby /usr/local/bin/mongrel\_rails start -d -e  
production --user daemon --group daemon -p 8100 -a 127.0.0.1 -P /opt/  
rails\_app/app1/shared/pids/mongrel.8100.pid -c /opt/rails\_app/app1/  
current -l log/mongrel.8100.log --prefix /app1
