Setting up Nginx and Passenger on Ubuntu 18.04

(1) Setup Nginx.

sudo apt update

sudo apt install nginx-extras

sudo service nginx start

(2) Setup Passenger.

sudo apt-get install -y dirmngr gnupg

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 561F9B9CAC40B2F7

sudo apt-get install -y apt-transport-https ca-certificates

sudo sh -c 'echo deb https://oss-binaries.phusionpassenger.com/apt/passenger bionic main > /etc/apt/sources.list.d/passenger.list'

sudo apt update

sudo apt install -y libnginx-mod-http-passenger

(3) Validate Installation

if [ ! -f /etc/nginx/modules-enabled/50-mod-http-passenger.conf ]; then sudo ln -s /usr/share/nginx/modules-available/mod-http-passenger.load /etc/nginx/modules-enabled/50-mod-http-passenger.conf ; fi

sudo ls /etc/nginx/conf.d/mod-http-passenger.conf

(4) Point to the installed Ruby binary.

$ sudo pico /etc/nginx/conf.d/mod-http-passenger.conf
passenger_ruby /home/ubuntu/.rbenv/shims/ruby;

(5) Test and reload.

sudo nginx -t

sudo service nginx restart

AI Summary
Chrome On-device AI 2024-10-04 23:34:07

Share Article