This article is a mirror article of machine translation, please click here to jump to the original article.

View: 15141|Reply: 2

[Web] Implementation: Adding nginx to the systemctl service to auto-start under CentOS 7

[Copy link]
Posted on 6/28/2018 2:19:09 PM | | | |
Install Nginx correctly

Centos installation nginx-1.14.0 tutorial
https://www.itsvse.com/thread-4855-1-1.html
(Source: Architect_Programmer)

Add Nginx to systemctl

My NGINX installation directory is: /service/nginx-1.14.0 (please modify the service file according to your own configuration)

Added nginx.service file

The configuration is as follows:


The [Unit] section is mainly a description of the service, including Description and After, Description is used to describe the service, and After is used to describe the service category

The [Service] part is the key to the service, which is the setting of some specific running parameters of the service, where Type=forking is the form of background running, PIDFile is the file path where the PID is stored, ExecStart is the specific run command of the service, ExecReload is the restart command, ExecStop is the stop command, PrivateTmp=True indicates that an independent temporary space is allocated to the service, Note: [ Service] part of the start, restart, and stop commands all require the absolute path to be used, and an error will be reported if the relative path is used!

The [Install] section is a setting related to the installation of the service, which can be set to multi-user

Set Nginx to boot up



Test launch Nginx


Other orders
systemctl reload nginx.service // restart
systemctl stop nginx.service // stop
systemctl stop nginx.service // stop
systemctl status nginx.service // to view the status



Finally, attach the nginx.service file:

Tourists, if you want to see the hidden content of this post, pleaseReply






Previous:Centos 7 .Net core background daemon supervisor tutorial
Next:Juniper Firewall cannot be telnet, web managed
Posted on 6/28/2018 3:00:40 PM |
Support it!!!!!!!!!!!!
Posted on 7/10/2018 9:59:56 PM |
Registration services
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com