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 a 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 to have 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
If you have selinux you should also install:Code:$ sudo dnf install -y ulyaoth-nginx-passenger5 openssl ruby rubygem-rails
Step 3: Create the following directoriesCode:$ sudo dnf install -y ulyaoth-nginx-passenger5-selinux
Step 4: Fix your Firewall to allow port 80.Code:$ sudo mkdir -p /usr/share/nginx/ulyaoth/public $ sudo mkdir -p /var/log/nginx/passenger.ulyaoth.net
Step 5: Restart firewalld.Code:$ firewall-cmd --permanent --zone=FedoraServer --add-service=http
Step 6: Put nginx-passenger on autostart when the server is rebooted.Code:$ sudo systemctl restart firewalld.service
Step 7: Download the nginx vhost and symbolic link it.Code:$ sudo systemctl enable nginx.service
Step 8: Open the vhost and fix the server name.Code:$ 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
Now change the line with "passenger.ulyaoth.net" to the domain name you will use.Code:$ sudo vi /etc/nginx/sites-available/passenger.ulyaoth.net.conf
Step 9: Open passenger.conf and add the following:.
add the following:Code:$ sudo vi /etc/nginx/conf.d/passenger.conf
Ofcourse change "passenger.ulyaoth.net" to the website you use in the nginx.con "server_name" block at step 10.Code:passenger_pre_start http://passenger.ulyaoth.net/; passenger_min_instances 2; passenger_max_pool_size 4;
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.Code:passenger_log_level 2; passenger_log_file /var/log/passenger/passenger.log; passenger_pre_start http://passenger.ulyaoth.net/; passenger_min_instances 2; passenger_max_pool_size 4; passenger_instance_registry_dir /var/cache/nginx/passenger_temp/; passenger_root /etc/nginx/modules/passenger; passenger_ruby /usr/bin/ruby;
Step 10: Download a test file to see if passenger works.
Step 11: Start NginxCode:$ sudo wget https://raw.githubusercontent.com/sbagmeijer/ulyaoth/master/guides/passenger/app/config.ru -O /usr/share/nginx/ulyaoth/config.ru
If you now browse to your website you should see it running:Code:$ sudo systemctl start nginx.service
Please be aware for my example I used rails if you not need this then do not install it ofcourse, 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 trough their extensive information page on:
https://www.phusionpassenger.com/documentation/Users guide Nginx.html