Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save gmram/74c3b7c7ec18fca8c03302d152a57c08 to your computer and use it in GitHub Desktop.
Save gmram/74c3b7c7ec18fca8c03302d152a57c08 to your computer and use it in GitHub Desktop.
Installing LearningLocker on CentOS 7.0

Fork from David Pease's method, with additional info on how to install MongoDB, and minor edits incorporating comments of other users in the original md file: https://gist.github.com/davidpesce/7d6e1b81594ecbc72311

#Prepare CentOS 7.0 Server for Learning Locker LRS

###Assumptions:

  • CentOS 7.0 x64 is installed (default install from DigitalOcean Droplet Manager)
  • Logged in via ssh key with root privileges
  • Using MongoDB as database

Install Remi Collet Repository:

rpm -Uvh http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-9.noarch.rpm
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm

Install Apache:

yum --enablerepo=remi install httpd

Install PHP and necessary PHP modules:

yum --enablerepo=remi,remi-php56 install php php-common php-cli php-pear php-mysqlnd php-pecl-mongo php-gd php-mbstring php-mcrypt php-xml

Install Mongodb

https://docs.mongodb.com/v3.0/tutorial/install-mongodb-on-red-hat/

nano /etc/yum.repos.d/mongodb-org-3.0.repo

Paste the following in the file:

[mongodb-org-3.0] name=MongoDB Repository baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.0/x86_64/ gpgcheck=0 enabled=1

Now update yum

yum update

Now install Mongodb yum install -y mongodb-org

Install NodeJs:

yum install nodejs

Install Node Package Manager (NPM):

yum install npm

Install Bower:

npm install -g bower

Install GIT:

yum install git

Install DeltaRPM:

yum install deltarpm

Update CentOS

yum update

Start the Firewall Daemon and enable automatic startup

systemctl start firewalld.service
systemctl enable firewalld.service

Allow HTTP Access through Firewall

firewall-cmd --permanent --zone=public --add-service=http
systemctl restart firewalld.service

Start Apache HTTP Daemon and enable automatic startup

systemctl start httpd.service
systemctl enable httpd.service

Start MongoDB and enable automatic startup

systemctl start mongod
systemctl enable mongod

Install Composer and set global launch

curl -sS https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer

Install git

yum install git

#Install and Configure LearningLocker

###Assumptions:

  • Commands are issued from LL installation directory
  • Using MongoDB as database cd /var/www ls

Clone LearningLocker via Git:

git clone https://github.com/LearningLocker/learninglocker.git learninglocker

Install LearningLocker

cd learninglocker
composer install

Create a new MongoDB database:

mongo
use learninglocker

Create MongoDB database user:

db.createUser({user:"username",pwd:"password",roles:["readWrite"]})
exit

Modify app/config/database.php with database credentials:

vi app/config/database.php

Finalize LL MongoDB setup:

php artisan migrate

Set Apache DocumentRoot and Directory Settings:

vi /etc/httpd/conf/httpd.conf
DocumentRoot "/var/www/learninglocker/public"
<Directory "/var/www/learninglocker/public">
  AllowOverride All
</Directory>

Restart Apache

systemctl restart httpd.service

Set ownership of directories to Apache

chown -R apache.apache /var/www/learninglocker

Adjust URL in app/config/app.php

Create encryption key php artisan key:generate

Adjust email settings in app/config/mail.php

Create your admin user at http://yoursite.com/register

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment