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

醉折花枝作酒筹
Release: 2023-01-05 16:09:19
Original
12846 people have browsed it

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
Copy after login

How to set nginx to start automatically on boot in linux

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

server nginx start
Copy after login

How to set nginx to start automatically on boot in linux

3. Add the service to self-start

chkconfig nginx on
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template