How to install and use Nginx on CentOS 7 / RHEL 7
To install Nginx on CentOS 7 or RHEL 7, you can use the following steps:
- Add the Nginx repository to your system:
sudo nano /etc/yum.repos.d/nginx.repo- Paste the following configuration in the file and save it:
name=nginx repornbaseurl=http://nginx.org/packages/centos/7/$basearch/
gpgcheck=0
enabled=1- Install Nginx using the yum command:
sudo yum install nginx- Start Nginx service:
sudo systemctl start nginx- Verify that Nginx is running:
sudo systemctl status nginx- Enable Nginx to start at boot:
sudo systemctl enable nginx- Access the Nginx default web page by opening a web browser and navigating to
http://your-server-ip.
