Installing Passenger

While preparing your server for your rails app, you need to install passenger. Passenger is a great software to deploy your ruby on rails apps on Apache or Nginx.

After uploading your rails app files to the server, install passenger gem:

sudo gem install passenger

and then start installation:
sudo passenger-install-apache2-module

After passenger installation is done, you need to add three lines to your apache config.
Something like: LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-3.0.2/ext/apache2/
PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-3.0.2
PassengerRuby /usr/bin/ruby

You can find your apache config folder by typing below:

apachectl -V | grep SERVER_CONFIG_FILE

then edit your apache config file “nano httpd.conf”.
And restart your apache:

apachectl restart

Till here, just regular installation steps, but after these steps you may encounter problems just like me! 🙂

If you get below error after restarting apache,

API module structure ‘passenger_module’ in file /usr/lib/ruby/gems/1.8/gems/passenger-3.0.2/ext/apache2/ is garbled – expected signature 41503232 but saw 41503230 – perhaps this is not an Apache module DSO, or was compiled for a different Apache version?

Then you have a problem with your environment variables. Below is two commands what you have to do to fix this issue:

  1. export APXS2=/usr/local/apache/bin/apxs
  2. passenger-install-apache2-module

After re-installing passenger, restart apache and you should be good to go!

This took me about 1 hour to fix, so I hope this can help someone else.


Tags: , ,


No comments so far.

  • Leave a Reply
    Your gravatar
    Your Name