🔥 Panduan Lengkap Instalasi LEMP + WordPress di Ubuntu Server
Berikut tutorial lengkap dengan tampilan kuat, modern, dan sangat rapi. Siap ditempel langsung di Blogger.
1. Update Sistem Ubuntu
Lakukan update sebelum instalasi.
sudo apt update && sudo apt upgrade -y
2. Instal & Jalankan Nginx
Instal webserver Nginx.
sudo apt install nginx -y
Cek status Nginx.
systemctl status nginx
3. Instal MariaDB (Database)
sudo apt install mariadb-server -y
Amankan database.
sudo mysql_secure_installation
4. Buat Database Untuk WordPress
Masuk ke MariaDB:
sudo mysql
Buat database dan user:
CREATE DATABASE wordpress_db;
CREATE USER 'wpuser'@'localhost' IDENTIFIED BY 'passwordku';
GRANT ALL PRIVILEGES ON wordpress_db.* TO 'wpuser'@'localhost';
FLUSH PRIVILEGES;
EXIT;
5. Instal PHP & Modul yang Dibutuhkan WordPress
sudo apt install php-fpm php-mysql php-xml php-mbstring php-gd php-curl php-zip php-cli -y
Cek versi PHP:
php -v
6. Konfigurasi Nginx untuk WordPress
Buat file konfigurasi WordPress:
sudo nano /etc/nginx/sites-available/wordpress
Isi konfigurasi berikut:
server {
listen 80;
server_name _;
root /var/www/wordpress;
index index.php index.html;
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php-fpm.sock;
}
location ~ /\.ht {
deny all;
}
}
Aktifkan konfigurasi:
sudo ln -s /etc/nginx/sites-available/wordpress /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl reload nginx
7. Download & Install WordPress
cd /var/www/
sudo rm -rf wordpress
sudo wget https://wordpress.org/latest.tar.gz
sudo tar -xvf latest.tar.gz
sudo rm latest.tar.gz
Set permission WordPress:
sudo chown -R www-data:www-data /var/www/wordpress
sudo chmod -R 755 /var/www/wordpress
8. Konfigurasi WordPress
Buat file konfigurasi:
cd /var/www/wordpress
sudo cp wp-config-sample.php wp-config.php
sudo nano wp-config.php
Ubah data database:
define( 'DB_NAME', 'wordpress_db' );
define( 'DB_USER', 'wpuser' );
define( 'DB_PASSWORD', 'passwordku' );
define( 'DB_HOST', 'localhost' );
9. Akses WordPress
Buka melalui browser:
http://IP-SERVER-UBUNTU
WordPress siap digunakan! 🎉
Komentar
Posting Komentar