Skip to content

Instantly share code, notes, and snippets.

@afahitech
Created April 1, 2020 13:17
Show Gist options
  • Select an option

  • Save afahitech/8516c3cc0cffd70dfd014d12b821643b to your computer and use it in GitHub Desktop.

Select an option

Save afahitech/8516c3cc0cffd70dfd014d12b821643b to your computer and use it in GitHub Desktop.
Install LMS
# Install Apache
sudo apt update && sudo apt upgrade
sudo apt install apache2
sudo systemctl enable apache2
sudo service apache2 stop
sudo service apache2 start
sudo service apache2 restart
firefox http://localhost/
# IInstall MariaDB Database Server
sudo apt-get install mariadb-server mariadb-client
sudo mysql_secure_installation
sudo systemctl enable mariadb.service
sudo systemctl stop mariadb.service
sudo systemctl start mariadb.service
sudo systemctl restart mariadb.service
# Create Forma Database
sudo mysql -u root -p
CREATE DATABASE school DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
GRANT ALL ON school.* TO 'trainee'@'localhost' IDENTIFIED BY 'Da@y=001';
use school;
FLUSH PRIVILEGES;
EXIT;
# Install PHP 7.0 and Related Modules
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt update
sudo apt install php7.0 libapache2-mod-php7.0 php7.0-common php7.0-mysql php7.0-gmp php7.0-ldap php7.0-curl php7.0-intl php7.0-mbstring php7.0-xmlrpc php7.0-gd php7.0-bcmath php7.0-xml php7.0-cli php7.0-zip
# Configure Apache2
sudo nano /etc/php/7.0/apache2/php.ini
file_uploads = On
allow_url_fopen = On
short_open_tag = On
memory_limit = 256M
upload_max_filesize = 100M
max_execution_time = 360
date.timezone = America/Chicago
sudo systemctl restart apache2.service
sudo nano /var/www/html/phpinfo.php
# paste <?php phpinfo( ); ?>
# http://localhost/phpinfo.php
# Downloads & correct permissions for Forma
cd /tmp
wget -c "https://sourceforge.net/projects/forma/files/latest/download?source=files" -O formalms-v2.0.zip
sudo unzip -d /var/www/html/forma /tmp/formalms-v2.0.zip
sudo chown -R www-data:www-data /var/www/html/forma/
sudo chmod -R 755 /var/www/html/forma/
# Configure Apache2
sudo nano /etc/apache2/sites-available/forma.conf
# paste
<VirtualHost *:80>
ServerAdmin admin@example.com
DocumentRoot /var/www/html/forma/formalms
ServerName localhost
ServerAlias www.localhost.com
<Directory /var/www/html/forma/formalms/>
Options FollowSymlinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory /var/www/html/forma/formalms/>
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*) index.php [PT,L]
</Directory>
</VirtualHost>
sudo systemctl restart apache2.service
# Enable the Forma and Rewrite Module
sudo a2ensite forma.conf
sudo a2enmod rewrite
sudo systemctl restart apache2.service
https://localhost
After that Forma LMS should be installed and ready to use…
You will be prompted to download the config.php file and save in Forma root directory…
cd Downloads/
sudo cp ~/Downloads/config.php /var/www/html/forma/formalms/
Finally, delete the install folder.
sudo rm -rf /var/www/html/forma/formalms/install
https://localhost
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment