CANVAS LMS开源系统

来源:互联网 发布:私有云 软件 编辑:程序博客网 时间:2024/06/07 02:42


Canvas LMS初窥

Git

You can installGiton Debian/Ubuntu by running

$ sudo apt-get install git-core

Once you have a copy of Git installed on your system,getting the latest source for Canvas is as simple as checking out code from therepo, like so:

~$ git clone https://github.com/instructure/canvas-lms.git canvas

~$ cd canvas

~/canvas$ git checkout --track -b stable origin/stable

 

Docker

==========CanvasLMS也有docker file了,那岂不是docker一下是最快的方式

ROM ruby:2.1

 

ENV DEBIAN_FRONTEND noninteractive

 

RUN curl -sLhttps://deb.nodesource.com/setup | bash -

RUN apt-get update -qq \

 && apt-get install -qqy \

      locales \

      nodejs \

      postgresql-client \

      libxmlsec1-dev \

 && rm -rf /var/lib/apt/lists/*

 

# Ensure UTF-8 locale

RUN echo en_US.UTF-8 UTF-8 >>/etc/locale.gen

RUN locale-gen en_US.UTF-8

ENV LANG      en_US.UTF-8

ENV LC_ALL    en_US.UTF-8

RUN dpkg-reconfigure locales

 

# Canvas requiresbundler 1.7.10  

//什么是Bundler

  Canvas uses Bundler as an additional layeron top of Ruby Gems to manage versioned dependencies. Bundler is great!

//

RUN gem uninstall bundler \

 && gem install bundler -v 1.7.10

 

RUN mkdir /app

WORKDIR /app

 

RUN mkdir /home/docker \

 && useradd -d /home/docker docker \

 && chown -R docker:docker /home/docker/usr/local/bundle

 

Core components(不涉及部署,可同一个机器)

 

部署过程逆向,从底向上:

Starting PostgreSQL 9.3 databaseserver 如果你安装的postsql在别的服务器,要配置下postgresql.conf / pg_hba.conf

在数据库中createuser创建默认用户canvas,然后createdb安装默认数据库

把当前系统用户加到数据库的超级用户

sudo -u postgres createuser $USER

sudo -u postgres psql -c "alter user $USER with superuser"postgres

 

安装代码

应用程序目录结构

 

 

RUBY

$ sudo apt-get installruby2.1 ruby2.1-devzlib1g-dev libxml2-dev \

                      libsqlite3-devpostgresql libpq-dev \

                      libxmlsec1-dev curl make g++

 

Node.js

$ curl -sL https://deb.nodesource.com/setup_0.12 | sudo bash -

$ sudo apt-get install nodejs

APAChe web

 

Note: Some users have found that, to setup the web server, they need to addthe Phusion Passenger APT repository, which contains the passenger-common1.9.1 package, and then to installpassenger, which replacespassenger-common1.9.1. After adding the new APT repository, theinstall command looks like this:

Ruby Package

sudo apt-get install rubygems

安装之后还是失败Gem找不到

root@server-zyq9z8tu:/var/canvas/lib# gem

The program 'gem' can be found in thefollowing packages:

 *ruby

 *rubygems

Try: apt-get install <selectedpackage>

0 0