Simple tutorial about how to install nginx server on Redhat linux
Check if you have nginx service enabled already
systemctl list-unit-files | grep nginxIf nginx service is disabled, enable it by typing
systemctl enable nginx.serviceStart nginx service, you’ll need to open firewall ports to allow nginx server content to be accessible from public.
systemctl start nginx.service
# Open firewall ports for nginx
firewall-cmd --permanent --add-port={80/tcp,443/tcp}
firewall-cmd --reloadIf you don’t have nginx installed, follow below steps to install it.
# Add nginx repo to your server. source, create a repo file under below location
touch /etc/yum.repos.d/nginx.repo
# Edit above repo file, update content as below (RHEL 7 only)
[nginx]
name=nginx repo
baseurl=https://nginx.org/packages/rhel/7/x86_64/
gpgcheck=0
enabled=1Save this file and type “yum update” to install nginx
yum update
# Install nginx, once nginx get installed, repeat step to enable and start nginx service.
yum install nginxOpen firewall ports and verify
firewall-cmd --permanent --add-port={80/tcp,443/tcp}
firewall-cmd --reload
# Verify , you should have 80 and 443 ports opened
firewall-cmd --list-portsEnable nginx as system service
# This will run nginx automatically when system starts.
systemctl enable nginxVerify nginx installation
# Check installed nginx
yum list installed nginx
# Sample output
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
Installed Packages
nginx.x86_64 1:1.20.1-9.el7 @epel
#Start nginx server
sudo systemctl start nginx
# Check nginx is enabled
systemctl is-enabled nginxNow you should have nignx up and running.
Reference:
https://www.nginx.com/resources/wiki/start/topics/tutorials/install/

