1. Install Nginx Ubuntu
sudo apt update
sudo apt install nginx
2. Adjusting the Firewall
sudo ufw app list
OutputAvailable applications:
Nginx Full
Nginx HTTP
Nginx HTTPS
OpenSSH
keterangan :
Nginx Full : This profile opens both port 80 (normal, unencrypted web traffic) and port 443 (TLS/SSL encrypted traffic)
Nginx HTTP : This profile opens only port 80 (normal, unencrypted web traffic)
Nginx HTTPS : This profile opens only port 443 (TLS/SSL encrypted traffic)
Anda dapat mengaktifkan ini dengan mengetik:
sudo ufw allow 'Nginx HTTP'
Anda dapat memverifikasi perubahan dengan mengetik:
sudo ufw status
OutputStatus: active
To Action From
-- ------ ----
OpenSSH ALLOW Anywhere
Nginx HTTP ALLOW Anywhere
OpenSSH (v6) ALLOW Anywhere (v6)
Nginx HTTP (v6) ALLOW Anywhere (v6)
3. Check Web Server
systemctl status nginx
Output● nginx.service - A high performance web server and a reverse proxy server
Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
Active: active (running) since Fri 2020-04-20 16:08:19 UTC; 3 days ago
Docs: man:nginx(8)
Main PID: 2369 (nginx)
Tasks: 2 (limit: 1153)
Memory: 3.5M
CGroup: /system.slice/nginx.service
├─2369 nginx: master process /usr/sbin/nginx -g daemon on; master_process on;
└─2380 nginx: worker process
Cek web server di Address Bar
http://your-server-ip
4. Managing The Nginx Process
a. Stop Server
sudo systemctl stop nginx
b. Start Server
sudo systemctl start nginx
c. Reload Server
sudo systemctl reload nginx
d. Disable Server
sudo systemctl disable nginx
e. Enable Server
sudo systemctl enable nginx
Selanjutnya :
0 comments:
Post a Comment