Canvas LMS/Installation/Ubuntu14 04

From r00tedvw.com wiki
(Difference between revisions)
Jump to: navigation, search
(Apache2 install/config)
(Apache2 install/config)
Line 175: Line 175:
  
 
==Apache2 install/config==
 
==Apache2 install/config==
 +
Unfortunately we need to add a repo before we can install passenger-common1.9.1 as it is not found in the normal 14.04 repo:
 +
<nowiki>E: Unable to locate package passenger-common1.9.1
 +
E: Couldn't find any package by regex 'passenger-common1.9.1'</nowiki>
 +
Add the new repo
 +
<nowiki>~$ 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 trusty main > /etc/apt/sources.list.d/passenger.list'
 +
~$ sudo apt-get update</nowiki>
 +
Now you should be able to install the required dependencies.
 
  <nowiki>~$ sudo apt-get install -y passenger-common1.9.1 libapache2-mod-passenger apache2</nowiki>
 
  <nowiki>~$ sudo apt-get install -y passenger-common1.9.1 libapache2-mod-passenger apache2</nowiki>

Revision as of 13:36, 20 August 2015

Installation Ubuntu 12.04 | Installation Ubuntu 14.04
Canvas - Learning Management Solution. Used by universities and schools.

Contents

Ubuntu 14.04

Requirements

In the simplest configuration, everything will be running off a single server.

Recommended Hardware specifications
Dual Core+ 3.0ghz+ or Dual processors
4GB+ RAM
60GB HDD
64-bit capable system

Software Requirements

Minimum, Ubuntu 14.04 LTS+ server edition. Desktop will require more hardware than listed above.

Download Database software

Postgres (Database)

~$ sudo apt-get update && sudo apt-get -y upgrade && sudo apt-get -y autoremove
~$ sudo apt-get update && sudo apt-get install postgresql-9.3 -y 

Configure Database

~$ sudo -u postgres createuser canvas -D -S -R -P
~$ sudo -u postgres createdb canvas_production --owner=canvas
~$ sudo -u postgres createdb canvas_queue_production --owner=canvas

Create superuser (this one is named helpdesk)

sudo -u postgres createuser helpdesk
~$ sudo -u postgres psql -c "alter user helpdesk with superuser" postgres

Download Git & Canvas

~$ sudo apt-get -y install git-core
~$ cd /var
~$ sudo git clone https://github.com/instructure/canvas-lms.git canvas
~$ cd canvas
~/var/canvas$ sudo git branch --set-upstream-to origin/stable
~/var/canvas$ sudo chown -R helpdesk /var/canvas   --- helpdesk just happens to be the name of this user.  use your own 

Download Ruby 2.1.6

You're going to have to add a repository because the version available through Ubuntu's US or Main repos is not up to date (at the time of this writing.

~/var/canvas$ sudo apt-get -y install software-properties-common
~/var/canvas$ sudo apt-add-repository ppa:brightbox/ruby-ng
~/var/canvas$ sudo apt-get update
~/var/canvas$ sudo apt-get -y install ruby2.1 ruby2.1-dev zlib1g-dev libxml2-dev libsqlite3-dev postgresql libpq-dev libxmlsec1-dev curl make g++

Download Node.js

~/var/canvas$ $ curl -sL https://deb.nodesource.com/setup_0.12 | sudo bash -
~/var/canvas$ sudo apt-get install nodejs -y

Download Ruby Gems

If you are behind a firewall, you're going to need to open up the following routes to complete this sections' installation instructions:

192.30.252.128:9418
192.30.252.129:9418
192.30.252.130:9418
192.30.252.131:9418
~/var/canvas$ sudo gem install bundler --version 1.7.11
~/var/canvas$ bundle install --path vendor/bundle --without=sqlite mysql

Download default config files from Amazon instance

~/var/canvas$ for config in amazon_s3 database \
  delayed_jobs domain file_store outgoing_mail security external_migration
do cp config/$config.yml.example config/$config.yml; done

Configuration

database.yml

~/var/canvas$ cp ./config/database.yml.example ./config/database.yml
~/var/canvas$ vi config/database.yml

Under Production

  • edit the database name (if different from default)default=canvas_production & canvas_queue_production
  • host (if different from default) default=localhost
  • username for database user (if different from default) default=canvas
  • password for database user
In my instance, nothing was changed except the password.
production:
 adapter: postgresql
 encoding: utf8
 database: canvas_production
 host: localhost
 username: canvas
 password: password
 timeout: 5000
 queue:
   adapter: postgresql
   encoding: utf8
   database: canvas_queue_production
   host: localhost
   username: canvas
   password: password
   timeout: 5000

outgoing_mail.yml

~/var/canvas$ cp ./config/outgoing_mail.yml.example ./config/outgoing_mail.yml
~/var/canvas$ vi config/outgoing_mail.yml

Under Production

  • Edit the address, this should be your email relay or SMTP server
  • Edit the port (if different from default) default=25
  • Edit the username for your relay/smtp
  • Edit the password for your relay/smtp
  • Edit the domain (if different from default) default=example.com
  • Edit the outgoing address (if different from default) [email protected]
In my instance, I only changed the address, username, password, domain, and outgoing_address
production:
 address: "smtp.example.com"
 port: "25"
 user_name: "user"
 password: "password"
 authentication: "plain" # plain, login, or cram_md5
 domain: "example.com"
 outgoing_address: "[email protected]"
 default_name: "Instructure Canvas"

domain.yml

~/var/canvas$ cp ./config/domain.yml.example ./config/domain.yml
 ~/var/canvas$ vi config/domain.yml

Under Production

  • Edit the domain
  • Uncomment the files domain and add your domain
In my instance, I only changed the domain and uncommented the files domain
production:
 domain: "canvas.example.com"
 # whether this instance of canvas is served over ssl (https) or not
 # defaults to true for production, false for test/development
 ssl: true
 files_domain: "canvasfiles.example.com"

security.yml

~/var/canvas$ cp ./config/security.yml.example ./config/security.yml
 ~/var/canvas$ vi config/security.yml

Under Production

  • Edit the encryption Key to a minimum of 20 characters. This can be random.
In my instance, I only changed the encryption key by pressing alot of buttons
production:
 # replace this with a random string of at least 20 characters
 encryption_key: hu9ehd92hdh2798ehdrd2hd37824   ---(no this is not really my encryption key)

Database Population

~/var/canvas$ RAILS_ENV=production bundle exec rake db:initial_setup

You will be asked the following questions:

What email address will the site administrator account use? > 
Please confirm > 
What password will the site administrator use? >
Please confirm >
What do you want users to see as the account name? This should probably be the name of your organization. >
To help our developers better serve you, Instructure would like to collect some usage data about your Canvas installation. You can  
change this setting at any time.:
1. Opt in
2. Only send anonymized data
3. Opt out completely 
>

File Generation

~/var/canvas$ sudo mkdir -p log tmp/pids public/assets public/stylesheets/compiled
~/var/canvas$ sudo touch Gemfile.lock
~/var/canvas$ npm install
~/var/canvas$ RAILS_ENV=production bundle exec rake canvas:compile_assets

STOPPED HERE 8/19

Ownership limitations

I did this with www-data as this user exists by default with Apache installtions on Ubuntu.
Verify www-data exists:

~/var/canvas$ awk -F':' '{ print$1}' /etc/passwd
...
www-data
...

Limit read access

 ~/var/canvas$ sudo chown -R www-data config/environment.rb log tmp public/assets public/stylesheets/compiled Gemfile.lock config.ru
 ~/var/canvas$ sudo chown www-data ./config/*.yml
 ~/var/canvas$ sudo chmod 400 ./config/*.yml

Apache2 install/config

Unfortunately we need to add a repo before we can install passenger-common1.9.1 as it is not found in the normal 14.04 repo:

E: Unable to locate package passenger-common1.9.1
E: Couldn't find any package by regex 'passenger-common1.9.1'

Add the new repo

~$ 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 trusty main > /etc/apt/sources.list.d/passenger.list'
~$ sudo apt-get update

Now you should be able to install the required dependencies.

~$ sudo apt-get install -y passenger-common1.9.1 libapache2-mod-passenger apache2
Personal tools
Namespaces

Variants
Actions
Navigation
Mediawiki
Confluence
DevOps Tools
Open Source Products
Ubuntu
Ubuntu 22
Mac OSX
Oracle Linux
AWS
Windows
OpenVPN
Grafana
InfluxDB2
TrueNas
MagicMirror
OwnCloud
Pivotal
osTicket
OTRS
phpBB
WordPress
VmWare ESXI 5.1
Crypto currencies
HTML
CSS
Python
Java Script
PHP
Raspberry Pi
Canvas LMS
Kaltura Media Server
Plex Media Server
MetaSploit
Zoneminder
ShinobiCE
Photoshop CS2
Fortinet
Uploaded
Certifications
General Info
Games
Meal Plans
NC Statutes
Politics
Volkswagen
Covid
NCDMV
Toolbox