ubuntu16.04 挂载新硬盘

ubuntu admin 发表了文章 • 0 个评论 • 134 次浏览 • 2020-03-03 01:43 • 来自相关话题

查看电脑内读到的盘的情况,找到你要添加的新盘sudo fdisk -l格式化新盘(我没有进行分区) 我的盘是sdd1 ...查看全部

查看电脑内读到的盘的情况,找到你要添加的新盘

sudo fdisk -l

格式化新盘(我没有进行分区) 我的盘是sdd1

sudo mkfs.ext4  /dev/sdd1

查看硬盘的UUID(每次格式化一次,这个uuid就会变化一次,认准uuid号识盘)

sudo blkid

在一个目录下新建一个挂载点。建议在home下:

mkdir /home/xxxx/newdisk

编辑系统挂载配置文件/etc/fstab

sudo  vim /etc/fstab

df -hl的时候能看到新添加的盘...

修改对应的用户和权限

sudo chown -R xxx:xxx /home/xxx/newdisk
sudo chmod -R 777 /home/xxx/newdisk

777表示所有用户均有权限读取。

重启电脑即可

sudo reboot

————————————————

版权声明:本文为CSDN博主「jiachen0212」的原创文章,遵循 CC 4.0 BY-SA 版权协议

原文链接:https://blog.csdn.net/jiachen0212/article/details/79912799

SIS导入没有反应,不工作,进度一直是0

admin 发表了文章 • 0 个评论 • 579 次浏览 • 2018-07-12 21:56 • 来自相关话题

这个大概率是因为延迟工作服务器没有正常运行。 可以用下面的命令运行: sudo RAILS_ENV=production sc ...查看全部

这个大概率是因为延迟工作服务器没有正常运行。



可以用下面的命令运行:

sudo RAILS_ENV=production script/delayed_job start



 



 


Ubuntu16.04 替换阿里云软件源

admin 发表了文章 • 0 个评论 • 922 次浏览 • 2018-07-06 10:10 • 来自相关话题

一,备份原来的源文件 1,首先,进入源文件 sources.list 所在的目录: ...查看全部

一,备份原来的源文件



1,首先,进入源文件 sources.list 所在的目录:




cd /etc/apt/


2,执行sudo cp sources.list sources.list.bak对源文件进行备份,以防万一;



二,修改源文件内容



1,阿里云软件源的文件的内容如下:





 


#deb包



deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse  



deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse  



deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse  



deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse  



##测试版源  



deb http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse  



# 源码  



deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse  



deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse  



deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse  



deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse  



##测试版源  



deb-src http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse  



# Canonical 合作伙伴和附加  



deb http://archive.canonical.com/ubuntu/ xenial partner 





 


三,更新源和软件



1,使用sudo apt-get update即可更新获取 阿里云软件源 提供的软件列表; 

2,使用sudo apt-get upgrade即可更新软件;



 


ubuntu14.04.2安装production版本 英文指导

admin 发表了文章 • 0 个评论 • 2587 次浏览 • 2016-11-23 09:25 • 来自相关话题

Ubuntu ...查看全部

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.



Recommendations



I would recommend creating a user for installation of the Canvas rather than a unique personal or administrative account.  This is because certain files cannot be edited with sudo or it will break canvas.



Installing PostgreSQL



Postgres (Database)




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


Configure PostgreSQL




~$ 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


Verify Database Access



Its a good idea to make sure the new user can access the databases you just created.




~$ psql -h localhost -U canvas canvas_production
Password for user canvas:
psql (9.3.9)
SSL connection (cipher: DHE-RSA-AES256-GCM-SHA384, bits: 256)
Type "help" for help.

canvas_production=> \q

~$ psql -h localhost -U canvas canvas_queue_production
Password for user canvas:
psql (9.3.9)
SSL connection (cipher: DHE-RSA-AES256-GCM-SHA384, bits: 256)
Type "help" for help.

canvas_queue_production=> \q


Getting the Code & Installation




~$ sudo apt-get -y install git-core
~$ cd $HOME
~/home/$USER$ git clone https://github.com/instructure/canvas-lms.git canvas
~/home/$USER$ cd canvas
~/home/$USER/canvas$ git branch --set-upstream-to origin/stable
~/home/$USER/canvas$ sudo mkdir -p /var/canvas
~/home/$USER/canvas$ sudo chown -R $USER /var/canvas
~/home/$USER/canvas$ cp -rav /home/$USER/canvas/. /var/canvas


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


Its a good idea to verify you have Ruby 2.1 or higher after installation




~/var/canvas$ ruby -v
ruby 2.1.6p336 (2015-04-13 revision 50298) [x86_64-linux-gnu]


Dependency Installation -Node.js




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


Set systemuser as postgres superuser




~/var/canvas$ sudo -u postgres createuser $USER
~/var/canvas$ sudo -u postgres psql -c "alter user $USER with superuser" postgres


Ruby Gems -Bundler and Canvas dependencies



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.13.3


Install bundle.  You CANNOT install this as Root, if you do, it will break the application.  If you are getting a permissions error, then you did not copy the files to /var/canvas properly as instructed earlier.




~/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


Default Configuration



database.yml




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


Comment everything except Production if that is all you want.

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


Comment everything except Production if that is all you want.

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) default=canvas@example.com




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: "canvas@example.com"
default_name: "Instructure Canvas"


domain.yml




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


Comment everything except Production if that is all you want.

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


Comment everything except Production if that is all you want.

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
>


Canvas Ownership



I found this to be a required step so that pages would load properly.  I could not use www-data.




~/var/canvas$ sudo adduser --disabled-password --gecos canvas canvasuser


File Generation




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


Troubleshooting



If the npm install command hangs (just shows |/-\| over and over), stop it and clear out the cache:




~/var/canvas/$ cd ./gems/canvas_i18nliner/
~/var/canvas/gems/canvas_i18nliner$ rm -r ./node_modules/
~/var/canvas/gems/canvas_i18nliner$ npm cache clean


This should clear it up for you and allow you to complete the npm install quickly.



Private Canvas files Ownership



Limit read access




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


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.  passenger replaces passenger-common1.9.1




~$ sudo apt-get install -y passenger libapache2-mod-passenger apache2


Begin Apache config




~$ sudo a2enmod rewrite
~$ sudo service apache2 restart


Troubleshooting



If you get the error:

AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message

Do the following and it should resolve the warning:




~/var/canvas$ echo "ServerName localhost" | sudo tee /etc/apache2/conf-available/fqdn.conf
~/var/canvas$ sudo a2enconf fqdn
~/var/canvas$ sudo service apache2 reload
* Reloading web server apache2
*


Configure Passenger




~$ sudo a2enmod passenger


Configure SSL with Apache




~/var/canvas$ sudo a2enmod ssl
~/var/canvas$ sudo service apache2 restart


Generate a CSR for SSL provider


The following will generate a SSL Key w/o a passphrase.  Keep in mind that if the key is compromised the SSL traffic is compromised.




openssl genrsa -out server.key 2048


If you've already generated a key with a passphrase and want to remove it, run the following




openssl rsa -in server.key -out server.key.insecure


Now that you have the key you can generate the CSR.




openssl req -new -key server.key -out server.csr


Submit the CSR to your SSL provider and specify what type of system the website is hosted on (ie. apache2 on Linux).  They will generally then provide you with the following:




  • Root Certificate

  • Chain Certificate

  • SSL Certificate



I personally check my existing certificates located under /etc/ssl/certs to make sure that neither the Root Certificate or Chain Certificate is already there. If not, then create a new file for each and paste the Root and Chain into each, respectively.

For the SSL certificate, I recommend that you create a sub folder either under /etc/ssl/certs/ or /etc/ssl/private/ and organize the cert, csr, and key under such.  Make sure your permissions are set correctly, you do not want just anyone being able to view these files.



Configure Canvas with Apache2



You should be using Apache 2.4+, make sure you are:




~$ apache2 -v
Server version: Apache/2.4.7 (Ubuntu)
Server built: Jul 24 2015 17:25:11


Disable default site




~$ sudo a2dissite 000-default.conf
~$ sudo service apache2 reload


Create the canvas apache config file




~/var/canvas$ sudo vi /etc/apache2/sites-available/canvas.conf


Paste the following into the new file:





ServerName canvas.example.com
ServerAlias files.canvas.example.com
ServerAdmin youremail@example.com
DocumentRoot /var/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/apache2/canvas_errors.log
LogLevel warn
CustomLog /var/log/apache2/canvas_access.log combined
SetEnv RAILS_ENV production

Allow from all
Options -MultiViews



ServerName canvas.example.com
ServerAlias files.canvas.example.com
ServerAdmin youremail@example.com
DocumentRoot /var/canvas/public
ErrorLog /var/log/apache2/canvas_errors.log
LogLevel warn
CustomLog /var/log/apache2/canvas_ssl_access.log combined
SSLEngine on
BrowserMatch "MSIE [2-6]" nokeepalive ssl-unclean-shutdown downgrade-1.0 force-response-1.0
BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown
# the following ssl certificate files are generated for you from the ssl-cert package.
SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
SetEnv RAILS_ENV production
XSendFile On
XSendFilePath /var/canvas
PassengerDefaultUser canvasuser
PassengerFriendlyErrorPages on

Options All
AllowOverride All
Require all granted



Modify the following values in the new canvas config file:





ServerName [value] -- changed from default
ServerAlias [value] -- changed from default
ServerAdmin [value] -- changed from default
DocumentRoot [value] -- default
...
SetEnv [value] -- default
-- default
...


ServerName [value] -- changed from default
ServerAlias [value] -- changed from default
ServerAdmon [value] -- changed from default
DocumentRoot [value] -- default
...
SSLCertificateFile [value] -- changed from default
SSLCertificateKeyFile [value] -- changed from default
SetEnv [value] -- default
-- default
...


Enable the new site




~/var/canvas$ sudo a2ensite canvas.conf
~$ sudo service apache2 restart




Note: Don't forget to publish A records for both canvas.example.com & files.canvas.example.com



Optimize File Downloads



Pertains to locally stored data




~$ sudo apt-get update && sudo apt-get install -y libapache2-mod-xsendfile
~$ sudo a2enmod xsendfile
~$ sudo service apache2 restart


create new config file to avoid future merge conflicts




~/var/canvas$ cp ./config/environments/production.rb ./config/environments/production-local.rb


Edit ./config/environments/production-local.rb and uncomment




~/var/canvas$ vi ./config/environments/production-local.rb
config.action_dispatch.x_sendfile_header = 'X-Sendfile'


Add the following directives to your apache virtual host config (ie. /etc/apache2/sites-available/canvas)




~$ sudo vi /etc/apache2/sites-available/canvas.conf
XSendFile On
XSendFilePath /var/canvas


I added mine here:




SetEnv RAILS_ENV production
XSendFile On
XSendFilePath /var/canvas


restart apache2




sudo service apache2 restart


Redis Server install




~/var/canvas$ sudo apt-add-repository ppa:chris-lea/redis-server
~/var/canvas$ sudo apt-get update
~/var/canvas$ sudo apt-get -y install redis-server


verify that the redis version installed is 2.6x or above




~/var/canvas$ redis-cli info | grep redis_version
OR
redis-server --version


The above should return a response like such:




redis_version: 2.8.4
OR
Redis server v=3.0.3 sha=00000000:0 malloc=jemalloc-3.6.0 bits=64 build=4284de9902883ae9


Redis Server config




~/var/canvas$ sudo cp ./config/cache_store.yml.example ./config/cache_store.yml
~/var/canvas$ sudo vi ./config/cache_store.yml


Uncomment the cache_store: redis_store or add the following if there is no production section:




production:
cache_store: redis_store



~/var/canvas$ sudo cp ./config/redis.yml.example ./config/redis.yml
~/var/canvas$ sudo vi ./config/redis.yml


Uncomment the section below and add localhost




production:
servers:
# list of redis servers to use in the ring
- redis://localhost
# - redis://redis01


Secure Redis configs




~/var/canvas$ sudo chown canvasuser ./config/cache_store.yml
~/var/canvas$ sudo chmod 400 ./config/cache_store.yml
~/var/canvas$ sudo chown canvasuser ./config/redis.yml
~/var/canvas$ sudo chmod 400 ./config/redis.yml


Automated jobs installation




~/var/canvas$ sudo ln -s /var/canvas/script/canvas_init /etc/init.d/canvas_init
~/var/canvas$ sudo update-rc.d canvas_init defaults
~/var/canvas$ sudo /etc/init.d/canvas_init start


Finish




~$ sudo service apache2 restart








 



Troubleshooting



syntax error on line 13, col 0: `test:'



Found this was because I had an extra line in my redis.yml file that was uncommented. This came directly from the Amazon examples.




~/var/canvas$ sudo vi ./config/redis.yml
Comment:
database: 1


Permission denied @ unlink_internal - public/javascripts/client_apps/canvas_quizzes.js (Errno::EACCES)




~/var/canvas$ sudo chown -R www-data ./public/javascripts/


Login with local account after LDAP setup



Use URL:




https:///login/canvas


Jobs are not running



error: /var/canvas/vendor/bundle/ruby/2.1.0/gems/canvas-jobs-0.9.13/lib/delayed/settings.rb:34:in `read': Permission denied @ rb_sysopen - /var/canvas/config/delayed_jobs.yml (Errno::EACCES)




This is generally due to permissions not being set correctly on the config files and environment.rb file.  Passenger will choose the user to run the application based on the ownership settings of ./config/environment.rb.



First Try:




~/var/canvas/$ sudo chown canvasuser ./config/environment.rb


Also make sure the following is in place as well:




~/var/canvas$ sudo chown canvasuser ./config/*.yml
~/var/canvas$ sudo chown canvasuser ./config/cache_store.yml
~/var/canvas$ sudo chown canvasuser ./config/redis.yml


Passenger not running as correct user



1) make sure that you have the following in your apache config:




PassengerDefaultUser canvasuser



2) make sure that you have made canvasuser owner of /var/canvas/config.ru




~/var/canvas$ sudo chown canvasuser ./config.ru


We're sorry, but something went wrong.



When trying to go to the site, generally for the first time, if you encounter this error you can add a line to your apache config in order to get more error data to troubleshoot the (generally) passenger error.




~$ sudo vi /etc/apache2/sites-available/canvas.conf


Add the following in your virtual host config.  I've already included it in my virtual site conf example, but its commented out so simply uncomment it.




PassengerFriendlyErrorPages on


Restart and take a look at the error details




~$ sudo service apache2 restart


Permission denied @ rb_sysopen - /var/canvas/config/cache_store.yml (Errno::EACCES)



Assuming that you've turned on friendly error pages for passenger, look to see if passenger is running as the correct user:




HOME = /home/helpdesk
LOGNAME = helpdesk


If it does not say the canvas user you decided to use (generally www-data or canvasuser), like the above does not, then passenger will not run properly.

This can generally be due to a couple of things:




  1. You do not have the right file/folder ownership in place

  2. You do not have PassengerDefaultUser configured in apache



Go back over and make sure that /var/canvas/config.ru has ownership to the passenger user (in my case it was canvasuser)

Go back over and make sure that your Apache2 config contains PassengerDefaultUser canvasuser (in my case it was canvasuser)



测试安装 canvas lms 上线版本

admin 发表了文章 • 0 个评论 • 2159 次浏览 • 2016-11-08 15:18 • 来自相关话题

    1  cd /media     2  ls     3  cd umji ...查看全部
    1  cd /media

    2  ls

    3  cd umji

    4  ls

    5  cd KINGSTON/

    6  ls

    7  cp -r e1000e-3.3.4 `/

    8  cp -r e1000e-3.3.4 ~/

    9  cd

   10  ls

   11  cd e1000e-3.3.4/

   12  ls

   13  cd src/

   14  ls

   15  sudo make install

   16  sudo modprobe e1000e

   17  ifconfig

   18  df -lh

   19  sudo apt-get update && sudo apt-get -y upgrade && sudo apt-get -y autoremove

   20  cd

   21  sudo apt-get install -y postgresql-9.3

   22  sudo -u postgres createuser canvas -D -S -R -P

   23  sudo -u postgres createdb canvas_production --owner=canvas

   24  sudo -u postgres createdb canvas_queue_production --owner=canvas

   25  psql -h localhost -U canvas canvas_production

   26  sudo apt-get -y install git-core

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

   28  ls

   29  cd canvas

   30  ls

   31  git branch --set-upstream-to origin/stable

   32  sudo mkdir -p /var/canvas

   33  sudo chown -R $USER /var/canvas

   34  cp -rav /home/$USER/canvas/. /var/canvas

   35  cd /var/canvas

   36  sudo apt-get install -y software-properties-common

   37  sudo apt-add-repository ppa:brightbox/ruby-ng

   38  sudo apt-get update

   39  sudo apt-get install -y ruby2.1 ruby2.1-dev zlib1g-dev libxml2-dev

   40  sudo apt-get install -y libsqlite3-dev postgresql libpq-dev

   41  sudo apt-get install -y libxmlsec1-dev curl make g++

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

   43  sudo apt-get install -y nodejs

   44  sudo apt-get install -y npm

   45  sudo -u postgres createuser $USER

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

   47  ufw status

   48  sudo ufw status

   49  sudo gem install bundler --version 1.7.11

   50  bundle install --path vendor/bundle --without=sqlite mysql

   51  ruby -v

   52  sudo gem uninstall bundler --version 1.7.11

   53  sudo gem install bundler

   54  bundle install --path vendor/bundle --without=sqlite mysql

   55  sudo gem uninstall bundler --version 1.13.6

   56  sudo gem install bundler --version 1.13.3

   57  bundle install --path vendor/bundle --without=sqlite mysql

   58  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

   59  cp ./config/database.yml.example ./config/database.yml

   60  vi ./config/database.yml

   61  nano ./config/database.yml

   62  cp ./config/outgoing_mail.yml.example ./config/outgoing_mail.yml

   63  cp ./config/domain.yml.example ./config/domain.yml

   64  cp ./config/security.yml.example ./config/security.yml

   65  RAILS_ENV=production bundle exec rake db:initial_setup

   66  sudo adduser --disabled-password --gecos canvas canvasuser

   67  mkdir -p log tmp/pids public/assets public/stylesheets/compiled

   68  touch Gemfile.lock

   69  npm install

   70  cat npm-debug.log

   71  node -v

   72  sudo apt-get install nodejs

   73  sudo apt-get remove nodejs

   74  curl -sL https://deb.nodesource.com/setup_4.2 | sudo bash -

   75  curl -sL https://deb.nodesource.com/setup_4.2curl -sL https://deb.nodesource.com/setup_0.12 | sudo bash - | sudo bash -

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

   77  sudo apt-get install nodejs -v 4.4.4

   78  sudo apt-get install nodejs -version 4.4.4

   79  sudo apt-get install nodejs --version 4.4.4

   80  sudo apt-get install nodejs --version 4.4.7

   81  sudo reboot

   82  cd /var/canvas/

   83  ls

   84  npm install

   85  cd

   86  wget https://nodejs.org/download/release/v4.4.4/node-v4.4.4-linux-arm64.tar.gz

   87  ls

   88  tar -zxvf node-v4.4.4-linux-arm64.tar.gz

   89  ls

   90  cd node-v4.4.4-linux-arm64/

   91  ls

   92  cd bin

   93  ls

   94  cd ../

   95  ls

   96  cd lib

   97  ls

   98  cd ../

   99  ls

  100  cd bin

  101  ls

  102  ./npm install

  103  cd /var

  104  ls

  105  cd canvas/

  106  ls

  107  cd bin

  108  ls

  109  cd ../

  110  ls

  111  cd

  112  s

  113  ls

  114  cd node-v4.4.4-linux-arm64/

  115  ls

  116  cd lib/

  117  ls

  118  cd node_modules/

  119  ls

  120  cd npm/

  121  ls

  122  cd ../../

  123  ls

  124  cd /usr/local/

  125  ls

  126  cd bin

  127  ls

  128  cd

  129  ls

  130  cd node-v4.4.4-linux-arm64/

  131  ls

  132  cd ../

  133  ls

  134  sudo move node-v4.4.4-linux-arm64 /opt/

  135  sudo mv node-v4.4.4-linux-arm64 /opt/

  136  cd /opt

  137  ls

  138  cd node-v4.4.4-linux-arm64/

  139  ls

  140  cd bin

  141  ls

  142  sudo ln -s /opt/node-v4.4.4-linux-arm64/bin/node /usr/local/bin/node

  143  sudo ln -s /opt/node-v4.4.4-linux-arm64/bin/npm /usr/local/bin/npm

  144  cd

  145  cd /var

  146  ls

  147  cd canvas/

  148  ls

  149  npm install

  150  node -v

  151  cd /opt

  152  ls

  153  chmod -R 555 node-v4.4.4-linux-arm64

  154  cd /var/canvas/

  155  npm install

  156  cd /opt/

  157  ls

  158  cd node-v4.4.4-linux-arm64/

  159  ls

  160  cd bin

  161  ls

  162  ./node -v

  163  ./npm -v

  164  cd /var/canvas/

  165  sudo npm install

  166  curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -

  167  sudo apt-get install -y nodejs

  168  node -v

  169  cd /usr/local/bin

  170  ls

  171  rm -rf node

  172  sudo rm -f node

  173  sudo rm -f npm

  174  cd /var/canvas

  175  ls

  176  node -v

  177  sudo apt-get remove -y nodejs

  178  sudo apt-get install -y nodejs

  179  node -v

  180  whereis node

  181  cd /opt

  182  ls

  183  rm -rf node-v4.4.4-linux-arm64

  184  ls

  185  sudo rm -rf node-v4.4.4-linux-arm64

  186  whereis node

  187  node -v

  188  cd /var/canvas

  189  ls

  190  npm install

  191  RAILS_ENV=production bundle exec rake canvas:compile_assets

  192  npm uninstall

  193  nodejs -v

  194  rm -rf tmp/pids

  195  rm -rf public/assets

  196  rm -rf public/stylesheets/compiled

  197  ls

  198  npm install

  199  gem install

  200  gem install bunlde

  201  gem install bundle

  202  sudo gem install bundle

  203  cd ../

  204  ls

  205  rm -rf canvas

  206  sudo rm -rf canvas

  207  ls

  208  cd ~/canva

  209  cd ~/canvas

  210  ls

  211  cp -rav /home/$USER/canvas/. /var/canvas

  212  sudo cp -rav /home/$USER/canvas/. /var/canvas

  213  sudo mkdir -p /var/canvas

  214  sudo chown -R $USER /var/canvas

  215  cd /var

  216  ls

  217  ls -lh

  218  cd ca

  219  cd canvas/

  220  ls

  221  ruby -v

  222  sudo gem install bundler --version 1.13.3

  223  bundle install --path vendor/bundle --without=sqlite mysql

  224  history

  225  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

  226  cp ./config/database.yml.example ./config/database.yml

  227  nano ./config/database.yml

  228  cp ./config/outgoing_mail.yml.example ./config/outgoing_mail.yml

  229  cp ./config/domain.yml.example ./config/domain.yml

  230  cp ./config/security.yml.example ./config/security.yml

  231  mkdir -p log tmp/pids public/assets public/stylesheets/compiled

  232  touch Gemfile.lock

  233  npm -v

  234  nodejs -v

  235  bunlde -v

  236  npm install

  237  RAILS_ENV=production bundle exec rake canvas:compile_assets

  238  sudo chown canvasuser ./config/*.yml

  239  sudo chown canvasuser ./config/environment.rb

  240  sudo chmod 400 ./config/*.yml

  241  sudo chown -R canvasuser ./log/ ./tmp/ ./public/javascripts/ ./public/assets/ ./public/stylesheets/compiled/ ./Gemfile.lock ./config.ru

  242  sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 561F9B9CAC40B2F7

  243  sudo apt-get install -y apt-transport-https ca-certificates

  244  sudo sh -c 'echo deb https://oss-binaries.phusionpassenger.com/apt/passenger trusty main > /etc/apt/sources.list.d/passenger.list'

  245  sudo apt-get update

  246  sudo apt-get install -y passenger libapache2-mod-passenger apache2

  247  sudo a2enmod rewrite

  248  sudo service apache2 restart

  249  sudo a2enmod passenger

  250  sudo a2enmod ssl

  251  sudo service apache2 restart

  252  openssl genrsa -out server.key 2048

  253  openssl rsa -in server.key -out server.key.insecure

  254  openssl req -new -key server.key -out server.csr

  255  apache2 -v

  256  sudo a2dissite 000-default.conf

  257  sudo service apache2 reload

  258  sudo nano /etc/apache2/sites-available/canvas.conf

  259  nano ./config/domain.yml

  260  sudo nano ./config/domain.yml

  261  sudo apt-get update && sudo apt-get install -y libapache2-mod-xsendfile

  262  sudo a2enmod xsendfile

  263  sudo service apache2 restart

  264  cp ./config/environments/production.rb ./config/environments/production-local.rb

  265  nano ./config/environments/production-local.rb

  266  sudo nano /etc/apache2/sites-available/canvas.conf

  267  sudo service apache2 restart

  268  sudo nano /etc/hosts

  269  sudo apt-add-repository ppa:chris-lea/redis-server

  270  sudo apt-get update

  271  sudo apt-get -y install redis-server

  272  redis-cli info | grep redis_version

  273  sudo cp ./config/cache_store.yml.example ./config/cache_store.yml

  274  sudo nano ./config/cache_store.yml

  275  sudo cp ./config/redis.yml.example ./config/redis.yml

  276  sudo vi ./config/redis.yml

  277  sudo nano ./config/redis.yml

  278  sudo chown canvasuser ./config/cache_store.yml

  279  sudo chmod 400 ./config/cache_store.yml

  280  sudo chown canvasuser ./config/redis.yml

  281  sudo chmod 400 ./config/redis.yml

  282  sudo ln -s /var/canvas/script/canvas_init /etc/init.d/canvas_init

  283  sudo update-rc.d canvas_init defaults

  284  sudo /etc/init.d/canvas_init start

  285  sudo service apache2 restart

  286  ifconfig

  287  cd

  288  wget http://127.0.0.1

  289  nano index.html

  290  wget http://127.0.0.1:3000

  291  sudo nano /etc/hosts

  292  sudo service apache2 restart

  293  cd /etc/apache2/

  294  ls

  295  cd sites-available/

  296  ls

  297  sudo mv 000-default.conf 000-default.conf.bak

  298  ls

  299  sudo service apache2 restart

  300  ls

  301  nano canvas.conf

  302  cd ../

  303  ls

  304  nano apache2.conf

  305  cd /var/www/

  306  ls

  307  cd /etc/apache2/

  308  ls

  309  sudo nano apache2.conf

  310  cd sites-enabled/

  311  ls

  312  cd ../

  313  ls

  314  sudo nano apache2.conf

  315  sudo service apache2 restart

  316  ifconfig

  317  cd

  318  wget http://canvas.com

  319  ping canvas.com

  320  cd /var/canvas

  321  ls

  322  cd log

  323  ls

  324  nano production.log

  325  sudo nano production.log

  326  ls

  327  cd ../

  328  sudo chown canvasuser ./config.ru

  329  sudo vi /etc/apache2/sites-available/canvas.conf

  330  sudo nano /etc/apache2/sites-available/canvas.conf

  331  sudo service apache2 restart

  332  cd config

  333  ls

  334  nano cache_store.yml

  335  ls -lh

  336  cd ../

  337  ls

  338  chmod -R 777 *

  339  sudo chmod -R 777 *

  340  sudo service apache2 restart

  341  cd config

  342  nano cache_store.yml

  343  sudo service apache2 restart

  344  nano security.yml

  345  history

  346  cd /etc/apache2/

  347  ls

  348  cd sites-available/

  349  ls

  350  nano canvas.conf

  351  history


 

canvas安装实例记录

admin 发表了文章 • 0 个评论 • 2543 次浏览 • 2016-11-01 09:28 • 来自相关话题

ubuntu 14.04.1 计划安装canvas到/opt目录下,并给予了opt的777 权限,以免因为权限问题安装出错 创建普通用户 umji,设置密码 123456 ...查看全部

ubuntu 14.04.1



计划安装canvas到/opt目录下,并给予了opt的777 权限,以免因为权限问题安装出错



创建普通用户 umji,设置密码 123456



使用SSH远程登录服务器umji用户



$ cd /opt



$ curl -O https://raw.githubusercontent.com/FreedomBen/canvas-development-tools/master/CODES.sh



$ chmod +x CODES.sh



$ ./CODES.sh -i   //这一步是安装环境,我安装了1个小时


【最新】Ubuntu 14 LTS搭建canvas lms环境

admin 发表了文章 • 0 个评论 • 1923 次浏览 • 2016-10-31 09:28 • 来自相关话题

    创建个用户给自己的canvas用,然后进入这个用户家目录 # user ...查看全部

 





 


创建个用户给自己的canvas用,然后进入这个用户家目录



# useradd -d /opt/canvas canvas



# nano /etc/sudoers



# cd /opt



# mkdir canvas



# chown -R canvas:canvas /opt



# chmod -R 755 /opt



#su canvas



$ cd



 



# 第一步安装nodejs



$curl -sL https://deb.nodesource.com/setup_6.x | sudo bash -



$sudo apt-get install nodejs



 



 



# 接下来,就是安装ruby



$sudo apt-get install software-properties-common



$sudo add-apt-repository ppa:brightbox/ruby-ng



$sudo apt-get update



$sudo apt-get install ruby2.1 ruby2.1-dev



$sudo reboot



 



#Download the script:



$curl -O https://raw.githubusercontent.com/FreedomBen/canvas-development-tools/master/CODES.sh



 



#Make the script executable:



chmod +x CODES.sh



 



 



#找到刚才下载的CODES.sh,运行安装



./CODES.sh -i



 



 



#安装完了之后,开始克隆,过程中要选择一个盘符,我习惯放在opt,这个opt要给予global用户管理权限



./CODES.sh -c



 



 



$ cd /opt/canvas



$ bundle exec rails server -b 0.0.0.0



 



#端口映射,3000到80



$sudo iptables -t nat -A PREROUTING -p --dport 80 -j REDIRECT --to-port 3000



 



#用另一个机器访问你的服务器的IP去试试吧。


Linux新手安装之后遇到的一个问题

admin 发表了文章 • 0 个评论 • 1952 次浏览 • 2016-07-13 12:12 • 来自相关话题

按照站内教程安装完,启动server之后是这样的 waker36@ubuntu:~$ cd opt/canvas waker36@ubuntu:~/opt/canvas$ s ...查看全部

按照站内教程安装完,启动server之后是这样的



waker36@ubuntu:~$ cd opt/canvas



waker36@ubuntu:~/opt/canvas$ sudo bundle exec rails server



/var/lib/gems/2.1.0/gems/bundler-1.11.2/lib/bundler/shared_helpers.rb:78: warning: Insecure world writable dir /usr/local/bin in PATH, mode 040777



/var/lib/gems/2.1.0/gems/bundler-1.11.2/lib/bundler.rb:289: warning: Insecure world writable dir /var/lib/gems/2.1.0 in PATH, mode 040777



/var/lib/gems/2.1.0/gems/bundler-1.11.2/lib/bundler.rb:289: warning: Insecure world writable dir /var/lib/gems/2.1.0 in PATH, mode 040777



=> Booting Thin



=> Rails 4.0.13 application starting in development on http://0.0.0.0:3000



=> Run `rails server -h` for more startup options



=> Ctrl-C to shutdown server



Exiting



/var/lib/gems/2.1.0/gems/railties-4.0.13/lib/rails/application/configuration.rb:110:in `database_configuration': Could not load database configuration. No such file - /home/waker36/opt/canvas/config/database.yml (RuntimeError)



from /var/lib/gems/2.1.0/gems/activerecord-4.0.13/lib/active_record/railtie.rb:175:in `block (2 levels) in '



from /var/lib/gems/2.1.0/gems/activesupport-4.0.13/lib/active_support/lazy_load_hooks.rb:38:in `instance_eval'



from /var/lib/gems/2.1.0/gems/activesupport-4.0.13/lib/active_support/lazy_load_hooks.rb:38:in `execute_hook'



from /var/lib/gems/2.1.0/gems/activesupport-4.0.13/lib/active_support/lazy_load_hooks.rb:28:in `block in on_load'



from /var/lib/gems/2.1.0/gems/activesupport-4.0.13/lib/active_support/lazy_load_hooks.rb:27:in `each'



from /var/lib/gems/2.1.0/gems/activesupport-4.0.13/lib/active_support/lazy_load_hooks.rb:27:in `on_load'



from /var/lib/gems/2.1.0/gems/activerecord-4.0.13/lib/active_record/railtie.rb:174:in `block in '



from /var/lib/gems/2.1.0/gems/railties-4.0.13/lib/rails/initializable.rb:30:in `instance_exec'



from /var/lib/gems/2.1.0/gems/railties-4.0.13/lib/rails/initializable.rb:30:in `run'



from /var/lib/gems/2.1.0/gems/railties-4.0.13/lib/rails/initializable.rb:55:in `block in run_initializers'



from /usr/lib/ruby/2.1.0/tsort.rb:226:in `block in tsort_each'



from /usr/lib/ruby/2.1.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component'



from /usr/lib/ruby/2.1.0/tsort.rb:427:in `each_strongly_connected_component_from'



from /usr/lib/ruby/2.1.0/tsort.rb:347:in `block in each_strongly_connected_component'



from /usr/lib/ruby/2.1.0/tsort.rb:345:in `each'



from /usr/lib/ruby/2.1.0/tsort.rb:345:in `call'



from /usr/lib/ruby/2.1.0/tsort.rb:345:in `each_strongly_connected_component'



from /usr/lib/ruby/2.1.0/tsort.rb:224:in `tsort_each'



from /usr/lib/ruby/2.1.0/tsort.rb:205:in `tsort_each'



from /var/lib/gems/2.1.0/gems/railties-4.0.13/lib/rails/initializable.rb:54:in `run_initializers'



from /var/lib/gems/2.1.0/gems/railties-4.0.13/lib/rails/application.rb:215:in `initialize!'



from /var/lib/gems/2.1.0/gems/railties-4.0.13/lib/rails/railtie/configurable.rb:30:in `method_missing'



from /home/waker36/opt/canvas/config/environment.rb:11:in `'



from /var/lib/gems/2.1.0/gems/activesupport-4.0.13/lib/active_support/dependencies.rb:229:in `require'



from /var/lib/gems/2.1.0/gems/activesupport-4.0.13/lib/active_support/dependencies.rb:229:in `block in require'



from /var/lib/gems/2.1.0/gems/activesupport-4.0.13/lib/active_support/dependencies.rb:214:in `load_dependency'



from /var/lib/gems/2.1.0/gems/activesupport-4.0.13/lib/active_support/dependencies.rb:229:in `require'



from /home/waker36/opt/canvas/config.ru:3:in `block in



'

 



from /var/lib/gems/2.1.0/gems/rack-1.5.4/lib/rack/builder.rb:55:in `instance_eval'



from /var/lib/gems/2.1.0/gems/rack-1.5.4/lib/rack/builder.rb:55:in `initialize'



from /home/waker36/opt/canvas/config.ru:in `new'



from /home/waker36/opt/canvas/config.ru:in `



'

 



from /var/lib/gems/2.1.0/gems/rack-1.5.4/lib/rack/builder.rb:49:in `eval'



from /var/lib/gems/2.1.0/gems/rack-1.5.4/lib/rack/builder.rb:49:in `new_from_string'



from /var/lib/gems/2.1.0/gems/rack-1.5.4/lib/rack/builder.rb:40:in `parse_file'



from /var/lib/gems/2.1.0/gems/rack-1.5.4/lib/rack/server.rb:277:in `build_app_and_options_from_config'



from /var/lib/gems/2.1.0/gems/rack-1.5.4/lib/rack/server.rb:199:in `app'



from /var/lib/gems/2.1.0/gems/railties-4.0.13/lib/rails/commands/server.rb:48:in `app'



from /var/lib/gems/2.1.0/gems/rack-1.5.4/lib/rack/server.rb:314:in `wrapped_app'



from /var/lib/gems/2.1.0/gems/railties-4.0.13/lib/rails/commands/server.rb:75:in `start'



from /var/lib/gems/2.1.0/gems/railties-4.0.13/lib/rails/commands.rb:76:in `block in '



from /var/lib/gems/2.1.0/gems/railties-4.0.13/lib/rails/commands.rb:71:in `tap'



from /var/lib/gems/2.1.0/gems/railties-4.0.13/lib/rails/commands.rb:71:in `'



from /home/waker36/opt/canvas/bin/rails:9:in `require'



from /home/waker36/opt/canvas/bin/rails:9:in `'



from /var/lib/gems/2.1.0/gems/spring-1.7.2/lib/spring/client/rails.rb:28:in `load'



from /var/lib/gems/2.1.0/gems/spring-1.7.2/lib/spring/client/rails.rb:28:in `call'



from /var/lib/gems/2.1.0/gems/spring-1.7.2/lib/spring/client/command.rb:7:in `call'



from /var/lib/gems/2.1.0/gems/spring-1.7.2/lib/spring/client.rb:30:in `run'



from /var/lib/gems/2.1.0/gems/spring-1.7.2/bin/spring:49:in `'



from /var/lib/gems/2.1.0/gems/spring-1.7.2/lib/spring/binstub.rb:11:in `load'



from /var/lib/gems/2.1.0/gems/spring-1.7.2/lib/spring/binstub.rb:11:in `'



from /home/waker36/opt/canvas/bin/spring:16:in `require'



from /home/waker36/opt/canvas/bin/spring:16:in `'



from bin/rails:3:in `load'



from bin/rails:3:in `



'

 



 



 



在浏览器栏输入http://0.0.0.0:3000,不能连接到服务器。



是安装失败了吗?



求大神赐教。





canvas lms 测试版安装

admin 发表了文章 • 0 个评论 • 2276 次浏览 • 2016-05-20 15:55 • 来自相关话题

为了让各位体会到安装的过程,我把安装代码直接贴在下面   安装的过程是反反复复,很多组件需要到国外去获取,经常中断。每次安装都得10多个小时,也可能是我交大网络问题 ...查看全部

为了让各位体会到安装的过程,我把安装代码直接贴在下面



 



安装的过程是反反复复,很多组件需要到国外去获取,经常中断。每次安装都得10多个小时,也可能是我交大网络问题。



 



 




2 sudo apt-get install openssh-server


4  ps -e|grep ssh



5  gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3



6  curl -sSL https://get.rvm.io | bash -s stable



7  source ~/.bashrc



8  source ~/.bash_profile



9  rvm list known



10  rvm install 2.2.1



13  rvm use 2.2.1



14  rvm use 2.2.1 --default



15  rvm list



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



17  sudo apt-get install nodejs



24  sudo chmod -R 777 opt



30  curl -O https://raw.githubusercontent.com/FreedomBen/canvas-development-tools/master/CODES.sh



32  chmod +x CODES.sh



34  ./CODES.sh --full



35  cd /opt/canvas/



37  bundle install



40  ./CODES.sh -i



41  ./CODES.sh -c



43  sudo reboot



45  cd /opt



47  cd canvas/



49  bundle install



52  ./CODES.sh -c



53  rvm



54  rvm use



55  rvm use 2.2.1



56  source ~/.bashrc



57  source ~/.bash_profile



58  rvm use 2.2.1



59  ruby -v



61  ./CODES.sh -c



62  cd /opt/canvas/



64  bundle exec rails server



66  rvm list known



67  rvm install 2.2.1



68  rvm use 2.2.1



69  rvm use 2.2.1 --default



70  rvm list



71  bundle install



73  bundle install



75  bundle install



76  bundle install



78  bundle exec rails server



79  cd



80  ls



81  ./CODES.sh -i



82  ./CODES.sh -c



83  ./CODES.sh



84  ./CODES.sh -c



85  cd /opt/canvas/



87  bundle install



89  ./CODES.sh -c



90  cd /opt/



92  cd canvas/



94  bundle exec rails server


测试版本Canvas 在ubuntu平台上的搭建教程

admin 发表了文章 • 0 个评论 • 3682 次浏览 • 2016-05-19 10:20 • 来自相关话题

  更新于 2018.07.06     ...查看全部

 



更新于 2018.07.06



 



 



 



下载执行文件,安装docker环境



https://github.com/instructure/canvas-lms/blob/master/script/docker_dev_setup.sh



 



执行这个文件



./script/docker_dev_setup.sh



 



安装git



sudo apt-get install git



 



一旦在系统上安装了Git副本,获取Canvas的最新源代码就像从repo中检出代码一样简单,如下所示:



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



~$ cd canvas



~$ git checkout stable



 



安装ruby 2.4



$ sudo apt-get install software-properties-common



$ sudo add-apt-repository ppa:brightbox/ruby-ng



$ sudo apt-get update



 



$ sudo apt-get install ruby2.4 ruby2.4-dev zlib1g-dev libxml2-dev libsqlite3-dev postgresql-9.5 libpq-dev libxmlsec1-dev curl make g++



 



安装nodejs



$ curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -



$ sudo apt-get install -y nodejs build-essential



 



安装yarn



$ npm install -g yarn@1.7.0



 



sudo -u postgres createuser $USER



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



 



Canvas使用Bundler作为Ruby Gems之上的附加层来管理版本化的依赖项。Bundler很棒!



您可以使用Ruby Gems安装Bundler:



$ gem install bundler



 



安装依赖



安装Bundler后,请导航到Canvas应用程序根目录,您可以在其中使用Bundler安装所有Canvas依赖项。



~$ cd canvas



~/canvas$ bundle install



~/canvas$ npm install



 



Canvas默认配置



在我们在数据库中设置所有表之前,我们的Rails代码依赖于少量配置文件,这些配置文件附带了良好的示例设置,从Canvas树的根目录中,您可以输入默认配置值,如下所示:



 



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



 



动态设置配置



~/canvas$ cp config/dynamic_settings.yml.example config/dynamic_settings.yml



 



数据库配置



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



~/canvas$ createdb canvas_development



 



数据库初始化



~/canvas$ bundle exec rails db:initial_setup



创建测试数据库



psql -c 'CREATE USER canvas' -d postgres



psql -c 'ALTER USER canvas CREATEDB' -d postgres



createdb -U canvas canvas_test



psql -c 'GRANT ALL PRIVILEGES ON DATAbase canvas_test TO canvas' -d canvas_test



psql -c 'GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO canvas' -d canvas_test



psql -c 'GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA public TO canvas' -d canvas_test



RAILS_ENV=test bundle exec rails db:test:reset



 



Canvas需要先构建一些缓存才能正常工作。你需要运行:



~/canvas$ bundle exec rails canvas:compile_assets



 



延迟的队列任务服务



~/canvas$ bundle exec script/delayed_job run



 



 



都搞定后运行命令



~/canvas$ bundle exec rails server



 



 



浏览器访问:



http://localhost:3000/



 



 



提示:有时候它是需要2-5分钟才能启动起来。