How to install Nginx on Oracle VPS?By Tri Nguyen on
In this post I would like to document how I install nginx and open the ports on an Oracle VPS. If you’re interested in creating a free Oracle VPS, you can follow the instructions in this post How to create a free Oracle VPS with Python script (Out of capacity)?
- Go to Virtual Cloud Networks, select the VCN which is used for the VM you want to install Nginx there.
- Select Security List on the Resources menu.
- Select the Security List you want to edit.
- Click Add Ingress Rules then add new rule for port 80 and 443.
Now, login to your VPS over SSH and execute the following commands to open port 80 in iptables.
sudo apt-get install firewalld sudo systemctl enable firewalld sudo systemctl start firewalld
- Open port 80.
sudo firewall-cmd --zone=public --permanent --add-port=80/tcp sudo firewall-cmd --reload
- Then verify if the port 80 is really open.
sudo firewall-cmd --list-all
public target: default icmp-block-inversion: no interfaces: sources: services: dhcpv6-client ssh ports: 80/tcp protocols: masquerade: no forward-ports: source-ports: icmp-blocks: rich rules:
- Now you can install Nginx.
sudo apt update sudo apt install nginx
If you have any question, you can start a new discussion.