Install Moodle di Centos8-Nginx-PHP7.4-Mariadb: Difference between revisions
Created page with "Catatan yang belum diatur Install nginx dnf install nginx -y jika tidak jalan, perlu upgrade centos dengan scrip di bawah ini, kemudian install nginx lagi sed -i -e "s|mir..." |
No edit summary |
||
| Line 1: | Line 1: | ||
=== Update Centos 8 === | |||
yum update -y | |||
Install | sed -i -e "s|mirrorlist=|#mirrorlist=|g" /etc/yum.repos.d/CentOS-* | ||
sed -i -e "s|#baseurl=<nowiki>http://mirror.centos.org|baseurl=http://vault.centos.org|g</nowiki>" /etc/yum.repos.d/CentOS-* | |||
=== Install software pendukung === | |||
dnf install nano | |||
dnf install unzip | |||
dnf install openssh-server | |||
systemctl start sshd | |||
systemctl enable sshd | |||
=== '''Install nginx''' === | |||
dnf install nginx -y | |||
systemctl start nginx | systemctl start nginx | ||
| Line 17: | Line 26: | ||
systemctl status nginx | systemctl status nginx | ||
Install PHP 7.4 | === '''Install PHP 7.4''' === | ||
===== Update Repiository ===== | |||
dnf install dnf-utils <nowiki>http://rpms.remirepo.net/enterprise/remi-release-8.rpm</nowiki> | dnf install dnf-utils <nowiki>http://rpms.remirepo.net/enterprise/remi-release-8.rpm</nowiki> | ||
jika ada masalah | '''''jika ada masalah''''' | ||
dnf install dnf-utils <nowiki>http://rpms.remirepo.net/enterprise/remi-release-8.rpm</nowiki> --skip-broken | dnf install dnf-utils <nowiki>http://rpms.remirepo.net/enterprise/remi-release-8.rpm</nowiki> --skip-broken | ||
lihat yang terinstal | '''''lihat yang terinstal''''' | ||
dnf module list php | dnf module list php | ||
'''''aktifkan PHP7.4''''' | |||
dnf module reset php | dnf module reset php | ||
| Line 35: | Line 45: | ||
dnf module enable php:7.4 | dnf module enable php:7.4 | ||
untuk pastikan cek lagi | '''''untuk pastikan cek lagi denga'''''n | ||
dnf module list php | dnf module list php | ||
Install | ===== Install extension php 7.4 ===== | ||
dnf install php php-ldap php-xml php-soap php-xmlrpc php-mbstring php-json php-gd php-curl php-zip php-common php-fpm php php-opcache php-curl php-mysqlnd php-intl | |||
systemctl enable --now php-fpm | |||
dnf install epel-release | |||
=== Install maria DB === | |||
Secara default repository mariadb yang terinstal di centos8adalah mariadb 10.3, untuk moodle dibutuhkan minimal mariadb 10.4 | |||
Maka kita update repositorynya dengan cara | |||
'''nano /etc/yum.repos.d/MariaDB.repo''' | |||
copy script di bawah ini, dan masukkan di MariaDB.repo | |||
''<nowiki>#</nowiki> MariaDB 10.5 CentOS repository list - created 2020-08-21 23:57 UTC'' | |||
''<nowiki>#</nowiki> <nowiki>http://downloads.mariadb.org/mariadb/repositories/</nowiki>'' | |||
''[mariadb]'' | |||
''name = MariaDB'' | |||
''baseurl = <nowiki>http://yum.mariadb.org/10.5/centos8-amd64</nowiki>'' | |||
gpgcheck=1 | ''module_hotfixes=1'' | ||
''gpgkey=<nowiki>https://yum.mariadb.org/RPM-GPG-KEY-MariaDB</nowiki>'' | |||
''gpgcheck=1'' | |||
kemudian keluar dari nano dan mulai install mariadb | |||
dnf install MariaDB-server -y | dnf install MariaDB-server -y | ||
| Line 70: | Line 89: | ||
systemctl status mariadb |grep Active | systemctl status mariadb |grep Active | ||
'''Secure instalation maridb''' | |||
mysql_secure_installation | mysql_secure_installation | ||
Pilih no jika minta rubah socket | |||
Sisanya pilih yes | |||
'''Buat database Moodle''' | |||
mysql -u root -p | mysql -u root -p | ||
| Line 79: | Line 106: | ||
CREATE DATABASE moodle; | CREATE DATABASE moodle; | ||
CREATE USER 'moodle'@'localhost' IDENTIFIED BY ' | CREATE USER 'moodle'@'localhost' IDENTIFIED BY 'moodle'; | ||
GRANT ALL ON moodle.* TO 'moodle'@'localhost' IDENTIFIED BY ' | GRANT ALL ON moodle.* TO 'moodle'@'localhost' IDENTIFIED BY 'moodle' WITH GRANT OPTION; | ||
FLUSH PRIVILEGES; | FLUSH PRIVILEGES; | ||
| Line 87: | Line 114: | ||
EXIT; | EXIT; | ||
Install | === Install Moodle === | ||
'''Download moodle sebagai manusia dan copy kan ke /usr/share/nginx/html''' | |||
scp moodle-latest-401.zip [email protected]: /usr/share/nginx/html | |||
cd /usr/share/nginx/html | |||
unzip moodle-latest-401.zip | |||
chown -R nginx:nginx moodle | |||
chmod -R 777 moodle | |||
'''Sipakan folder moodledata''' | |||
cd /usr/share/nginx/h | |||
mkdir moodledata | |||
chmod 777 moodledata/ | |||
chown -R nginx:nginx moodledata/ | |||
'''bikin vhost NGINX untuk moodle, misal di file:''' | |||
nano /etc/nginx/conf.d/moodle.conf | |||
isi dengan : | |||
server{ | |||
listen 80; | |||
server_name ip server; | |||
root /usr/share/nginx/html/moodle; | |||
index index.php; | |||
location / { | |||
try_files $uri $uri/ /index.php?$query_string; | |||
} | |||
location ~ ^(.+\.php)(.*)$ { | |||
fastcgi_split_path_info ^(.+\.php)(.*)$; | |||
fastcgi_index index.php; | |||
fastcgi_pass php-fpm; | |||
include /etc/nginx/mime.types; | |||
include fastcgi_params; | |||
fastcgi_param PATH_INFO $fastcgi_path_info; | |||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |||
} | |||
} | |||
Setting PHP.ini untuk mengatur maxtime,max upload dll | '''Setting PHP.ini untuk mengatur maxtime,max upload dll''' | ||
cd /etc | cd /etc | ||
nano php.ini | nano php.ini | ||
Revision as of 16:31, 11 February 2023
Update Centos 8
yum update -y
sed -i -e "s|mirrorlist=|#mirrorlist=|g" /etc/yum.repos.d/CentOS-*
sed -i -e "s|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g" /etc/yum.repos.d/CentOS-*
Install software pendukung
dnf install nano
dnf install unzip
dnf install openssh-server
systemctl start sshd
systemctl enable sshd
Install nginx
dnf install nginx -y
systemctl start nginx
systemctl status nginx
Install PHP 7.4
Update Repiository
dnf install dnf-utils http://rpms.remirepo.net/enterprise/remi-release-8.rpm
jika ada masalah
dnf install dnf-utils http://rpms.remirepo.net/enterprise/remi-release-8.rpm --skip-broken
lihat yang terinstal
dnf module list php
aktifkan PHP7.4
dnf module reset php
dnf module enable php:7.4
untuk pastikan cek lagi dengan
dnf module list php
Install extension php 7.4
dnf install php php-ldap php-xml php-soap php-xmlrpc php-mbstring php-json php-gd php-curl php-zip php-common php-fpm php php-opcache php-curl php-mysqlnd php-intl
systemctl enable --now php-fpm
dnf install epel-release
Install maria DB
Secara default repository mariadb yang terinstal di centos8adalah mariadb 10.3, untuk moodle dibutuhkan minimal mariadb 10.4
Maka kita update repositorynya dengan cara
nano /etc/yum.repos.d/MariaDB.repo
copy script di bawah ini, dan masukkan di MariaDB.repo
# MariaDB 10.5 CentOS repository list - created 2020-08-21 23:57 UTC
# http://downloads.mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.5/centos8-amd64
module_hotfixes=1
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
kemudian keluar dari nano dan mulai install mariadb
dnf install MariaDB-server -y
systemctl start mariadb
systemctl status mariadb |grep Active
Secure instalation maridb
mysql_secure_installation
Pilih no jika minta rubah socket
Sisanya pilih yes
Buat database Moodle
mysql -u root -p
CREATE DATABASE moodle;
CREATE USER 'moodle'@'localhost' IDENTIFIED BY 'moodle';
GRANT ALL ON moodle.* TO 'moodle'@'localhost' IDENTIFIED BY 'moodle' WITH GRANT OPTION;
FLUSH PRIVILEGES;
EXIT;
Install Moodle
Download moodle sebagai manusia dan copy kan ke /usr/share/nginx/html
scp moodle-latest-401.zip [email protected]: /usr/share/nginx/html
cd /usr/share/nginx/html
unzip moodle-latest-401.zip
chown -R nginx:nginx moodle
chmod -R 777 moodle
Sipakan folder moodledata
cd /usr/share/nginx/h
mkdir moodledata
chmod 777 moodledata/
chown -R nginx:nginx moodledata/
bikin vhost NGINX untuk moodle, misal di file:
nano /etc/nginx/conf.d/moodle.conf
isi dengan :
server{
listen 80;
server_name ip server;
root /usr/share/nginx/html/moodle;
index index.php;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ ^(.+\.php)(.*)$ {
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_index index.php;
fastcgi_pass php-fpm;
include /etc/nginx/mime.types;
include fastcgi_params;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}
Setting PHP.ini untuk mengatur maxtime,max upload dll
cd /etc
nano php.ini