MOODLE adalah paket perangkat lunak yang diproduksi untuk kegiatan belajar berbasis internet dan situs web yang menggunakan prinsip social constructionist pedagogy. Wikipedia
Masuk kedalam server ubuntu melalui ssh dengan putty, isikan ip address ubuntu server dan open/enter
Login / masuk sebagai root
ubuntu@ubuntuserver:~$ sudo su
ketik password
[sudo] password for ubuntu:
login berhasil sebagai root
root@ubuntuserver:/home/ubuntu#
Langkah Installasi
1. Install nginx
update paket
apt update
Install Nginx versi stabil sebagai web server
apt install nginx -y
start nginx
systemctl start nginx
Buat nginx menyala otomatis ketika server restart
systemctl enable nginx
2. Konfigurasi VirtualHost Nginx
File Nginx VirtualHost untuk situs Moodle ,File ini untuk mengatur letak direktori file web dan url pada situs moodle yang kita buat.
Kita akan menyimpan semua virtual host di direkori /etc/nginx/sites-available/ untuk mempermudah dalam mengelolanya.
membuat file VirtualHost baru dengan nama moodle di direktori /etc/nginx/sites-available.
Salin konten di bawah ini dan simpan ke dalam file moodle yang kita buat
nano /etc/nginx/sites-available/moodle
---------------------------------------------
server {
listen 80;
listen [::]:80;
root /var/www/moodle;
index index.php index.html index.htm;
server_name 192.168.1.25;
client_max_body_size 100M;
autoindex off;
location / {
try_files $uri $uri/ =404;
}
location /dataroot/ {
internal;
alias /var/www/moodledata/;
}
location ~ [^/].php(/|$) {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php8.1-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
-----------------------------------------
CtrlX lalu tekan Y dan Enter untuk simpan dan keluar.
Keterangan Baris berwarna Kuning
1. root /var/www/moodle; //adalah direktori installasi moodle, akan dibuat otomatis ketika menginstall moodle dalam direktori induk /var/www/
2.server_name 192.168.1.25; // adalah alamat ip server ubuntu sebagai server moodle
3. alias /var/www/moodledata/ // adalah direktori untuk moodledata yang akan kita buat nanti dilangkah 9 ketika installasi moodle
4.fastcgi_pass unix:/run/php/php8.1-fpm.sock; //sesuaikan versi php dengan versi php yang kalian install
Selanjutnya kita perlu untuk mengaktifkan situs baru dan merestart server Nginx.
mengaktifkan situs baru
ln -s /etc/nginx/sites-available/moodle /etc/nginx/sites-enabled/
restart server Nginx
systemctl restart nginx.service
jika berhasil maka akan ada file moodle didalam direktori /etc/nginx/sites-available/
3. Install Mariadb Database Server
apt-get install mariadb-server mariadb-client
Jawab Y jika ada pertanyaan saat installasi.
Selanjutnya ketik perintah untuk melakukan update, start layanan mariadb, menjalankan mariadb ketika server dinyalakan, mengatur password root di mariadb.
Jawab Y pada bagian pertanyaan,atau sesuaikan dengan kebutuhan.
apt update -y
systemctl start mariadb-server
systemctl enable mariadb
mysql_secure_installation
----------------------------------------------
Hit:1 http://id.archive.ubuntu.com/ubuntu jammy InRelease
Hit:2 http://id.archive.ubuntu.com/ubuntu jammy-updates InRelease
Hit:3 http://id.archive.ubuntu.com/ubuntu jammy-backports InRelease
Hit:4 http://id.archive.ubuntu.com/ubuntu jammy-security InRelease
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
55 packages can be upgraded. Run 'apt list --upgradable' to see them.
Failed to start mariadb-server.service: Unit mariadb-server.service not found.
Synchronizing state of mariadb.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable mariadb
------------------------------------------
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
In order to log into MariaDB to secure it, we'll need the current
password for the root user. If you've just installed MariaDB, and
haven't set the root password yet, you should just press enter here.
Enter current password for root (enter for none):
OK, successfully used password, moving on...
Setting the root password or using the unix_socket ensures that nobody
can log into the MariaDB root user without the proper authorisation.
You already have your root account protected, so you can safely answer 'n'.
Switch to unix_socket authentication [Y/n] y
Enabled successfully!
Reloading privilege tables..
... Success!
You already have your root account protected, so you can safely answer 'n'.
Change the root password? [Y/n] Y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
... Success!
By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
production environment.
Remove anonymous users? [Y/n] Y
... Success!
Normally, root should only be allowed to connect from 'localhost'. This
ensures that someone cannot guess at the root password from the network.
Disallow root login remotely? [Y/n] Y
... skipping.
By default, MariaDB comes with a database named 'test' that anyone can
access. This is also intended only for testing, and should be removed
before moving into a production environment.
Remove test database and access to it? [Y/n] Y
- Dropping test database...
... Success!
- Removing privileges on test database...
... Success!
Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.
Reload privilege tables now? [Y/n] Y
... Success!
Cleaning up...
All done! If you've completed all of the above steps, your MariaDB
installation should now be secure.
Thanks for using MariaDB!
apt install php-phpdbg php-fpm php-curl php-gd php-imap php-interbase php-intl php-ldap php-readline php-pspell php-tidy php-xmlrpc php-json php-sybase php-mysql php-opcache php-bz2 php-mbstring php-xml php-enchant php-gmp php-soap php-zip php-bcmath php-pdo -y
cek versi PHP
php --version
PHP 8.1.2-1ubuntu2.14 (cli) (built: Aug 18 2023 11:41:11) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.2, Copyright (c) Zend Technologies
with Zend OPcache v8.1.2-1ubuntu2.14, Copyright (c), by Zend Technologies
Start dan nyalakan otomatis PHP saat server booting
systemctl start php8.1-fpm
systemctl enable php8.1-fpm
Jika gagal ganti versi dengan versi PHP kalian, dan ulangi lagi
7. Atur dan edit PHP
nano /etc/php/8.1/fpm/php.ini
kita akan mengganti/edit bagian baris dibawah ini, baris ini sudah ada, tinggal kita cari dan ganti data/isi setelah tanda samadengan = ,
Cari Ctrl W : ketik yang akan kalian cari, misal memory_limit lalu ENTER
Sesuaikan dan ganti dengan data seperti dibawah.
date.timezone = "Asia/Jakarta"
post_max_size = 64M
upload_max_filesize = 64M
memory_limit = 512M
max_input_vars = 60000 // HILANGKAN TANDA ;
Restart php8.1-fpm
systemctl restart php8.1-fpm
8. Install Git
Git diperlukan untuk install/update Moodle, install Git
apt install git -y
9. Download Moodle
Masuk ke direktori /var/www/, Kemudian dengan Git, download Moodle
cd /var/www/
git clone git://git.moodle.org/moodle.git
Masuk kedalam direktori moodle
cd moodle
Selanjutnya cek daftar versi moodle terbaru
git branch -a
Kita akan menginstall versi moodle 403 terbaru yang cocok dengan versi nginx 8.0
git branch --track MOODLE_403_STABLE origin/MOODLE_403_STABLE
Ketik
git checkout MOODLE_403_STABLE
Buat direktori moodledata di dalam direktori /var/www/
mkdir -p /var/www/moodledata
Selanjutnya berikan akses permission direktori /var/www agar moodle bisa read/write
chown -R www-data:www-data /var/www/
chmod -R 755 /var/www/
chown www-data:www-data /var/www/moodledata
restart semua
systemctl restart mariadb.service
systemctl restart nginx
10. Install Moodle
Langkah berikutnya adalah install Moodle, proses install akan dilakukan melalui web browser pada komputer remote, buka chrome/firefox, ketik Ip Address server atau domain yang telah diatur, ex : 192.168.1.25, lalu enter.
tampilan installasi seperti gambar berikut
Database Driver type: MariaDB (native/mariadb)
Gambar Installasi Moodle 4
Database host : localhost
Database name : moodle // sesuaikan
Database user : ubuntu // sesuaikan
Database password : password // sesuaikan
Table prefix : mdl_
Database port : 3306
Unix socket: /run/mysqld/mysqld.sock
Next/ Lanjutkan
Gambar Installasi Moodle 6
Pastikan semua berstatus OK, Continue, tunggu loading untuk cek status sukses
Gambar Installasi Moodle 7
Klik Continue/Lanjutkan
General :
Username : admin //sesuaikan
New password : password //sesuaikan
First name : admin //sesuaikan
Last name : user //sesuaikan
email address : email @local.com //sesuaikan
City/town : kotaku //sesuaikan
Select country : Indonesia
Timezone : Asia/Bangkok //sesuaikan
Klik Update Profile
Gambar Installasi Moodle 9Selesai, Selamat anda telah berhasil membuat server Moodle..
Comments
Post a Comment