Skip to content

Deployment Install Passenger Nginx

daronco edited this page Sep 26, 2014 · 2 revisions

Note: This is kept here for internal documentation only, but it is not recommended to be used and is probably outdated!

Passenger with Nginx

Note: If you're installing Mconf-Web in the same machine where you already have BigBlueButton, you should use Apache for Mconf-Web. If you decide to use Nginx, you'll have to configure it manually (see more about this issue in this page).

To use Nginx with Passenger, first install Passenger (it's a ruby gem) and then it will help you download, compile and install Nginx. Run the following commands:

cd ~/mconf-web/current
gem install passenger -v 3.0.11   # this version is also defined in the Gemfile
passenger-install-nginx-module

The application passenger-install-nginx-module is a installer that guides you through the installation of Nginx for Passenger. It is interactive and has the following steps:

  1. Check for dependencies: If your system is missing any required software, it will warn you and tell you how to install them;
  2. Automatically download and install Nginx: Select the option "1. Yes";
  3. Where do you want to install Nginx to: You can choose the default location (just press enter). Nginx will be compiled and installed;
  4. It will edit Nginx configuration file for you and give you an example of how to deploy an application. Ignore the example for now, the next step of this guide will show you the specific configurations for Mconf-web.

See more about Passenger at their website and check this video to see how it can be installed along with Nginx.

Nginx configurations

If you installed Nginx in the default location, it's configuration file will be at /opt/nginx/conf/nginx.conf.

Open this file and add the following content inside the http block, above the other server block.

server {
    listen 80;
    server_name IP_OR_DOMAIN;
    root /home/mconf/mconf-web/current/public;
    passenger_enabled on;
    if (-f $document_root/system/maintenance.html) {
        rewrite ^(.*)$ /system/maintenance.html break;
    }
}

Important: Don't forget to change IP_OR_DOMAIN by the IP or domain name of your server.

You can find an example of the nginx.conf we use at our repository here.

Since Passenger installs Nginx from source code, you won't have the script to start/stop Nginx. So we copied the script generated when you install the Nginx package in Ubuntu and made it available here. Download it to your server with:

sudo curl https://github.com/mconf/mconf-web/blob/latest/config/webserver/nginx.init.example -o /etc/init.d/nginx

Now you can start/stop/restart Nginx with:

sudo /etc/init.d/nginx start
sudo /etc/init.d/nginx stop
sudo /etc/init.d/nginx restart

Open your browser and try to access your localhost. You might see a page with the error "404 Not Found", but that is ok in case the application not deployed yet.