Installing NGINX on Debian/Ubuntu
There are two ways to install NGINX on Debian and Ubuntu:
Following are the steps which will show us how to install Nginx on our Debian or Ubuntu system:
First of all let us update our local package index, so that we have access to the most recent package listings.
Open the terminal on Ubuntu or Debian, and run the following command to ensure that all packages on the OS are up to date:
Since, Nginx is available in default repository of Debian or Ubuntu, it is possible to install it from these repositories using the apt packaging system.
Once it is done, use the following command to see the process for the web server in a running state.
Adjusting the firewall to access Nginx
For accessing the Nginx from the web server, we have to allow the access the services from outside.
To see the list of profiles available to allow from the firewall, use the following command:
Nginx Full: It allows the both ports 80 and 443.
Nginx HTTP: It allows only the port 80.
Nginx HTTPS: It allows only the port 443.
To allow the both ports HTTP 80 and HTTPS 443, use the following command:
To allow only Nginx HTTP port 80, use the following command:
To allow only Nginx HTTPS port 443, use the following command:
Checking the NGINX Service Status
By default, after the installation of Ubuntu, the Nginx starts automatically and we can check the status of the Nginx with the help of following command: