sign inHome | Recent Changes | All Pages | HelpSearch:

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:
  1. gem install passenger
  2. apt-get remove nginx
  3. apt-get install apache2 apache2-mpm-prefork apache2-threaded-dev libaprutil1-dev libpcre3-dev libpq-dev
  4. passenger-install-apache2-module
  5. wget http://railsboxcar.com/newboxcar.html -O /var/www/index.html
  6. rm -rf /var/www/apache2-default

Configuration

As root, create the following files:
  1. /etc/apache2/sites-available/rails
    • <VirtualHost *:80>
         ServerName www.yourhost.com
         DocumentRoot /var/www
      </VirtualHost>
  2. /etc/apache2/mods-available/rails.load
    • LoadModule 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

  1. a2dissite default
  2. a2ensite rails
  3. /etc/init.d/apache2 force-reload

Powered by JunebugWiki v0.0.28 Last edited by alexmalinovich on May 22, 2008 05:55 PM (diff)
Version 3 (current) «olderversions