Ruby on Rails Application Deployment with Passenger on Fedora


  • Install apache development libraries
    • yum -y install httpd-devel
  • Install Passenger (Ruby on Rails Server used for Deployment)
    • gem install passenger
  • Install passenger-apache module (Passenger binding with Apache)

Configure virtual host for your RoR apps on apache server

  • cd /var/www/html
  • ln -s ~/myapp/public myapp
  • edit /etc/httpd/conf/httpd.conf
    • LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-3.0.6/ext/apache2/
    • PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-3.0.6
    • PassengerRuby /usr/bin/ruby
    • <VirtualHost *:80>
    •       RailsBaseURI /myapp
    •       <Directory /var/www/html/myapp>
    •            Options -MultiViews
    •            Options FollowSymLinks
    •       </Directory>
    • </VirtualHost>

Modify apache configuration on the proxy server

  • edit /etc/httpd/conf/httpd.conf
  • add following lines
    • <VirtualHost *:80>
    •       ProxyPass /myapp http://myhost/myapp
    •       ProxyPassReverse /myapp http://myhost/myapp
    • </VirtualHost>

Some quick tips

  • Use rails helper tags instead of direct html tags (e.g. ‘image_tag’ in place of ‘img src’, ‘link_to’ or ‘url_for’ in place of ‘a href’, etc)
  • Use javascript_include_tag and javascript_include_tag when stylesheet, images, javascripts are not loading.
  • Make sure public directory of ‘myapp’ has necessary permissions for apache user
  • If you are dealing with SELinux enabled server, you might want to take care of SELinux permissions for passenger as well (though SELinux enabled, permissive mode runs without any error! Hint!!!)
  • sub-URI has to be same for the host machine as well as proxy, when you are doning proxypass and reverse.
  • when you get “NameError: uninitialized constant ActiveSupport::Dependencies::Mutex ” error for Rails 2.3.x versions add line: require ‘thread’ to script/sever file
  • Helpful documentation: guide Apache.html

Feedback, expert comments welcome!

Thank You!


  1. Sandeep says:

    why passenger instead of WEBrick ?

  2. Ankit Patel says:

    because webrick is not suitable because of it’s stability for production purpose.

  3. Vinod Kumar says:


    I am using fedora 20.

    Writing below code in /etc/httpd/conf/httpd.conf is not starting the application.

    LoadModule passenger_module /usr/local/share/gems/gems/passenger-4.0.41/buildout/apache2/
    PassengerRoot /usr/local/share/gems/gems/passenger-4.0.41
    PassengerDefaultRuby /usr/bin/ruby

    RailsBaseURI /sampletestapp
    ProxyPass /sampletestapp
    ProxyPassReverse /sampletestapp

    Options -MultiViews
    Options FollowSymLinks

    In the browser If I give the url as “” its showing error as “Firefox can’t find the server at“.

    Please give your valuable suggessions.

Leave a Reply

Your email address will not be published. Required fields are marked *



question razz sad evil exclaim smile redface biggrin surprised eek confused cool lol mad twisted rolleyes wink idea arrow neutral cry mrgreen

%d bloggers like this: