Quantcast
Channel: bitPrison.net - Web development
Viewing all articles
Browse latest Browse all 23

How to install Phusion Passenger for ruby 1.9.2

$
0
0

There are some easy steps to install Phusion Passenger for ruby 1.9.2 and apache2 on Ubuntu Linux.

1. Install rvm system wide

sudo bash < <( curl -L http://bit.ly/rvm-install-system-wide )

2. Install ruby 1.9.2

rvm install 1.9.2

3. add new line in /etc/bash.bashrc

[[ -s /usr/local/lib/rvm ]] && . /usr/local/lib/rvm

4. install passenger

sudo -i # you need root shell
rvm use 1.9.2-p0@global # or your version, use: rvm list
gem install passenger --pre # only passenger 3 works with 1.9.2 that is in beta state

5. install apache module

passenger-install-apache2-module

6. create /etc/apache2/mods-available/passenger.load file for loading
/usr/local/rvm/gems/ruby-1.9.2-p0@global/gems/passenger-3.0.0.pre4/ext/apache2/mod_passenger.so file:

LoadModule passenger_module /usr/local/rvm/gems/ruby-1.9.2-p0@global/gems/passenger-3.0.0.pre4/ext/apache2/mod_passenger.so

7. create /etc/apache2/mods-available/passenger.conf file:

PassengerRoot /usr/local/rvm/gems/ruby-1.9.2-p0@global/gems/passenger-3.0.0.pre4
PassengerRuby /usr/local/rvm/wrappers/ruby-1.9.2-p0@global/ruby

8. Optional virtual host in the common way
Suppose you have a Rails application in /somewhere. Add a virtual host to your
Apache configuration file and set its DocumentRoot to /somewhere/public:

ServerName www.yourhost.com
DocumentRoot /somewhere/public # <-- be sure to point to 'public'!

AllowOverride all # <-- relax Apache security settings
Options -MultiViews # <-- MultiViews must be turned off

9. Enable passenger module and config

a2enmod passenger

10. restart apache

/etc/init.d/apache2 restart

11. Deploy your ruby on rails or rack based application.

Sources:
http://rvm.beginrescueend.com/deployment/system-wide/
http://www.modrails.com/documentation/Users%20guide%20Apache%203.0.html


Viewing all articles
Browse latest Browse all 23

Trending Articles