moodLearning Wiki

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
moodle-installation-notes [2020/09/15 01:44]
serbizadmin
moodle-installation-notes [2020/09/16 23:06] (current)
serbizadmin [Backup/Moving to Another Machine]
Line 1: Line 1:
 +{{ ::installing-moodle.jpg?600 |}}
 ~~NOTOC~~ ~~NOTOC~~
-Run these on screen so when you get cut off, you can just pick up from where you left off:+\\ 
 +\\ 
 +Run this command on screen every time you log in, so when you get cut off, you can just pick up from where you left off:
   screen -dR primecut   screen -dR primecut
 +
 +----
 +
 +Following the processes and commands below should enable you to run a fully functioning Moodle installation on a minimally endowed Ubuntu machine. 
 ====== Swap ====== ====== Swap ======
   fallocate -l 1G /swapfile1G   fallocate -l 1G /swapfile1G
Line 42: Line 49:
  
 ====== Moodle====== ====== Moodle======
-  sudo chown www-data:www-data -R /var/www/moodle+  sudo chown www-data:www-data -R /var/www/html/moodle
   sudo chmod 775 -R /var/www/html/moodle   sudo chmod 775 -R /var/www/html/moodle
  
Line 49: Line 56:
   sudo chown www-data:www-data -R  /var/moodledata   sudo chown www-data:www-data -R  /var/moodledata
  
-  cd /var/www/moodle/+  cd /var/www/html/moodle/
   sudo cp config-dist.php config.php   sudo cp config-dist.php config.php
   nano config.php   nano config.php
Line 76: Line 83:
 <VirtualHost *:80>  <VirtualHost *:80> 
 ServerAdmin [email protected] ServerAdmin [email protected]
-DocumentRoot /var/www/moodle/ +DocumentRoot /var/www/html/moodle/ 
 ServerName myrmoodle.prime.edu.ph  ServerName myrmoodle.prime.edu.ph 
-  <Directory /var/www/moodle/> +  <Directory /var/www/html/moodle/> 
   Options +FollowSymlinks    Options +FollowSymlinks 
   AllowOverride All    AllowOverride All 
Line 103: Line 110:
 <code> <code>
     Web address: [ your IP address or domain name ]     Web address: [ your IP address or domain name ]
-    Moodle directory: /var/www/moodle+    Moodle directory: /var/www/html/moodle
     Data Directory: /var/moodledata     Data Directory: /var/moodledata
 </code> </code>
Line 124: Line 131:
 ====== Backup/Moving to Another Machine ====== ====== Backup/Moving to Another Machine ======
   * Files to backup   * Files to backup
-   /var/moodledata +<code> 
-   /var/www/moodle+    /var/moodledata 
 +   /var/www/html/moodle
    [ db backup ]    [ db backup ]
-   +</code> 
 +  * To backup db 
 +<code> 
 + mysqldump -h localhost -u root --password=mypassword -C -Q -e --create-options moodle > moodle-database.sql 
 +</code> 
 +  * To restore db    
 +<code> 
 +mysql -u root -pmypassword moodle < moodle-database.sql 
 +</code>
    
 +====== Mailer ======
 +In case you don't have an email account that can be used to send out emails in bulk, you may also use the Moodle server itself as a send-only postfix mailer. 
 +   sudo apt install mailutils
 +If prompted for type of mail configuration, just choose Internet site. For the system mail name, it is important you key in your FQDN (fully qualified domain name), the one reflected on your rDNS, so something like
 +   mymoodlesite.prime.edu.ph
 + Once done, you may configure your postfix:
 +   nano /etc/postfix/main.cf
 +Replace the appropriate lines with these:
 +  inet_interfaces = loopback-only
 +  inet_protocols = ipv4
 +  mydestination = $myhostname, localhost.$mydomain, $mydomain
 +  sudo systemctl restart postfix
 +Once done, you may test your mailer with this:
 +   echo "Just testing the send-only postfix" | mail -s "Testing 1 2 3" <yourdestinationemailhere>
 +Note that the initial messages coming out of this server will be flagged as "spam". If you want it to be "perfect" right from the get-go, you need to know more about TXT records, SPF, DKIM, Amavis. Otherwise, your mails will get better over time.
 +
 +====== SSL Certificate======
 +Every site needs encryption these days. So you may install an SSL Certificate on your site. This section requires that you have a proper rDNS entry on your machine and your DNS points to your machine's IP with an A/AAAA record.
 +   sudo apt install snapd
 +   sudo snap install --classic certbot
 +   sudo certbot --apache
 +We recommend an autoredirect to the secure site.
 +Once done, confirm by adding S to your address in the "http". So something like httpS://mymoodlesite.prime.edu.ph