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
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

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

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...