Skip to content

Commit 367f73f

Browse files
committed
Added moodle, odoo
1 parent 795d412 commit 367f73f

10 files changed

+675
-0
lines changed

moodle/moodle-cleanup.sh

+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
#!/bin/bash
2+
3+
RED='\033[1;31m'
4+
NC='\033[0m'
5+
6+
echo -e "${RED}
7+
################################################################################################################
8+
# Your MarketPlace App has been deployed successfully! #
9+
# Passwords are stored under /root/ #
10+
################################################################################################################
11+
${NC}"
12+
13+
echo
14+
echo -e "${RED}This message will be removed in the next login!${NC}"
15+
echo
16+
echo
17+
echo -e "${RED}The Mariadb root Password is $(cat /root/.mariadb_root_password)${NC}"
18+
echo
19+
echo
20+
echo -e "${RED}The Moodleadmin user Password is $(cat /root/.mariadb_moodleadmin_password)${NC}"
21+
echo
22+
echo
23+
24+
#To replace the Domain Name in the apache configuration
25+
a=0
26+
while [ $a -eq 0 ]
27+
do
28+
echo -e "${RED}To cancel setup, press Ctrl+C. This script will run again on your next login:${NC}"
29+
echo -e "${RED}Enter the domain name for your new Moodle site:${NC}"
30+
echo -e "${RED}(ex. example.org or test.example.org) do not include www or http/s:${NC}"
31+
read -p "Domain/Subdomain name: " dom
32+
if [ -z "$dom" ]
33+
then
34+
a=0
35+
echo -e "${RED}Please provide a valid domain or subdomain name to continue to press Ctrl+C to cancel${NC}"
36+
else
37+
a=1
38+
fi
39+
done
40+
41+
sed -i "s/learning.testprojects.me/$dom/g" /etc/apache2/conf-enabled/moodle.conf
42+
sed -i "s|example.com/moodle|$dom|g" /var/www/html/config.php
43+
44+
45+
46+
# restart apache2 service
47+
systemctl restart apache2
48+
49+
50+
#Cleanup script
51+
rm -rf /usr/local/src/
52+
mkdir -p /usr/local/src/
53+
rm -rf /var/lib/cloud/instances/*
54+
rm -rf /var/lib/cloud/data/*
55+
find /var/log -mtime -1 -type f -exec truncate -s 0 {} \; >/dev/null 2>&1
56+
rm -rf /var/log/*.gz /var/log/*.[0-9] /var/log/*-????????
57+
cat /dev/null > /var/log/lastlog; cat /dev/null > /var/log/wtmp
58+
apt-get -y autoremove >/dev/null 2>&1
59+
apt-get -y autoclean >/dev/null 2>&1
60+
rm -rf /root/.bashrc
61+
cp /etc/skel/.bashrc /root
62+
# rm -rf /opt/moodle
63+
cat /dev/null > /root/.bash_history
64+
unset HISTFILE
65+
history -c

moodle/moodle.conf

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<VirtualHost *:80>
2+
ServerName learning.testprojects.me
3+
ServerAlias www.learning.testprojects.me
4+
DocumentRoot /var/www/html/moodle
5+
6+
<Directory /var/www/html/moodle>
7+
Options -Indexes +FollowSymLinks +MultiViews
8+
AllowOverride All
9+
Require all granted
10+
</Directory>
11+
12+
<FilesMatch \.php$>
13+
SetHandler "proxy:unix:/run/php/php8.1-fpm.sock|fcgi://localhost/"
14+
</FilesMatch>
15+
16+
ErrorLog ${APACHE_LOG_DIR}/error.log
17+
CustomLog ${APACHE_LOG_DIR}/access.log combined
18+
</VirtualHost>

moodle/moodle.md

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
---
2+
title: Moodle
3+
sidebar_label: Moodle
4+
---
5+
6+
|**`Version Latest` `OS Ubuntu` `Learning`**| |
7+
|-------------------------------------------------------|--|
8+
9+
### Description
10+
11+
Moodle is the most widely used learning management system in the world. It is aimed to give learners, educators, and administrators with a single strong, secure, and integrated solution for creating customised learning environments as the top open source Learning Platform. This 1-Click app from Eummena, a Premium Moodle Partner, will allow you to start developing your online learning site on Stackbill in minutes!
12+
13+
### Software Included
14+
15+
- apache2
16+
- MariaDB latest
17+
- PHP 8.1
18+
- Certbot
19+
- Moodle
20+
21+
### Getting started after deploying moodle
22+
23+
24+
In addition to the Moodle Open Source Software installation, this 1-Click also:
25+
26+
Preinstalls the Certbot tool with the apache plugin.
27+
28+
Sets a MariaDB root password, protecting access outside the localhost (if you need to gain access to the root user, get the password from /root/.mariadb_root_password file or follow these instructions).
29+
30+
31+
### Accessing your Moodle instance
32+
33+
Once the deployment is complete, you will be able to access your Moodle instance at https://<your_domain_name>/.
34+
35+
36+
### Preparing your Moodle site for production
37+
38+
In order to use your Moodle for production, you must first configure a DNS entry with the fully qualified domain name (FQDN) to point to the IP of your Moodle. This way, you will have a proper URL for your Moodle site and you will also be able to enable https access (instead of the insecure http).
39+
40+
To proceed with these steps, you’ll need to log into the Droplet via SSH.
41+
42+
From a terminal on your local computer, connect to the Moodle as root:
43+
44+
~~~
45+
$ ssh root@public_ipv4
46+
Note: If you did not add an SSH key when you created the Droplet, you’ll first be prompted to reset your root password.
47+
48+
Then, to automatically apply Let's Encrypt SSL and enable https access for your Moodle droplet, use the pre-installed certbot tool. You will be asked to enter your domain name, make sure you enter your configured FQDN (for example: moodle.example.com). Enter y and your email address to finish the process and make sure to allow the tool to configure Apache automatically; enter y to force HTTPS rules to be applied!
49+
50+
# certbot --apache
51+
No names were found in your configuration files. Please enter in your domain
52+
name(s) (comma and/or space separated) (Enter 'c' to cancel):
53+
moodle.example.com
54+
...
55+
Do you wish to force HTTPS rewrite rule for this domain? [y/N]
56+
y
57+
~~~
58+
59+
After successfully completing these steps, you are now ready to proceed with Moodle installation on your browser. Just fire your browser at your FQDN and follow the instructions there. You will have to choose the MariaDB driver from the available options and enter the connection details for the database.

moodle/moodle.sh

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
3+
mkdir -p /usr/local/src/moodle
4+
5+
cd /usr/local/src/moodle && wget https://raw.githubusercontent.com/stackbill/marketplace/main/moodle/moodle-cleanup.sh
6+
7+
cd /usr/local/src/moodle && wget https://raw.githubusercontent.com/stackbill/marketplace/main/moodle/moodle.yaml
8+
9+
cd /usr/local/src/moodle && wget https://raw.githubusercontent.com/stackbill/marketplace/main/moodle/moodle.conf

0 commit comments

Comments
 (0)