Skip to content

My App isn't running?

benschwarz edited this page Sep 13, 2010 · 24 revisions

Sadly, passenger-stack isn’t going to make you a sandwich, no child; Not even if you call it with sudo.

Here are some useful tips to get the ball rolling:

  • Install your app dependencies
  • Create a config.ru file in your app root, you don’t need to do this for rails apps
  • Add a virtual host to apache (example following)

Application dependencies

Both Merb and Rails currently have their own way of managing dependencies.

For merb you can install your gems using `thor merb:gem:install`, I’ve baked this into my capistano deployment scripts.

Rails manages dependencies using `config.gem` in `environment.rb`, they can be installed using `rake gems:install`

Apache virtual host

Create a new file in `/etc/apache2/sites-available/your-app-name` that looks something like this:
<pre> <VirtualHost *:80> ServerName your-domain.com DocumentRoot "/var/www/your-app-name/current/public" RailsEnv production <directory "/var/www/your-app-name/current/public"> Order allow,deny Allow from all

Symlink `sites-available/your-app-name` file to `sites-enabled`

ln -s /etc/apache2/sites-available/your-app-name /etc/apache2/sites-enabled/your-app-name

Restart Apache using `/etc/init.d/apache2 restart`
Now Apache knows that your site should be running, hopefully; it is.

Debugging your passenger setup

As root, run the following command:

tail -f /var/log/apache2/*

Reload your app, this should warn you of any broken paths, missing dependencies and alike.

Clone this wiki locally