Home >Operation and Maintenance >Linux Operation and Maintenance >How to set nginx to start automatically on boot in linux

How to set nginx to start automatically on boot in linux

醉折花枝作酒筹
醉折花枝作酒筹Original
2021-04-16 15:36:2812865browse

Method: 1. Use the "yum -y install nginx" command to install Nginx; 2. Use the "server nginx start" command to verify whether the service is available; 3. Use the "chkconfig nginx on" command to add the service to the server Start; 4. Restart for testing.

The operating environment of this tutorial: centos7 system, nginx version 1.16.1, thinkpad t480 computer.

1. Use yum to install nginx:

yum -y install nginx

How to set nginx to start automatically on boot in linux

2. After installation, verify whether the service can be used

server nginx start

How to set nginx to start automatically on boot in linux

3. Add the service to self-start

chkconfig nginx on

4. Restart for testing

How to set nginx to start automatically on boot in linux

Visit the homepage to see if nginx starts normally

How to set nginx to start automatically on boot in linux

(Recommended study: linux tutorial)

The above is the detailed content of How to set nginx to start automatically on boot in linux. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn