How to Install Canvas LMS on VPS or Dedicated Server

The official Canvas LMS installation guide did not work for me, to successfully complete Canvas installation I had to go back and forth, I crawled numerous forums, blogs, Ruby and Apache documentation and finally I got working production Canvas installation. To start the setup follow the official Canvas LMS installation guide at https://github.com/instructure/canvas-lms/wiki/Production-Start. After following the guide above you will get working copy of Canvas… but if something goes wrong after you make a final Apache restart – read on or contact our Linux support.

The official Canvas LMS installation guide did not work for me, to successfully complete Canvas installation I had to go back and forth, I crawled numerous forums, blogs, Ruby and Apache documentation and finally I got working production Canvas installation.

To start the setup follow the official Canvas LMS installation guide at https://github.com/instructure/canvas-lms/wiki/Production-Start. After following the guide above you will get working copy of Canvas… but if something goes wrong after you make a final Apache restart – read on or contact our Linux support.

We can install Canvas LMS on your server just for $60! To get started we need the following info:

 - website URL to be used for Canvas LMS installation
 - root SSH access to your server
 - SMTP access details for outgoing email notifications

In addition to Canvas LMS installation service we are also offering BigBlueButton installation service and BigBlueButton integration with Canvas LMS. BigBlueButton (http://demo.bigbluebutton.org/) is Open Source web conferencing software, it allows creating online meetings, presentations etc. By integrating BBB with Canvas LMS you are getting another great way to deliver content to your students.

Interested in Canvas LMS integration with BigBlueButton? Contact Us for more info!

or

Order Canvas LMS Installation Service

Order Canvas LMS Hosting Service

 

Dependency installation – nodejs

Issues started during the dependency installation - nodejs is missing in default debian/ubuntu repositories. Thanks to Installing Node.js via package manager I finally managed to install nodejs.

 

Outgoing mail configuration issue

To make outgoing email working properly in Canvas you need not only to configure email server settings in production section, you also need to specify a delivery method:

delivery_method: “smtp”

 

Canvas - bundler not found

This error is caused by missing GEM_HOME variable in Apache configuration. There are two solutions available:

1) Set GEM_HOME variable in the Apache virtual host configuration file:

SetEnv GEM_HOME /path/to/gem/folder

To avoid next issue I also recommend to set RAILS_ENV variable:

SetEnv RAILS_ENV production

Restart webserver.

If you still get “bundler not found” error – try the solution below.

2) The second way to set GEM_HOME and RAILS_ENV variables is to create a Ruby Wrapper: Create file /usr/bin/ruby_with_env with the following content:

#!/bin/bash

export GEM_HOME=/path/to/gem/folder

export RAILS_ENV=production

/usr/bin/ruby $*

Make this file executable:

chmod +x /usr/bin/ruby_with_env

Locate and edit PassengerRuby directive in Apache configuration:

# PassengerRuby /usr/bin/ruby

PassengerRuby /usr/bin/ruby_with_env

Restart Apache webserver.

 

“Too short encryption key” error

Most probably you will not get this error if you set RAILS_ENV variable using steps above, else you need to edit config/security.yml and copy encryption_key for test and development environments.

 

Canvas file ownership issue – Permissions denied 

This error is more than obvious, user running Canvas can not read configuration files. The solution is simple, run Canvas as webserver user. On ubuntu/debian webserver is usually running as www-data. To fix the permissions issue just chown Canvas files to www-data:

chown -R www-data:www-data /path/to/canvas/installation

 

CSS issue – stylesheet is missing

Once you get everything up and running the most annoying issue is ugly stylesheet. To fix the issue you can try to remove “assets” folder from the public directory and regenerate assets using command below:

$GEM_HOME/bin/bundle exec rake canvas:compile_assets

If you still get common.css file zero bytes length you can just use pre-built common.css file.

 

File Upload error 422 – ActionController::InvalidAuthenticityToken

Instructive brings new surprises – recently during Canvas LMS installation I got issues with file uploads. In logs/production.log file I found the following error: ActionController::InvalidAuthenticityTokenFile uploads via Drag/Drop and via attachment were working. Thanks to Christopher Bennell I found a solution.

Edit app/controllers/application_controller.rb with your favorite editor and disable protect_from_forgery by commenting that line

nano app/controllers/application_controller.rb

- protect_from_forgery

+#  protect_from_forgery

 

Thank to all who helped me to complete the installation!

- css issue:

http://groups.google.com/group/canvas-lms-users/browse_thread/thread/35dd6fde7f74e902

- RAILS_ENV issue (Page ErrorWell, looks like something broke. Sorry you had to see that.):

https://groups.google.com/forum/#!msg/canvas-lms-users/iwCgno5hLGY/p5pN_OJvjYkJ

- permission issue:

https://github.com/instructure/canvas-lms/issues/133

- encryption key issue:

https://github.com/instructure/canvas-lms/issues/120

- bundler not found error:

http://stackoverflow.com/questions/79474/setting-environment-variables-for-phusion-passenger-applicationshttp://blog.rayapps.com/2008/05/21/using-mod_rails-with-rails-applications-on-oracle/