cPanel

Install Phusion Passenger on cPanel or CentOS

Install Phusion Passenger
Install Phusion Passenger

Install Phusion Passenger on cPanel or CentOS

This post explains how to install Phusion Passenger on cPanel or CentOS. Phusion Passenger is an open source web application server. It handles HTTP requests, manages processes and resources, and enables administration, monitoring and problem diagnosis.

We need to install Ruby on Rails to install Phusion Passenger. As you know Ruby on Rails feature provided by cPanel is an outdated one and we can’t install Phusion Passenger using this Ruby version. So install Ruby with RVM to get the latest version of Ruby.

Note: Please make sure that your server has atleast 1.5GB of RAM to install Phusion Passenger

Install Ruby Version Manager (RVM):

Install RVM using the following commands:

gpg2 --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
curl -L get.rvm.io | bash -s stable
source /etc/profile.d/rvm.sh
rvm requirements

Install Ruby with RVM:

rvm install 2.4.0
rvm use 2.4.0 --default

Check the installation:

[root@server ~]# rvm use 2.4.0 --default
Using /usr/local/rvm/gems/ruby-2.4.0
[root@server ~]# ruby -v
ruby 2.4.0p0 (2016-12-24 revision 57164) [x86_64-linux]
[root@server ~]#

Install Rails:

gem install rails

Check the Rails version:

[root@server ~]# rails -v
Rails 5.1.3
[root@server ~]#

Install Phusion Passenger

gem install passenger
yum install curl-devel sqlite-devel

Also, make sure that Apache 2 development headers is installed on the server.

yum install httpd-devel

If you are running a cPanel server, run the following command to install Apache 2 development headers:

yum install ea-apache24-devel

Run the following command to complete the Passenger installation:

passenger-install-apache2-module

Create Passenger configuration file:

vim /usr/local/apache/conf/passenger.conf

Add the following into it:

LoadModule passenger_module /usr/local/rvm/gems/ruby-2.4.0/gems/passenger-5.1.7/buildout/apache2/mod_passenger.so
PassengerRoot /usr/local/rvm/gems/ruby-2.4.0/gems/passenger-5.1.7
PassengerDefaultRuby /usr/local/rvm/wrappers/ruby-2.4.0/ruby

Now open this file:

vim /usr/local/apache/conf/includes/pre_main_global.conf

And add the following line:

Include "/usr/local/apache/conf/passenger.conf"

Restart Apache:

service httpd restart

That’s it!

If you like this post and wish to receive more articles from us, please like our FB page: Button

Your suggestions and feedbacks will encourage us and help to improve further, please feel free to write your comments.

For more details on our services, please drop us an E-mail at info@grepitout.com