There are some steps to install and configure apache2 & phusion passenger
To install Apache Web Server and documentation & utilities on Linux machine using following commands.
sudo apt-get install apache2
To check installation, Open browser and type localhost or 127.0.0.1
It will show “It Works”
Now If you are using rvm , then go go appropriate ruby version using rvm like rvm use 1.9.2 (I’m having ruby version 1.9.2) and install passenger gem.
gem install passenger
To install apache2 module in passenger
If all dependencies are fulfilled, It will install otherwise It will give a list of commands that you will have to install to run passenger.
sudo apt-get install apache2-prefork-dev
sudo apt-get install libapr1-dev
sudo apt-get install libaprutil1-dev
After Installing dependencies, Run passenger-install-apache2-module again
After that it will compiling their module, When it finishes its compilation, It shows Apache 2 module was successfully installed and halt for press Enter.
Now you can copy the lines which will show in the terminal (passenger & ruby path and its compiled file)
Paste these lines into /etc/apache2/apache2.conf
For Production Mode
Allow from all
For Development Mode
Allow from all
DocumentRoot will look like : – /path to your project directory/public
Now, Run rake assets:precompile in application directory (Needed only in production mode). And restart the apache server by typing
sudo /etc/init.d/apache2 restart
Hoping this will help you.
Enjoy ; – )