Langsung ke konten utama

Instalasi dan Konfigurasi LAMP Stack untuk Menjalankan WordPress di AlmaLinux

 


Panduan Instalasi LAMP + WordPress 

Versi ini ditata ulang total dengan desain clean putih-biru agar terlihat profesional dan tidak mirip sumber lain.

1. Persiapan Sistem

Update Sistem
sudo dnf update -y

Melakukan pembaruan paket agar sistem stabil dan kompatibel.

Install LAMP Stack
sudo dnf install httpd mariadb-server mariadb php php-mysqlnd php-fpm -y
  • httpd → Apache Web Server
  • mariadb-server → Server database
  • php & php-mysqlnd → PHP & driver MariaDB
  • php-fpm → Handler PHP berbasis FastCGI
Aktifkan Layanan
sudo systemctl enable --now httpd
sudo systemctl enable --now mariadb
sudo systemctl enable --now php-fpm

2. Konfigurasi MariaDB

Amankan MariaDB
sudo mysql_secure_installation
Buat Database & User
CREATE DATABASE wordpress CHARACTER SET utf8mb4;
CREATE USER 'wpuser'@'localhost' IDENTIFIED BY 'wpuser123';
GRANT ALL PRIVILEGES ON wordpress.* TO 'wpuser'@'localhost';
FLUSH PRIVILEGES;
Jika user sudah ada
ALTER USER 'wpuser'@'localhost' IDENTIFIED BY 'wpuser123';
FLUSH PRIVILEGES;

3. Upload & Ekstrak WordPress

sudo mv latest.tar.gz /var/www/
cd /var/www
sudo tar -xvzf latest.tar.gz
sudo chown -R apache:apache wordpress
sudo chmod -R 755 wordpress
Jika ada instalasi lama:
sudo mv /var/www/wordpress /var/www/wordpress_old

4. Konfigurasi Apache

Contoh Virtual Host:
<VirtualHost *:80>
  ServerName 123.456.789.101
  DocumentRoot /var/www/wordpress

  <Directory /var/www/wordpress>
    AllowOverride All
    Require all granted
  </Directory>

  ErrorLog /var/log/httpd/wordpress_error.log
  CustomLog /var/log/httpd/wordpress_access.log combined
</VirtualHost>
Aktifkan mod_rewrite
sudo dnf install mod_rewrite -y
sudo systemctl restart httpd

5. Konfigurasi PHP-FPM

sudo nano /etc/php-fpm.d/www.conf

Pastikan isinya:

listen = /run/php-fpm/www.sock
listen.owner = apache
listen.group = apache
listen.mode = 0660
user = apache
group = apache

Tambahkan handler PHP:

<FilesMatch \.php$>
  SetHandler "proxy:unix:/run/php-fpm/www.sock|fcgi://localhost/"
</FilesMatch>

6. SELinux & Firewall

sudo chcon -R -t httpd_sys_rw_content_t /var/www/wordpress
sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --permanent --add-service=https
sudo firewall-cmd --reload

7. Troubleshooting

Masalah Penyebab Solusi
Service Unavailable Apache tidak terhubung dengan PHP-FPM Periksa socket & pastikan php-fpm berjalan
Error DB Connection User / password salah Cek wp-config.php & akses MariaDB
Forbidden Permission atau SELinux Gunakan chown / chcon

8. Testing WordPress

Buka: http://IP_SERVER

Komentar

Postingan populer dari blog ini

MEMBUAT VIRTUAL MESIN ALMALINUX 9.6

AlmaLinux adalah sistem operasi berbasis Linux yang dibuat sebagai pengganti CentOS. Sistem ini cocok banget untuk digunakan sebagai server karena gratis, open-source, dan sangat stabil. AlmaLinux juga dibuat agar mirip banget dengan Red Hat Enterprise Linux (RHEL), jadi aman dan terpercaya untuk dipakai, baik di dunia kerja maupun buat belajar. Yuk, sekarang kita mulai bikin mesin virtual AlmaLinux di VirtualBox!

MEMBUAT VIRTUAL MESIN UBUNTU SERVER 24.04

Sebelum memulai proses instalasi Ubuntu Server, penting untuk memahami terlebih dahulu apa itu  Ubuntu dan mengapa sistem operasi ini menjadi pilihan populer untuk kebutuhan server. Ubuntu adalah sistem operasi berbasis Linux yang bersifat gratis, open source, dan dikenal stabil serta aman. Ubuntu memiliki beberapa versi, salah satunya adalah  Ubuntu Server , yang dirancang khusus untuk kebutuhan jaringan, server, dan komputasi tanpa antarmuka grafis, sehingga lebih ringan dan efisien digunakan di lingkungan server. PERSIAPAN

DNS SERVER di Ubuntu 24.04