This guide currently uses Ruby 1.9.3, Rails 3.2 and Ubuntu 13.04 (Raring Ringtail). I started off with a fresh install of Ubuntu on a virtual machine.
-
Install RVM. See http://rvm.io/rvm/install for all the details.
$ sudo apt-get install curl $ \curl -L https://get.rvm.io | bash -s stable
IMPORTANT: Add the following to
~/.bashrc
.# Load RVM into a shell session *as a function* [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
Open a new terminal and verify that
type rvm | head -n 1
returnsrvm is a function
. -
Install Ruby 1.9.3.
$ rvm install 1.9.3
$ sudo apt-get install mysql-server libmysqlclient-dev
NOTE: The libmysqlclient-dev
library is needed when it's time to run gem install mysql2
.
References:
$ sudo apt-get install apache2
References:
$ gem install passenger
Loosen your permissions
$ passenger-config --root
Suppose that the above command outputs /home/username/.rvm/gems/ruby-1.9.3-p448/gems/passenger-4.0.19
. Then you chmod o+x
the directory itself and all parent directories up until /home/username
.
$ chmod o+x /home/username/.rvm/gems/ruby-1.9.3-p448/gems/passenger-4.0.19
$ chmod o+x /home/username/.rvm/gems/ruby-1.9.3-p448/gems
$ chmod o+x /home/username/.rvm/gems/ruby-1.9.3-p448
$ chmod o+x /home/username/.rvm/gems
$ chmod o+x /home/username/.rvm
$ chmod o+x /home/username
Run the Phusion Passenger installer and follow the on-screen instructions.
$ passenger-install-apache2-module
At the end of the installation process, you will be asked to copy and paste a configuration snippet (containing LoadModule, PassengerRoot, etc.) into your Apache configuration file.
Restart your web server and run passenger-memory-stats
.
$ sudo service apache2 restart
$ passenger-memory-stats
You should see the web server processes as well as a number of Phusion Passenger processes (e.g. PassengerWatchdog, PassengerHelperAgent). Congratulations, Phusion Passenger is now installed and running!
References: