Ali cloud CentOS 7.3 yum command to install nginx

The premise is already set up 80 ports open.

Install nginx, first we need to use the root user to operate.

The first step: add the repository nginx

Use the command: sudo yum install epel-release

After the prompt answer yes, nginx repository will complete the installation on the server

 

Step 2: Install nginx using yum install

Use the command: sudo yum install nginx

After the prompt answer yes, Nginx will complete the installation on the server.

The third step: start nginx

After successful installation start nginx

Use the command: sudo systemctl start nginx

After starting without any log printing, OK.

Step four: Verify whether nginx started successfully

First, you can start to see whether the background

Use the command: ps -ef | grep nginx

As shown on the success!

Secondly, access server IP address at the browser can properly explain the success of the visit

Annex: nginx Common Commands

cd /usr/sbin/

./nginx

./nginx -s stop

./nginx -s quit

./nginx -s reload

./nginx -s quit: This step is a way to stop the process of processing tasks to be completed nginx be stopped.

./nginx -s stop: This mode is equivalent to first find nginx process id and then use the kill command to force kill the process.

If you want to when the system starts, nginx started, then you can use the command: sudo systemctl enable nginx

nginx start command may also be switched to nginx / sbin directory used for starting ./nginx

Reference  https://www.cnblogs.com/hupingzhi/p/11197925.html

Guess you like

Origin www.cnblogs.com/hans_gis/p/12301820.html