apacheubuntucanvas-lms

Configure Passenger with Apache - On Canvas LMS


Canvas LMS Installation

https://github.com/instructure/canvas-lms/wiki/Production-Start

Configure Passenger with Apache

First, make sure Passenger is enabled for your Apache configuration. In Debian/Ubuntu, the libapache2-mod-passenger package should have put symlinks inside of /etc/apache2/mods-enabled/ called passenger.conf and passenger.load. If it didn't or they are disabled somehow, you can enable passenger by running:

sysadmin@appserver:/var/canvas$ sudo a2enmod passenger In other setups, you just need to make sure you add the following lines to your Apache configuration, changing paths to appropriate values if necessary:

LoadModule passenger_module /usr/lib/apache2/modules/mod_passenger.so
PassengerRoot /usr
PassengerRuby /usr/bin/ruby

If you have trouble starting the application because of permissions problems, you might need to add this line to your passenger.conf, site configuration file, or httpd.conf (where canvasuser is the user that Canvas runs as, www-data on Debian/Ubuntu systems for example):

PassengerDefaultUser canvasuser

I don't find the httpd.conf file (Using ubuntu 16.04) and don't understand where to put (Path of the file, Which file)

Can anyone please help me with this, What i have to do in this section?


Solution

  • You don't need add those lines to apache configs if you have installed libapache2-mod-passenger (Ubuntu, Debian) and executing 'sudo a2enmod passenger' was OK (no reply that module don't exist) You need create VirtualHost with something like

    <VirtualHost IP:80>
    ServerName canvas.yourdomain.net
    DocumentRoot /home/canvas/public
    
    RewriteEngine On
    RewriteCond %{HTTP:X-Forwarded-Proto} !=https
    RewriteCond %{REQUEST_URI} !^/health_check
    RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L]
    
    ErrorLog /var/log/virtualmin/canvas_error_log
    CustomLog /var/log/virtualmin/canvas_access_log combined
    
    SetEnv RAILS_ENV production
    
    <Directory /home/canvas/public>
    Allow from all
    Options -MultiViews
    </Directory>
    
    </VirtualHost>