🚀 SETUP WEB SERVER (NGINX)
1. Update Sistem
Jalankan:
sudo apt update && sudo apt upgrade -y
2. Install NGINX
sudo apt install nginx -y
3. Jalankan NGINX
sudo systemctl start nginx
sudo systemctl enable nginx
Cek status:
sudo systemctl status nginx
🌐 4. TEST DI BROWSER
Buka browser di Windows:
👉 http://localhost
atau
👉 http://127.0.0.1
Kalau muncul:
Welcome to nginx!
✅ Berarti berhasil
🔧 5. (JIKA TIDAK BISA DIAKSES)
Masuk VirtualBox:
👉 Settings → Network → Port Forwarding
Tambahkan:
- Name: HTTP
- Host Port: 8080
- Guest Port: 80
Akses:
👉 http://localhost:8080
📁 6. FOLDER WEBSITE
Lokasi default:
cd /var/www/html
Edit file:
sudo nano index.nginx-debian.html
Ganti isi:
<h1>Server Saya Berhasil!</h1>
<p>Ubuntu + NGINX berjalan 🚀</p>
Simpan:
- CTRL + X
- Y
- Enter
🔥 7. SET PERMISSION
sudo chown -R $USER:$USER /var/www/html
🔐 8. AKTIFKAN FIREWALL
sudo ufw allow 'Nginx Full'
sudo ufw enable
🎯 HASIL AKHIR
Sekarang kamu punya:
✔ Web server aktif
✔ Bisa buka website lokal
✔ Bisa upload project HTML

Posting Komentar