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
After nginx is compiled and installed and used fo...
meta is an auxiliary tag in the head area of htm...
Linux virtual machine: VMware + Ubuntu 16.04.4 Wi...
1. Overlay Overview Overlay means covering, as th...
This article shares the specific code of jQuery t...
This article shares the specific code of JavaScri...
If people have been idle for too long, they will ...
Table of contents 1. Get the file extension 2. Co...
Think big and small, then redirect. Sometimes Lin...
Table of contents Function Basic query functions ...
Recently, WeChat was forced by Apple to develop a...
1. Download Download mysql-5.7.19-linux-glibc2.12...
This article example shares the specific code of ...
1. Overall steps At the beginning, we introduced ...
In the previous sections, we discussed aspects of ...