What is mod_passenger?
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.
If you are interested in Phusion Passenger configurations with Apache, see Phusion Passenger’s Apache configuration page.
How do I use mod_passenger?
Setting up mod_passenger requires you to enable the module in the Apache Options interface and to set up your web app.
You can enable mod_passenger in your VPS or Dedicated Account Control Center (ACC). To enable, follow these steps:
- Log in to the ACC on your VPS or Dedicated account
- In the left sidebar, click Dedicated, then click Apache Options in the drop-down
- In the Apache Module section, check the box next to mod_passenger
- Click the Make Changes button
This will enable mod_passenger on your server, though it may take up to 15 minutes for the change to go into effect.
Setting Up Apps
You can set up a variety of web app types once mod_passenger has been enabled. You can find the basic steps for setting up the different kinds of web apps below.
Setting Up Ruby
After mod_passenger has been enabled, you can set up your Ruby web app.
Adding a Ruby app does not require much additional set up. Create the Ruby app on your server and name it, config.ru. Next, map a domain to the “public” directory within the app.
After installing an app, you will need to restart the Apache server. For information about how to do this from the ACC, see our How to Restart Apache article.
Once you have restarted the Apache server, Phusion Passenger will automatically detect your Ruby app and serve it on the domain.
Setting Up Node.js
To set up a Node.js apps with mod_passenger, create the Node.js app on the server and name it, app.js. Next, map a domain to the “public” directory within the app.
Setting Up Python
After enabling mod_passenger, you can host Python web apps, like Flask or Django, on your server.
Add the Python web app to your server and name it, passenger_wsgi.py. Next, map a domain to the “public” directory within the app.