Nginx is a very popular web browser nowadays because of its high performance, can be used as
There are numerous approaches to install Nginx. Here we are using Epel repository for the installation.
Step 1. Install epel repository.
[root@localhost ~]# yum install epel-release.noarch
Step 2. Now run command install nginx.
[root@localhost ~]# yum install nginx
Step 3. Start the nginx service.
[root@localhost ~]# systemctl start nginx
Step 4. Enable nginx on boot.
[root@localhost ~]# systemctl enable nginx
Nginx successfully installed.
Possible reasons For Errors
1. Port 80 is already in use, the error message will be like this:
command: [root@localhost ~]# service nginx start
Error: Redirecting to /bin/systemctl start nginx.service
Job for nginx.service failed because the control process exited with error code. See “systemctl status nginx.service” and “journalctl -xe” for details.
This means that another web server (Apache) is already running on this server. Stop the Apache service (Systemctl stop httpd) and then start the service for NGINX (systemctl start nginx)
2. Also check the firewall status
[root@localhost ~]# systemctl status firewalld
if it is active- allow traffic for HTTP or HTTPS.
[root@localhost ~]# firewall-cmd –permanent –zone=public –add-service=http
[root@localhost ~]# firewall-cmd –reload