Skip to content

Instantly share code, notes, and snippets.

@ThinkLikeLinux
Last active Nov 16, 2020
Embed
What would you like to do?
Install Forma Learning Management System (LMS) On Ubuntu With Apache2, MariaDB And PHP
#!/bin/bash
#Install Apache2
sudo apt update
sudo apt install apache2
sudo systemctl start apache2.service
sudo systemctl enable apache2.service
sudo systemctl restart apache2.service
#Install MariaDB
sudo apt-get install mariadb-server mariadb-client
sudo systemctl start mariadb.service
sudo systemctl enable mariadb.service
sudo systemctl status mariadb.service
#Secure MariaDB
sudo mysql_secure_installation
#When prompted, answer the questions below by following the guide.
Enter current password for root (enter for none): Just press the Enter
#Now that MariaDB is installed, to test whether the database server was successfully installed
sudo mysql -u root -p
CREATE DATABASE sumaiya DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
GRANT ALL ON sumaiya.* TO 'sumaiya'@'localhost' IDENTIFIED BY 'Sumz1991*';
use sumaiya;
FLUSH PRIVILEGES;
EXIT;
sudo service mysql restart
#Install PHP 7.3 With Modules
sudo apt-get update && apt-get upgrade
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt-get 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
#Change PHP default configuration file for Apache2. The lines below is a good settings for most PHP based LMS… Update the configuration file with these and save
sudo gedit /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 = Bangladesh/Dhaka
#Now Save and Exit
sudo systemctl restart apache2.service
#Install PHPMyAdmin
sudo apt-get install phpmyadmin php-mbstring php-gettext -y
#Make sure to select No
#add this line "Include /etc/phpmyadmin/apache.conf" at /etc/apache2/apache2.conf
#/etc/init.d/apache2 restart
#Now Download Forma LMS Latest Release
cd /tmp
wget -c "https://netcologne.dl.sourceforge.net/project/forma/version-2.x/formalms-v2.3.0.2.zip" -O formalms-v2.3.0.2.zip
sudo unzip -d /var/www/html/forma /tmp/formalms-v2.3.0.2.zip
sudo chown -R www-data:www-data /var/www/html/forma/
sudo chmod -R 755 /var/www/html/forma/
#Configure Apache2 for FormaLMS
sudo nano /etc/apache2/sites-available/forma.conf
<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>
#Now save and Exit
#Enable the Forma and Rewrite Module
sudo a2ensite forma.conf
sudo a2enmod rewrite
sudo systemctl restart apache2.service
#Now finished the Installation Process. Visit you installed site.
http://localhost
#You will be prompted to download the config.php file and save in Forma root directory…
sudo cp ~/Downloads/config.php /var/www/html/forma/formalms/
#Now you can delete the install folder.
sudo rm -rf /var/www/html/forma/formalms/install
If u need Forma Learning Management System (LMS)related app setup Linux contact with me:
Telegram:@ThinkLikeLinux
email: thinklikelinux@gmail.com
WhatsApp:+8801309824364
Skype:live:.cid.bd73b6d4d960b474
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment