install IOMAD (Multi Tenant LMS) with nginx, MySQL, mariadb, php, phpmyadmin

 1. Install update for your Linux Ubuntu

            sudo apt update

2.  install ngnix

          sudo apt install nginx

3.  cmds to start, stop and restart nginx

        sudo systemctl stop nginx.service

        sudo systemctl start nginx.service

        sudo systemctl enable nginx.service

        sudo systemctl restart nginx.service

4. install mysql or mariadb 

        sudo apt-get install mariadb-server mariadb-client

                            or

        sudo apt-get install mysql-server mysql-client  

5.   cmds to start, stop and restart mariadb/mysql server

         sudo systemctl stop mariadb.service

        sudo systemctl start mariadb.service

        sudo systemctl enable mariadb.service

        sudo systemctl restart mariadb.service

6. secure your mariadb/mysql server by creating a root password and disallowing remote root access.

        sudo mysql_secure_installation

put the password if set or leave it


7. Now test the mariadb/mysql server installed or not 

        mysql -u root -p

        (type the password and hit enter)

8. create database for iomad and set the permission and privileges

        create database iomad DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

        GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, CREATE TEMPORARY TABLES, DROP, INDEX, ALTER ON iomad.* TO root@localhost;

        FLUSH PRIVILEGES;

        exit;

9.  go to the directory cd /var/www/html/ 

        make a folder and give permission

                sudo mkdir iomad

                sudo chmod -R 0777 iomad

10. go to the directory cd /var/www/

        make a folder and give permission

                sudo mkdir moodledata-iomad

                sudo chmod -R 0777 moodledata-iomad         

11. now we need to install iomad from Git or you can use sudo wget cmd to directly download the file and unzip it

        visit: https://github.com/iomad/iomad

        copy the file link: https://codeload.github.com/iomad/iomad/zip/IOMAD_38_STABLE

        sudo wget https://codeload.github.com/iomad/iomad/zip/IOMAD_38_STABLE

                    and file will be downloaded, unzip and rename it.

                    unzip IOMAD_38_STABLE   

                    sudo mv IOMAD_38_STABLE iomad

        you can keep or delete the zip file.

12. set the path and nginx sever config 

           cd /etc/nginx/sites-available/

        set this in the default file 

        location /iomad/ {                                                                                                                                              alias /var/www/html/iomad/;   

        

13. set your own server ip for nginx running

        sudo vi iomad

server {                                                                                                                                                            listen 8069 ;                                                                                                                                                   server_name 127.0.0.1/iomad; 

    root /home/superuser/development_hosting/demoserver/iomad/;                                                                                                     index index.html index.htm index.php index.nginx-debian.html;                                                                                                                                                                                                                                                                                                                                                                      location / {                                                                                                                                                         try_files $uri $uri/ /index.php?$args;                                                                                                                     }                                                                                                                                                                                                                                                                                                                           location ~ [^/]\.php(/|$ {                                                                                                                                          fastcgi_split_path_info  ^(.+\.php)(/.+)$;                                                                                                      fastcgi_index  index.php;                                                                                                                              fastcgi_pass  unix:/var/run/php/php7.4-fpm.sock; #Ubuntu 17.04                                                              include  fastcgi_params;                                                                                                                               fastcgi_param   PATH_INFO       $fastcgi_path_info;                                                                                   fastcgi_param   SCRIPT_FILENAME $document_root$fastcgi_script_name;                                  }                                                                                                                                                                   } 

     press :wq!

    save and exit.

14. install php and fpm for nginx to function proper

            sudo apt update

            sudo apt install php7.4-fpm php7.4-common php7.4-mbstring php7.4-xmlrpc php7.4-soap php7.4-gd php7.4-xml php7.4-intl php7.4-mysql php7.4-cli php7.4-zip php7.4-curl

            php -v  (check the version you installed)

            sudo vi /etc/php/7.4/fpm/php.ini      (php7.4 path)

15. install phpmyadmin 

        sudo apt install phpmyadmin

        Web server to reconfigure automatically: (leave it here, not our case, coz we using nginx)

        Configure database for phpmyadmin with dbconfig-common?   (put password)

        ==========(need to set the path for nginx and config)===========

        ==========(I'm using adminer inside iomad as plugin)==========

        save and restart the server and enable the website

            sudo ln -s /etc/nginx/sites-available/example.com.conf /etc/nginx/sites-enabled/

            sudo systemctl restart nginx.service

            sudo systemctl restart php7.2-fpm.service

16. visit the ip:port you are using and install iomad.

            had some issue in the default file inside /etc/nginx/sites-available

            careful with the braces and php settings 

        css and js were broken, folders, files error like babel-polyfill, mdn-polyfills, javascript.php, javascript-static.js, etc

        

Comments

Popular Posts