Install Moodle 5.2 ubuntu 24.04-apache-mariadb-php8.4 dengan Git

From Dboswiki
Revision as of 14:18, 8 September 2026 by Smpdbos (talk | contribs)
Jump to navigation Jump to search
Cara install Moodle 5.2 menggunakan Git dapat dilakukan dengan mengklon repositori resmi Moodle dan memilih cabang versi stabil MOODLE_502_STABLE
cd /var/www/html
sudo git clone git://git.moodle.org/moodle.git moodle
cd moodle
sudo git checkout MOODLE_502_STABLE

Buat Direktori Data (moodledata)

sudo mkdir /var/www/moodledata
sudo chown -R www-data:www-data /var/www/moodledata
sudo chmod -R 777 /var/www/moodledata
sudo chown -R www-data:www-data /var/www/html/moodle

# ---------- REPOSITORY PHP 8.4 ----------

apt install -y software-properties-common ca-certificates \

   lsb-release apt-transport-https gnupg2 curl wget git unzip \
   openssl

add-apt-repository ppa:ondrej/php -y apt update

  1. ---------- APACHE + PHP 8.4 ----------

apt install -y apache2 \

   libapache2-mod-php8.4 \
   php8.4 \
   php8.4-cli \
   php8.4-common \
   php8.4-mysql \
   php8.4-xml \
   php8.4-curl \
   php8.4-zip \
   php8.4-gd \
   php8.4-intl \
   php8.4-mbstring \
   php8.4-soap \
   php8.4-bcmath \
   php8.4-ldap \
   php8.4-opcache \
   php8.4-readline \
   php8.4-apcu
  1. ---------- DATABASE ----------

apt install -y mariadb-server mariadb-client

Restart & Enable

sudo systemctl start mariadb sudo systemctl enable mariadb Secure Installation

sudo mysql_secure_installation Enter current password for root (enter for none): Set root password? [Y/n] y New password: Re-enter new password: Remove anonymous users? [Y/n] y Disallow root login remotely? [Y/n] y Remove test database and access to it? [Y/n] y Reload privilege tables now? [Y/n] y

Kalau hanya Latihan Password root 123456

  1. mysql -u root -p123456

create database moodle; ALTER DATABASE moodle charset=utf8mb4; ALTER DATABASE moodle CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci; grant ALL on moodle.* to root@localhost; grant ALL on moodle.* to moodle@localhost identified by "moodle"; grant ALL on moodle.* to moodle identified by "moodle"; exit service mysqld start service mysqld restart

4. Konfigurasi Apache Virtual Host

Moodle versi 5.x mengharuskan document root diarahkan ke subfolder /public demi keamanan. Buat file konfigurasi baru

sudo nano /etc/apache2/sites-available/moodle.conf

<VirtualHost *:80>

   ServerName localhost
   # PENTING: Arahkan ke folder /public untuk Moodle 5.x
   DocumentRoot /var/www/html/moodle/public
   <Directory /var/www/html/moodle/public>
       Options Indexes FollowSymLinks MultiViews
       AllowOverride All
       Require all granted
   </Directory>
   ErrorLog ${APACHE_LOG_DIR}/moodle_error.log
   CustomLog ${APACHE_LOG_DIR}/moodle_access.log combined

</VirtualHost>

Aktifkan konfigurasi situs baru tersebut dan muat ulang Apache:

sudo a2ensite moodle.conf sudo a2dissite 000-default.conf sudo a2enmod rewrite sudo systemctl restart apache2


5. Selesaikan Instalasi Lewat Browser