Passenger for Local Development of Multiple Applications on Ubuntu

Starting with the Railscasts episode on passenger I tried to get passenger working for development, since it removes the burden of always starting an extra console for the server and reveals errors that happen in passenger and not in mongel alone.

Apache should use the same group/user you use, otherwise you may get an 302 not allowed error, this can be changed in /etc/apach2/apache2.conf (User / Group).

httpd.conf

#/ets/apacha2/httpd.conf
# /apps is the folder where your projects lie
# I name them all *.lc so i can easily distinguish them from a live application
# if you use subdomains add the *. before the servername (example 1)
<Directory "/apps">
  Order allow,deny
  Allow from all
</Directory>

<Directory "/apps">
  Options FollowSymLinks
  AllowOverride None
</Directory>

<VirtualHost *:80>
  ServerAlias *.dw.lc
  PassengerPoolIdleTime 1800
  RailsEnv development
  DocumentRoot /apps/someproject/public
</VirtualHost>

<VirtualHost *:80>
  ServerAlias rs.lc
  PassengerPoolIdleTime 1800
  RailsEnv development
  DocumentRoot /apps/anotherproject/public
</VirtualHost>

hosts file

#/ets/hosts
127.0.0.1       de.dw.lc en.dw.lc fr.dw.lc
127.0.0.1       rs.lc
127.0.0.1       localhost
...

restart apache

sudo /etc/init.d/apache2 restart

Hope it works for you 😉

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s