Apache Configuration
Using Apache with Phusion Passenger is not officially supported by Planet Argon, but you can still set it up on your own. This is particularly useful if you’re going to be running legacy PHP code in tandem with your new Rails code, or if you need to do something specifically using Apache that Nginx can’t do for you.
Installation
As root, you will want to perform the following steps:gem install passengerapt-get remove nginxapt-get install apache2 apache2-mpm-prefork apache2-threaded-dev libaprutil1-dev libpcre3-dev libpq-devpassenger-install-apache2-modulewget http://railsboxcar.com/newboxcar.html -O /var/www/index.htmlrm -rf /var/www/apache2-default
Configuration
As root, create the following files:/etc/apache2/sites-available/rails<VirtualHost *:80> ServerName www.yourhost.com DocumentRoot /var/www </VirtualHost>
/etc/apache2/mods-available/rails.loadLoadModule passenger_module /usr/local/lib/ruby/gems/1.8/gems/passenger-1.0.5/ext/apache2/mod_passenger.so RailsSpawnServer /usr/local/lib/ruby/gems/1.8/gems/passenger-1.0.5/bin/passenger-spawn-server RailsRuby /usr/local/bin/ruby
- Note that the above is for passenger v. 1.0.5. If you are using a newer version of passenger you’ll want to copy and paste the output of the passenger-install-apache2-module command above.
Configure apache2 and restart
a2dissite defaulta2ensite rails/etc/init.d/apache2 force-reload