Introduction After compiling, installing and solving the problem, Nginx is running normally, but Nginx is not added to the system service at this time. Next, we will add Nginx to the system services and set it to start at boot. View Services First check the service status of Nginx, enter No related services are found, the next step is to add system services. Adding system services Add [Unit] Description=nginx - high performance web server Documentation=http://nginx.org/en/docs/ After=network.target remote-fs.target nss-lookup.target [Service] Type=forking PIDFile=/usr/local/nginx/logs/nginx.pid ExecStartPre=/usr/local/nginx/sbin/nginx -t -c /usr/local/nginx/conf/nginx.conf ExecStart=/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf ExecReload=/bin/kill -s HUP $MAINPID ExecStop=/bin/kill -s QUIT $MAINPID PrivateTmp=true [Install] WantedBy=multi-user.target After adding, check again Set automatic startup First test it, restart it and then check the Nginx service It really didn't start. Enter You can use Finally restart to check whether the setting is successful No problem, the compilation and installation of Nginx is complete, and the next step is to install PHP. Reference: CentOS 7 systemd adds custom system services, You may also be interested in:
|
<<: Solution to the problem that the MySQL database cannot be accessed by other IP addresses
>>: How to use CocosCreator for sound processing in game development
Table of contents Preface Asynchronous loading Pa...
The difference between replace into and insert in...
Open the cpanel management backend, under the &qu...
Overview As for the current default network of Do...
TabIndex is to press the Tab key to sequentially o...
1. Introduction Recently I found that there are m...
Table of contents Overview Precautions 1. Usage 2...
In enterprises, database high availability has al...
Now, let me ask you a question. What happens when...
Table of contents 1. How to obtain elements Get i...
1. Trash or Classic? Web technology updates very ...
Table of contents Preface Check Constraints Creat...
Table of contents Achieve results Complete code +...
In fact, many companies have functions similar to...
Over the past few years, there has been a trend i...