I just Installed apache and passenger on Ubuntu 11.04 to run and deploy my ruby on rails applications Passenger is a gem and can work with apache as well as nginx…
The reason for choosing apache is that its an industry standard.
Also one thing I did with apache was created virtual hosts and ran my apps on local machine with domains like http://www.application1.com
In this post I will list the steps I followed in order to setup apache web server and passenger.
Here is my stack:
- Ubuntu 11.04
- ruby 1.9.2 via rvm
- rubygems 1.8.10
I will be using rails 3.1.10(lastest this morning).!!
So lets start !!
- Install rvm
To install rvm just type the following in the terminal(ctrl+alt+t)
user$ bash < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer )
You can find more information about rvm on Here
- Install ruby via rvm
Once rvm is installed you can install the latest or desired version of ruby by typing the following in terminal
rvm install 1.9.2
This will install ruby 1.9.2 on your system.
More information on how to make it your default ruby is available on here
- Install rails.
just need to do
gem install rails
- Install passenger
gem install passenger
- Install apache web server.
To install apache web server type:
sudo apt-get install apache2 apache2-mpm-prefork apache2-prefork-dev
- Install passenger apache module.
Once this is done, we must install passenger , an apache module thats hepls us to rub rails apps on apache.
Finally everything is done.
When you run the passenger apache module, there would be some instructions that installer will give you.
The last thing it will tell is to paste some text in apache configuration file
The configuration file is located at /etc/apache2/apache2.conf
Now once this is done, we are ready to deploy.
This has a lot of information about deploying.
In my next post, I will show how to start rails apps on local machine with apache.
Hope it helps.!