Go to file
2020-05-25 11:31:30 +02:00
.gitignore Initial commit 2020-05-25 11:31:30 +02:00
README.install Initial commit 2020-05-25 11:31:30 +02:00

# ===================
# Install Moodle
# 
# see:
#    - https://docs.moodle.org/38/en/Installation_quick_guide
#    - https://docs.moodle.org/38/en/Installing_Moodle
#
# Requirements:
#
#    - NGINX Web Service is installed
#    - MySQL Service is installed
#    - lets encrypt certificates available for $FQHN_HOSTNAME
#
# ===================

FQHN_HOSTNAME="moodle.oopen.de"

# ---
# 0.) Requirements
# ---

# Install Nginx Webserver
#
cd /usr/local/src/nginx
./install_nginx.sh

# Install update mechanism for lets encrypt certificates
#
cd /usr/local/src/dehydrated-cron
./install_dehydrated.sh

# Create certificate(s)
#
# Adjust '/var/lib/dehydrated/domains.txt'
#
# vim /var/lib/dehydrated/domains.txt
#
cat <<EOF >> /var/lib/dehydrated/domains.txt
$FQHN_HOSTNAME
EOF
/var/lib/dehydrated/cron/dehydrated_cron.sh


# ---
# 0.1) Requirements MySQL Database Service
# ---

# Install MySQL Database Service
#
cd /tmp

# See at 'https://dev.mysql.com/downloads/repo/apt/' which is the 
# actual version of the apt-repository
#
mysql_apt_version=0.8.15-1
wget https://dev.mysql.com/get/mysql-apt-config_${mysql_apt_version}_all.deb
dpkg -i mysql-apt-config_${mysql_apt_version}_all.deb

apt-get update
apt-get install mysql-server



# ---
# Creating Moodle database
# ---

# These are the steps to create an empty Moodle database. Substitute your 
# own database name, user name and password as appropriate.
#
# The instructions assume that the web server and MySQL server are on the 
# same machine. In this case the 'dbhost' is 'localhost'. If they are on 
# different machines substitute the name of the web server for 'localhost' 
# in the following instructions and the 'dbhost' setting will be the name
# of the database server. Databases have a "Character set" and a "Collation".
# For Moodle, we recommend the Character Set be set to utf8mb4 and the 
# Collation utf8mb4_unicode_ci. You may get the option to set these values 
# when you create the database. If you are not given a choice, the default 
# options are probably good. An install on an old server may have the wrong 
# settings.


# db_name: moodle
# db_user: moodleuser
# db_pass: 3wSF.XTC+L9Z


# Command line

#    To create a database using the 'mysql' command line client, first log into MySQL

$ mysql -u root -p
Enter password: 

# (Enter the password you previously set - or been given - for the MySQL 'root' user). 
# After some pre-amble this should take you to the mysql> prompt.


#    Create a new database (called 'moodle' - substitute your own name if required).

# If you have successfully configured the recommended full UTF-8 support as described above run:

mysql> CREATE DATABASE moodle DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

# If you do not have the recommended full UTF-8 support run:

mysql> CREATE DATABASE moodle DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;


#    Add a user/password with the minimum needed permissions:

mysql> GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,CREATE TEMPORARY TABLES,DROP,INDEX,ALTER ON moodle.* TO moodleuser@localhost IDENTIFIED BY 'yourpassword';

# ...which creates a user called 'moodleuser' with a password 'yourpassword'. 
# Make sure you invent a strong password and resist the temptation to 'GRANT ALL'.


#    Exit from mysql:

mysql> quit


admin user:  chris
admin pass:  EadGl15E.%
admin email: argus@oopen.de