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 Problem Description Solution Pr...
Table of contents 1. Installation 2. Import in ma...
Why should we use CSS animation to replace JS ani...
Horizontal Line Use the <hr /> tag to draw ...
How to add a loading animation every time I scrol...
Key Modifiers When listening for keyboard events,...
Beautiful code is the foundation of a beautiful we...
After Vmvare sets the disk size of the virtual ma...
1. Installation The biggest feature of Terminator...
Table of contents Preface Achieve results Code CS...
Today I learned a new CSS special effect, the wav...
Preview of revised version This article was writt...
view: Views in MySQL have many similarities with ...
Core code -- Below I will demonstrate the impleme...
Table of contents 1. Prototype 2. Prototype chain...