Practical Web Programming

Saturday, January 09, 2016

How to Install Passenger + Apache in Ubuntu 16.04 LTS

Note: This assumes that you already have a running Ubuntu server. To install basic security in Ubuntu, see Basic Security Installs for Ubuntu. This instructions was extracted from here.
  1. Install Apache Server
      sudo apt-get update
      sudo apt-get install apache2
  2. Set Global ServerName to Suppress Syntax Warnings: "AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using Set the 'ServerName' directive globally to suppress this message"
      sudo vim /etc/apache2/apache2.conf
    and enter at the end of the file:
      ServerName server_domain_or_IP
  3. Test config so far
      sudo apache2ctl configtest
  4. Restart Apache for the changes to take effect
      sudo systemctl restart apache2
  5. Install Passenger packages.
    # Install our PGP key and add HTTPS support for APT
    sudo apt-key adv --keyserver hkp:// --recv-keys 561F9B9CAC40B2F7
    sudo apt-get install -y apt-transport-https ca-certificates
    # Add our APT repository
    sudo sh -c 'echo deb xenial main > /etc/apt/sources.list.d/passenger.list'
    sudo apt-get update
    # Install Passenger + Apache module
    sudo apt-get install -y libapache2-mod-passenger
    These commands will install Passenger + Apache module through Phusion's APT repository.
  6. Enable the Passenger Apache module and restart Apache
    sudo a2enmod passenger
    sudo apache2ctl restart
  7. Check installation
    sudo passenger-config validate-install
    All checks should pass. If any of the checks do not pass, please follow the suggestions on screen.
  8. Check whether Apache has started the Passenger core processes by running the following:
    sudo passenger-memory-stats


Recent Post