Some notes on deploying my rails application in to a subdirectory. I’m using rvm to manage Rails versions and this was all on Debian Lenny.
1. Install Rails (see here for some pointers).
2. Install Passenger
gem install passenger apt-get install apache2-prefork-dev apt-get install libapr1-dev apt-get install libaprutil1-dev passenger-install-apache2-module
Follow the instructions passenger gives you.
3. Edit your apache config
3.1 Create a symlink to your app’s public directory inside your current website root:
(in this example my app is call nihongo)
ln -s /PATH/TO/WEBAPP/nihongo/public /PATH/TO/YOUR/DOCROOT/nihongo
3.1 Edit your apache config for this root to contain a pointer to this app:
RackBaseURI /nihongo <Directory /PATH/TO/YOUR/DOCROOT/nihongo> Options -MultiViews </Directory>
4. Checkout your app…
Possibly use rake db:setup to setup the database. Use “bundle install” to install required bundle files.
to “compile” assets, or you may get an error such as:
I don’t quite understand how Rails detects the app is running in production yet. But it does so automatically somehow…