Install Moodle di Centos8-Nginx-PHP7.4-Mariadb: Difference between revisions

From Dboswiki
Jump to navigation Jump to search
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:
Catatan yang belum diatur
=== Update Centos 8 ===
yum update -y


Install nginx
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 nginx -y


jika tidak jalan, perlu upgrade centos dengan scrip di bawah ini, kemudian install nginx lagi
dnf install openssh-server


sed -i -e "s|mirrorlist=|#mirrorlist=|g" /etc/yum.repos.d/CentOS-*
systemctl start sshd


sed -i -e "s|#baseurl=<nowiki>http://mirror.centos.org|baseurl=http://vault.centos.org|g</nowiki>" /etc/yum.repos.d/CentOS-*
systemctl enable sshd


sed -i -e "s|#baseurl=<nowiki>http://mirror.centos.org|baseurl=http://vault.centos.org|g</nowiki>" /etc/yum.repos.d/CentOS-*
=== '''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


===== 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 dengan
'''''untuk pastikan cek lagi denga'''''n


dnf module list php
dnf module list php


Install extensin 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


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 -y
systemctl enable --now php-fpm


Install maria DB
dnf install epel-release


Upgrade ke maria DB yang baru
=== Install maria DB ===
Secara default repository mariadb yang terinstal di centos8adalah mariadb 10.3, untuk moodle dibutuhkan minimal mariadb 10.4


vim /etc/yum.repos.d/MariaDB.repo
Maka kita update repositorynya dengan cara


<nowiki>#</nowiki> MariaDB 10.5 CentOS repository list - created 2020-08-21 23:57 UTC
'''nano /etc/yum.repos.d/MariaDB.repo'''


<nowiki>#</nowiki> <nowiki>http://downloads.mariadb.org/mariadb/repositories/</nowiki>
copy script di bawah ini, dan masukkan di MariaDB.repo


[mariadb]
''<nowiki>#</nowiki> MariaDB 10.5 CentOS repository list - created 2020-08-21 23:57 UTC''


name = MariaDB
''<nowiki>#</nowiki> <nowiki>http://downloads.mariadb.org/mariadb/repositories/</nowiki>''


baseurl = <nowiki>http://yum.mariadb.org/10.5/centos8-amd64</nowiki>
''[mariadb]''


module_hotfixes=1
''name = MariaDB''


gpgkey=<nowiki>https://yum.mariadb.org/RPM-GPG-KEY-MariaDB</nowiki>
''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


buat database
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 'Abcd1234';
CREATE USER 'moodle'@'localhost' IDENTIFIED BY 'moodle';


GRANT ALL ON moodle.* TO 'moodle'@'localhost' IDENTIFIED BY 'Abcd1234' WITH GRANT OPTION;
GRANT ALL ON moodle.* TO 'moodle'@'localhost' IDENTIFIED BY 'moodle' WITH GRANT OPTION;


FLUSH PRIVILEGES;
FLUSH PRIVILEGES;
Line 87: Line 114:
EXIT;
EXIT;


Install ssh server di centos
=== 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


dnf install openssh-server
'''Sipakan folder moodledata'''
 
cd /usr/share/nginx/h


systemctl start sshd
mkdir moodledata


systemctl enable sshd
chmod 777 moodledata/


systemctl status sshd
chown -R nginx:nginx moodledata/


Open the SSH port 22 to allow incoming traffic:
'''bikin vhost NGINX untuk moodle, misal di file:'''


<nowiki>#</nowiki> firewall-cmd --zone=public --permanent --add-service=ssh
nano /etc/nginx/conf.d/moodle.conf


<nowiki>#</nowiki> firewall-cmd --reload
isi dengan :


Download moodle sebagai manusia dan copy kan ke /usr/share/nginx/
server{


scp moodle-latest-401.zip [email protected]: /usr/share/nginx/
   listen 80;


cd /usr/share/nginx/
    server_name ip server;


Install unzip
    root        /usr/share/nginx/html/moodle;


dnf install unzip
    index       index.php;


unzip moodle-latest-401.zip
    location / {


chown -R nginx:nginx moodle
        try_files $uri $uri/ /index.php?$query_string;


chmod -R 755 moodle
    }


mkdir moodledata
    location ~ ^(.+\.php)(.*)$ {


        fastcgi_split_path_info ^(.+\.php)(.*)$;


chmod 777 moodledata/
        fastcgi_index           index.php;


        fastcgi_pass            php-fpm;


chown -R nginx:nginx moodledata/
        include                 /etc/nginx/mime.types;


        include                 fastcgi_params;


        fastcgi_param           PATH_INFO       $fastcgi_path_info;


        fastcgi_param           SCRIPT_FILENAME $document_root$fastcgi_script_name;


jika apache
}


}


dnf install php php-opcache php-gd php-curl php-mysqlnd






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