08.21.2019
Install Phusion Passenger on Centos 7
Phusion Passenger (commonly shortened to Passenger or referred to as mod_passenger) is an application server and it is often used to power Ruby sites. Its code is distributed in form of a Ruby gem, which is then compiled on the target machine and installed into Apache as a module.
To install Phusion Passenger you need to make sure that Ruby gem was installed. If Ruby game was not installed you can see How to install Ruby 2.2 and Rails 4 on Centos 7 via RPM here.Now we start to install Phusion Passenger on Centos 7 by follow below step:
First, the gem needs to be installed on the system:
gem install passenger
Before the Apache module is compiled, two dependency packages need to be installed as well:
yum install curl-devel httpd-devel
The environment is now ready for the compilation. The process takes a few minutes and it’s started by the following command:
passenger-install-apache2-module
Note: Your server need at least 1GB swap to finish this step If
you have not please find out how to add
swap on your serverNote that this script will not install the module really. It will compile module’s binary and place it under gem’s path. The path will be printed on screen and it needs to be copy-pasted into Apache’s config file (/etc/httpd/conf/httpd.conf) manually. The output will be similar to this one:
(You should copy them to clipboard.)
LoadModule passenger_module
/usr/local/rvm/gems/ruby-2.0.0-p353/gems/passenger-
4.0.26/buildout/apache2/mod_passenger.so
PassengerRoot /usr/local/rvm/gems/ruby-2.0.0-p353/gems/passenger-4.0.26
PassengerDefaultRuby /usr/local/rvm/wrappers/ruby-2.0.0-p353/ruby
Place above line into the bottom of httpd config file. Restart Apache:
systemctl restart httpd
Next step. Find out How
to deploy Ruby app on Centos 7 using Phusion Passenger