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
1. Advantages and Disadvantages of Indexes Advant...
7 ways to implement a two-column layout with fixe...
Controversy over nofollow There was a dispute bet...
Table of contents Configuration parsing Service C...
This article describes how to install Apache on a...
1. The table tag is table, tr is row, td is cell, ...
MySQL downloads for all platforms are available a...
In front-end projects, attachment uploading is a ...
HTML5 adds a native placeholder attribute for inp...
Get the Dockerfile from the Docker image docker h...
This article shares the specific code of Vue to s...
Compared with FTP, SSH-based sftp service has bet...
1. Installation environment Docker supports the f...
Table of contents 1. What are microtasks? 2. What...
The Nginx ngx_http_image_filter_module module (ng...