These notes describe how to run a Rails application on a dedicated port.
Your environment will be different, so some of the following steps will be unnecessary for you and other steps may be missing.
Since we are going to build native extensions, we need to get this module:
sudo apt-get install build-essential
First, we need to install Passenger as a Apache module.
sudo apt-get install libopenssl-ruby sudo gem install passenger sudo apt-get install apache2-dev libapr1-dev libaprutil1-dev apache2-prefork-dev sudo passenger-install-apache2-module
Now edit apache2.conf adding the following:
LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-2.2.5/ext/apache2/mod_passenger.so PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-2.2.5 PassengerRuby /usr/bin/ruby1.8
If you want to run your Rails application on a different port, add the following to ports.conf:
NameVirtualHost *:3000 Listen 3000
You need to let Apache know where the Rails application is in /etc/apache2/sites-available/default:
<VirtualHost *:3000> ServerName myapp.mycompany.com DocumentRoot /apps/myapp/public </VirtualHost>
The last step is to restart Apache:
sudo /etc/init.d/apache2 restart