Install Moodle di Debian 12 Dengan Nginx

Update Repository dan Install Paket Yang Dibutuhkan

Ketikkan perintah berikut:

apt update && apt upgrade -y && apt install -y ca-certificates apt-transport-https software-properties-common gnupg2 curl sudo vim nano
echo "deb https://packages.sury.org/php/ bookworm main" | sudo tee /etc/apt/sources.list.d/sury-php.list
curl -fsSL  https://packages.sury.org/php/apt.gpg| sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/sury-keyring.gpg
apt update && apt install -y nginx mariadb-server php8.2 php8.2-{fpm,intl,gd,soap,curl,mbstring,zip,xml,mysql}


Download dan Persiapkan Moodle

Ketikkan perintah berikut:

cd /var/www
git clone -b MOODLE_405_STABLE git://git.moodle.org/moodle.git
chmod 755 -R /var/www
chown www-data:www-data -R /var/www


Konfigurasikan Cron Job

Ketikkan perintah berikut:

crontab -e
* * * * *    /usr/bin/php /path/to/moodle/admin/cli/cron.php >/dev/null


Konfigurasikan Database

Ketikkan perintah berikut:

mariadb -u root
CREATE DATABASE moodle DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
GRANT ALL PRIVILEGES ON moodle.* TO moodle@localhost IDENTIFIED BY 'moodle';
FLUSH PRIVILEGES;
EXIT;


Konfigurasikan Web Server

Edit file /etc/nginx/sites-enabled/default dan ganti menjadi menggunakan template berikut ini:

server { listen 80; root /var/www/moodle; index index.php index.html index.htm; location / { try_files $uri $uri/ /index.php?$query_string; } location /dataroot/ { internal; alias /var/www/moodledata; } location ~ [^/]\.php(/|$) { include snippets/fastcgi-php.conf; fastcgi_pass unix:/run/php/php-fpm.sock; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params;         fastcgi_read_timeout 3600;         fastcgi_send_timeout 3600;         fastcgi_connect_timeout 3600; } }


Konfigurasikan PHP

Ketikkan perintah berikut:

PHPINIPATH='/etc/php/8.2/fpm/php.ini' && mv $PHPINIPATH "$PHPINIPATH.bak" && echo "$(cat $PHPINIPATH.bak)
memory_limit = 256M upload_max_filesize = 80M post_max_size = 80M max_execution_time = 3600 max_input_time = 3600 cgi.fix_pathinfo = 0 date.timezone = Asia/Jakarta max_input_vars = 25000" > $PHPINIPATH


Restart Service

Ketikkan perintah berikut:

systemctl restart nginx
systemctl restart php8.2-fpm


Informasi Website Berdasarkan Installasi Di Atas

Database host:     localhost
Database name:     moodle
Database user:     moodle
Database password: moodle
Database port:     3306

Data Root:          /var/www/moodledata





























































































































































































Comments

Popular Posts