Skip to content
Snippets Groups Projects
Commit 4386a8eb authored by Ruben Rodriguez's avatar Ruben Rodriguez
Browse files

Corrections to canvas install script

parent 6f2b10a1
No related branches found
No related tags found
No related merge requests found
......@@ -40,27 +40,30 @@ sudo sh -c 'echo deb https://oss-binaries.phusionpassenger.com/apt/passenger bio
# Update lists and install dependencies
apt-get update
apt-get dist-upgrade
apt-get install nodejs ruby2.4 ruby2.4-dev zlib1g-dev libxml2-dev \
libsqlite3-dev postgresql libpq-dev \
libxmlsec1-dev curl make g++ yarn=1.10.1-1 postgresql-10\
passenger libapache2-mod-passenger apache2 python3-certbot-apache
libsqlite3-dev postgresql libpq-dev libxmlsec1-dev \
curl make g++ yarn=1.10.1-1 postgresql-10 passenger \
libapache2-mod-passenger apache2 python3-certbot-apache \
language-pack-en redis-server
update-locale LANG=en_US.UTF-8
# Configure database
cd /
DBPASS=$(pwgen 20 -n1)
su postgres -c "psql -c \"CREATE USER canvas WITH PASSWORD '$DBPASS';\""
su postgres -c 'createdb canvas_development --owner=canvas'
su postgres -c 'createdb canvas_production --owner=canvas'
su postgres -c 'createdb canvas_test --owner=canvas'
su postgres -l -c "psql -c \"CREATE USER canvas WITH PASSWORD '$DBPASS';\""
su postgres -l -c 'createdb canvas_development --owner=canvas'
su postgres -l -c 'createdb canvas_production --owner=canvas'
su postgres -l -c 'createdb canvas_test --owner=canvas'
# Install canvas from git
adduser canvas --system --home /srv/canvas --shell /bin/bash
cd /srv/canvas
su canvas -c 'git clone https://github.com/instructure/canvas-lms.git /srv/canvas'
su canvas -c 'git -C /srv/canvas checkout stable'
su canvas -l -c 'git clone https://github.com/instructure/canvas-lms.git /srv/canvas'
su canvas -l -c 'git -C /srv/canvas checkout stable'
for config in amazon_s3 dynamic_settings database \
delayed_jobs domain file_store outgoing_mail security external_migration; \
......@@ -70,13 +73,12 @@ su canvas -c "sed 's/your_password/$DBPASS/' -i /srv/canvas/config/database.yml"
su canvas -c "sed 's/12345/$(pwgen 50 -n1)/' -i /srv/canvas/config/security.yml"
gem install bundler -v 1.13.6
su -l canvas -c 'bundle install --path vendor/bundle'
su -l canvas -c 'yarn install --pure-lockfile && yarn install --pure-lockfile'
npm install -g coffee-script@1.6.2
su -l canvas -c 'bundle exec rails db:initial_setup'
su -l canvas -c 'bundle exec rails canvas:compile_assets'
su canvas -l -c 'RAILS_ENV=production bundle install --path vendor/bundle'
su canvas -l -c 'yarn install --pure-lockfile && yarn install --pure-lockfile'
su canvas -l -c 'RAILS_ENV=production bundle exec rails canvas:compile_assets'
su canvas -l -c 'RAILS_ENV=production bundle exec rails db:initial_setup'
# You can run this for testing
# su -l canvas -c 'bundle exec rails server'
......@@ -136,7 +138,6 @@ cat << EOF > /etc/apache2/sites-enabled/canvas.conf
CustomLog /var/log/apache2/canvas_ssl_access.log combined
SSLEngine on
BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown
# the following ssl certificate files are generated for you from the ssl-cert package.
SSLCertificateFile /etc/letsencrypt/live/$HOSTNAME/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/$HOSTNAME/privkey.pem
SetEnv RAILS_ENV production
......@@ -148,4 +149,6 @@ cat << EOF > /etc/apache2/sites-enabled/canvas.conf
</VirtualHost>
EOF
# Configure your email output by editing /srv/canvas/config/outgoing_mail.yml
service apache2 restart
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment