I am creating a server (Centos 8) to develop a system that will use an application using REACT as a front end to show data from different sensors. I will use NGINX as a webserver and Node-red as a back end. In this first post I describe how to install NGINX.
Install nginx package using the yum command on CentOS 8:
sudo yum update
sudo yum install nginx
Update firewall settings and open TCP port 80 and 443. Run:
sudo firewall-cmd –permanent –zone=public –add-service=https –add-service=http
sudo firewall-cmd –reload
Enable nginx service by running systemctl command so that it starts at server boot time:
sudo systemctl enable nginx
start the service, run:
sudo systemctl start nginx
Commands to start/stop/restart nginx server
Run command as per your needs.
sudo systemctl start nginx <– start the server ##
sudo systemctl stop nginx <– stop the server ##
sudo systemctl restart nginx <– restart the server ##
sudo systemctl reload nginx <– reload the server ##
sudo systemctl status nginx <– get status of the server ##
You must open and enable port 80 and 443 using the firewall-cmd command:
sudo firewall-cmd –permanent –zone=public –add-service=http –add-service=https
sudo firewall-cmd –reload
sudo firewall-cmd –list-services –zone=public
Now nginx is installed. Bellow are some important directories (defaults) i
Config directory – /etc/nginx/
Maibn global config file – /etc/nginx/nginx.conf
TCP ports opened by Nginx – 80 (HTTP), 443 (HTTPS)
Default web document root directory – /usr/share/nginx/html
Access log file – /var/log/nginx/access.log
Error log file – /var/log/nginx/error.log