episyche logo

Episyche

Nginx/Setup/

How to install Nginx on Red Hat Linux server?

Published on

How to install Nginx on Red Hat Linux server?
If we want to host a website on a Linux server we must need software to handle the request from the browser and send a response to the respective IP address. For this purpose, we use web servers (For example: Nginx) which handles the request from the browser and serves the requested web pages. 

Method 1: Install Nginx from RHEL Repository. 

  • Install the EPEL repository:

1sudo yum install epel-release

 

  • update the repository information:

1sudo yum update

 

  • install Nginx

1sudo yum install nginx -y

 

  • To autostart Nginx after restarting the RHEL server, execute the following commands.

So when you stop and start the RHEL server, systemctl will automatically start the Nginx service.

1sudo systemctl enable nginx

 

  • Check Nginx status by executing the below command, If the status is running you’re ready to go.

1systemctl status nginx

 

  • To stop the process of the Nginx server, execute the following commands.

1sudo systemctl stop nginx

 

  • To start the process of the Nginx server, execute the following commands.

1sudo systemctl start nginx

 

  • To restart the process of the Nginx server, execute the following commands.

1sudo systemctl restart nginx

 

Comments