HS

Langkah-langkah Kerja

Written by

in

A. Alat dan Bahan

  • PC / Laptop Klien yang terkoneksi ke Jaringan Lab.
  • Web Browser (Chrome / Firefox).
  • Web Portal Proxmox VE Cluster (Akses Node: https://[IP-Node]:8006).
  • Portal DNS / Domain Management (Domain contoh: hanifu.my.id).

B. Langkah Kerja

1. Pembuatan LXC Container di Proxmox VE

  • Akses Proxmox VE di browser dan login menggunakan akun administrator.
  • Klik tombol Create CT pada pojok kanan atas.
  • Masukkan CT ID (contoh: 215) dan Hostname (contoh: wp-hs-15). Buat password untuk root.
  • Pada tab Template, pilih ubuntu-24.04-standard.
  • Pada tab Disks, alokasikan ukuran disk minimum 10 GB (Penyimpanan terpusat di NAS agar mendukung Live Migration).
  • Pada tab CPU & Memory, alokasikan 2-4 Core CPU dan Memory 2048 – 4096 MB.
  • Pada tab Network, isi IP Static: 10.10.10.215/24 (sesuaikan absen) dan Gateway: 10.10.10.254.
  • Selesaikan wizard, jalankan (Start) CT, dan buka menu Console.

💡 Troubleshooting: Jika Anda lupa password login Console Ubuntu, masuk ke Node Shell induk Proxmox, ketik pct enter 215, lalu ketik passwd root untuk mereset sandi tanpa mematikan server.

2. Instalasi LAMP Stack pada Ubuntu 24.04 (Server 2)

Jalankan perintah ini di dalam Console LXC:

Update sistem operasi:

Bash

apt update && apt upgrade -y

Instal Apache2, MariaDB, dan PHP 8.3:

Bash

apt install apache2 mariadb-server php8.3 libapache2-mod-php8.3 php8.3-mysql php8.3-curl php8.3-dom php8.3-mbstring php8.3-xml php8.3-zip php8.3-intl -y

Aktifkan modul rewrite Apache dan restart:

Bash

a2enmod rewrite
systemctl restart apache2

3. Konfigurasi Database MariaDB

Masuk ke sistem database:

Bash

mysql -u root -p

Buat database dan user untuk WordPress:

SQL

CREATE DATABASE wordpress_db DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'wp_user'@'localhost' IDENTIFIED BY 'PasswordSiswa123!';
GRANT ALL PRIVILEGES ON wordpress_db.* TO 'wp_user'@'localhost';
FLUSH PRIVILEGES;
EXIT;

4. Instalasi & Modifikasi Konfigurasi WordPress

Unduh dan letakkan WordPress ke direktori web:

Bash

cd /tmp
wget https://wordpress.org/latest.tar.gz
tar -xzvf latest.tar.gz
cp -r wordpress/* /var/www/html/

Atur kepemilikan dan hak akses direktori web:

Bash

chown -R www-data:www-data /var/www/html/
chmod -R 755 /var/www/html/

[KRUSIAL] Edit file konfigurasi WordPress agar tidak error di belakang Reverse Proxy:

Bash

cp /var/www/html/wp-config-sample.php /var/www/html/wp-config.php
nano /var/www/html/wp-config.php

Tambahkan kode pendeteksi HTTPS ini tepat sebelum baris “That’s all, stop editing”:

PHP

define('WP_HOME', 'https://hanifu.my.id');
define('WP_SITEURL', 'https://hanifu.my.id');

if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https') {
    $_SERVER['HTTPS'] = 'on';
}
if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
    $ips = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']);
    $_SERVER['REMOTE_ADDR'] = trim($ips[0]);
}

5. Konfigurasi Nginx Reverse Proxy & SSL (Server 1)

Langkah ini dilakukan di Server Nginx (10.10.10.6). Buat file konfigurasi Nginx:

Bash

nano /etc/nginx/sites-available/hanifu.my.id

Masukkan script berikut:

Nginx

server {
    listen 80;
    server_name hanifu.my.id;
    location / {
        proxy_pass http://10.10.10.215; 
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}

Symlink dan restart Nginx:

Bash

ln -s /etc/nginx/sites-available/hanifu.my.id /etc/nginx/sites-enabled/
systemctl restart nginx

Instal SSL Let’s Encrypt:

Bash

apt install certbot python3-certbot-nginx -y
certbot --nginx -d hanifu.my.id

C. Hasil Pengujian & Uji Akses

(Beri tanda centang/keterangan pada kolom Status)

NoParameter PengujianTarget URL / AksiStatus (Berhasil/Gagal)
1Akses Terminal LXC UbuntuConsole Proxmox (IP 10.10.10.215)
2Instalasi Paket LAMPphp -v dan mysql -V
3Akses Lokal Apache Web[http://10.10.10.215](http://10.10.10.215) (via curl lokal)
4Verifikasi Domain & DNSDomain hanifu.my.id mengarah ke IP Publik
5Akses Web via Internet[https://hanifu.my.id](https://hanifu.my.id) (Ada Ikon Gembok)
6Akses Dashboard Admin WP[https://hanifu.my.id/wp-admin](https://hanifu.my.id/wp-admin)

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *