This topic describes how to install and deploy Nginx on a physical server to quickly verify service availability.
Before You Begin
l Log in as the root user and go to the command line interface.
l Port 80 is allowed in the firewall and the status is "running".
Operation Steps
1. Enter the following command addition source.
sudo rpm -Uvh http: //nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm |
2. Enter the following command to install Nginx. "Complete!" appears to indicate that the installation is complete.
sudo yum install nginx |
3. Enter the following command to start Nginx.
systemctl start nginx.service |
4. Enter http://Internet IP address of the physical server in your browser. "Welcome to Nginx!" is displayed. The physical server is accessed successfully.
Note:
If the access is not successful, try the following steps for troubleshooting.
1. Enter ps -ef | grep nginx to check whether Nginx is successfully started. 2. Enter netstat -ntlp to check whether port 80 is assigned to Nginx. 3. If the Nginx service starts normally and port number is correct, enter systemctl restart firewalld.service to restart the firewall. 4. Enter systemctl stop firewalld.service to disable the firewall. 5. Enter the Internet IP address of the physical server in your browser and refresh the page. The physical server is successfully accessed. |