How to install Nginx with Passenger 5.0 on Fedora.
Please be aware the Ulyaoth Repository has been discontinued! Please read:
You can still make this tutorial work but you will need to compile the packages yourself, please be aware our GitHub is not longer updated however: https://github.com/ulyaoth/repository
In this guide I will show how you can install Passenger compiled with Nginx on Fedora.
Please be aware I am not a Passenger expert and this guide is based on what I normally do. There are two version of Passenger an open-source version that I will use for this guide and a paid Enterprise version if you are going to use Passenger in your company I would advise having a look at their website for the Enterprise version:
For this guide I used the following:
Server (1x cpu, 2gb ram)
Passenger + Nginx
This guide should also work on RHEL, CentOS and OracleLinux but you might need to change some directory locations or use slightly different commands.
Step 1: Add the Ulyaoth repository
Have a look on my forum for the latest rpm and instructions:
Step 2: install the required packages
$ sudo dnf install -y ulyaoth-nginx ulyaoth-nginx-module-passenger5 openssl ruby rubygem-rails
If you have selinux you should also install:
$ sudo dnf install -y ulyaoth-nginx-module-passenger5-selinux
Step 3: Create the following directories
$ sudo mkdir -p /usr/share/nginx/ulyaoth/public
$ sudo mkdir -p /var/log/nginx/passenger.ulyaoth.net
Step 4: Fix your Firewall to allow port 80.
$ firewall-cmd --permanent --zone=FedoraServer --add-service=http
Step 5: Restart firewalld.
$ sudo systemctl restart firewalld.service
Step 6: Put nginx-passenger on autostart when the server is rebooted.
$ sudo systemctl enable nginx.service
Step 7: Download the nginx vhost and symbolic link it.
$ sudo wget https://raw.githubusercontent.com/sbagmeijer/ulyaoth/master/guides/passenger/nginx/passenger.ulyaoth.net.conf -O /etc/nginx/sites-available/passenger.ulyaoth.net.conf
$ sudo ln -s /etc/nginx/sites-available/passenger.ulyaoth.net.conf /etc/nginx/sites-enabled/passenger.ulyaoth.net.conf
Step 8: Open the vhost and fix the server name.
$ sudo vi /etc/nginx/sites-available/passenger.ulyaoth.net.conf
Now change the line with “passenger.ulyaoth.net” to the domain name you will use.
Step 9: Open passenger.conf and add the following:
$ sudo vi /etc/nginx/conf.d/passenger.conf
add the following:
Of course change “passenger.ulyaoth.net” to the website you use in the nginx.conf “server_name” block at step 10.
you should this config now:
Change everything accordingly to what you will use! For the “passenger_pre_start” make sure you use the domain you used in the vhost above.
Step 10: Enable the Passenger module
$ sudo vi /etc/nginx/nginx.conf
and now add the following line under the load modules comment:
Step 11: Download a test file to see if passenger works.
$ sudo wget https://raw.githubusercontent.com/sbagmeijer/ulyaoth/master/guides/passenger/app/config.ru -O /usr/share/nginx/ulyaoth/config.ru
Step 12: Start Nginx
$ sudo systemctl start nginx.service
If you now browse to your website you should see it running:
Please be aware for my example I used rails if you did need this then do not install it of course also the example above is a quick way never run a website in production as root so make sure you run passenger as a different user.
For more information on passenger option please have a read through their extensive information page on:
Sjir has over 15 years of experience in information technology, having done various positions at companies such as Blizzard Entertainment, TV4, and Basefarm. He now wields multiple security, cloud, and IT certifications he currently works as an information security engineer.