Web Server
📑 SOP Setup Web Server di Ubuntu Server & Upload via WinSCP
1. Tujuan
Memberikan panduan langkah demi langkah untuk:
- Instalasi dan konfigurasi web server (Apache/Nginx) di Ubuntu Server.
- Menyiapkan akses SSH.
- Upload file website dari Windows client menggunakan WinSCP.
2. Lingkup
- Server: Ubuntu Server (versi terbaru).
- Client: Windows dengan aplikasi WinSCP.
- Website: HTML/PHP sederhana.
3. Langkah Kerja
3.1 Persiapan Sistem
- Login ke Ubuntu Server.
- Update sistem:
sudo apt update && sudo apt upgrade -y
3.2 Instalasi Web Server
Opsi A: Apache
sudo apt install apache2 -y
sudo systemctl enable apache2
sudo systemctl start apache2
Cek status:
sudo systemctl status apache2
Opsi B: Nginx
sudo apt install nginx -y
sudo systemctl enable nginx
sudo systemctl start nginx
Cek status:
sudo systemctl status nginx
3.3 Instalasi PHP (opsional)
Untuk website dinamis:
sudo apt install php libapache2-mod-php php-cli php-mysql -y
php -v
3.4 Instalasi Database (opsional)
Jika diperlukan:
sudo apt install mysql-server -y
sudo mysql_secure_installation
3.5 Konfigurasi Folder Web
Default folder: /var/www/html
Ubah permission agar bisa upload:
sudo chown -R $USER:$USER /var/www/html
sudo chmod -R 755 /var/www/html
3.6 Setup SSH untuk WinSCP
- Install SSH server:
sudo apt install openssh-server -y sudo systemctl enable ssh sudo systemctl start ssh - Cek IP server:
Catat IP (contoh:ip a192.168.1.100).
3.7 Upload File via WinSCP
- Buka WinSCP di Windows.
- Pilih protokol SFTP.
- Masukkan:
- Host name: IP server (misal: 192.168.1.100)
- Port: 22
- Username: user Ubuntu
- Password: password user Ubuntu
- Klik Login.
- Navigasi ke folder
/var/www/html. - Drag & drop file website dari Windows ke folder tersebut.
3.8 Uji Website
- Buka browser di Windows.
- Akses:
http://IP_SERVER - Jika file
index.htmlatauindex.phpsudah diupload, website akan tampil.
4. Command Ringkas
| Fungsi | Command |
|---|---|
| Update sistem | sudo apt update && sudo apt upgrade -y |
| Install Apache | sudo apt install apache2 -y |
| Install Nginx | sudo apt install nginx -y |
| Install PHP | sudo apt install php libapache2-mod-php -y |
| Install MySQL | sudo apt install mysql-server -y |
| Cek IP server | ip a |
| Restart Apache | sudo systemctl restart apache2 |
| Restart Nginx | sudo systemctl restart nginx |
5. Catatan Penting
- Gunakan file
index.htmlsederhana untuk uji coba awal. - Pastikan permission folder web sudah benar agar upload tidak gagal.
- Untuk keamanan, hindari login sebagai root saat upload.
👉 Dengan dokumentasi ini, kamu punya alur kerja standar: Install → Konfigurasi → Upload → Uji.
Komentar
Posting Komentar