Jump to content

How to Install mod_passenger in CWP Apache


Recommended Posts

Installation of mod_passenger in CWP- Control WebPanel in Centos 7/EL7/Centos 8 Stream/El8 easily with this below steps provided. Ensure you run this command as root user.

mod_passenger enables Phusion Passenger to host Ruby, Python, and Node.js apps on the Apache server. Phusion Passenger specializes in managing these types of apps by restarting them in the case of an app crash, keeping heavy-resource usage in check, and more. By enabling this feature, you will be able to add Ruby, Python, and Node.js apps onto your server.

First install some requirements like ruby gem and rack and dependencies
Centos 7/EL7 :

yum install apr apr-devel ruby rubygem-rake ruby-devel curl-devel libcurl-devel apr-util apr-util-devel -y
gem install "rubygems-update:<3.0.0" --no-document
update_rubygems
gem install rack -v 1.6.13


Centos 8 Stream/EL8/AlmaLinux/Rocky Linux/Oracle Linux :

dnf install apr apr-devel ruby rubygem-rake ruby-devel curl-devel libcurl-devel apr-util apr-util-devel -y
gem install rubygems-update
gem update --system
gem install rack


Now install mod_passenger in CWP Apache

mkdir -p /usr/local/pbuild
cd /usr/local/pbuild
rm -rf latest_stable_tarball passenger*
wget https://www.phusionpassenger.com/latest_stable_tarball
tar -xzvf latest_stable_tarball
rm -rf /usr/local/pbuild/passenger-*.tar.gz
mv /usr/local/pbuild/passenger-* /usr/local/pbuild/passenger
cd /usr/local/pbuild/passenger/bin
export APXS2=/usr/local/apache/bin/apxs
export APR_CONFIG=/usr/bin/apr-1-config
./passenger-install-apache2-module


you’ll get some prompts which you need to press enter and proceed with default options and don’t select another option until you know what you’re doing.

Now add the module in Apache, select all, copy and paste in terminal/ssh and hit enter key:

cat > /usr/local/apache/conf.d/passenger.conf << "EOF"
LoadModule passenger_module /usr/local/src/pbuild/passenger/buildout/apache2/mod_passenger.so
<IfModule mod_passenger.c>
PassengerRoot /usr/local/pbuild/passenger
PassengerDefaultRuby /usr/bin/ruby
</IfModule>
EOF


then restart apache

systemctl restart httpd


you can check if mod_passenger is loaded in apache as module or not via this command. if the command outputs the passenger_module then you’re good to go :

/usr/local/apache/bin/httpd -M | grep passenger

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...