linux - Centos7编译安装nginx问题?
迷茫
迷茫 2017-04-17 15:35:55
0
4
261
迷茫
迷茫

业精于勤,荒于嬉;行成于思,毁于随。

reply all(4)
刘奇

I guess there is no nginx.service service startup script in the /usr/lib/systemd/system directory in your system. If you install it using yum, this script will be generated, because if you do not set it during compilation and installation If so, if you use systemctl (start/stop/reload/restart) nginx.service, of course an error will occur. If you insist on using compilation and installation, you can refer to the following script content to modify it. You can almost use the systemctl command.

============ The following content omits the comments starting with #========
[Unit]
Description=The nginx HTTP and reverse proxy server
After=network.target remote-fs.target nss-lookup.target

[Service]
Type=forking
PIDFile=/run/nginx.pid
ExecStartPre=/usr/bin/rm -f /run/nginx.pid
ExecStartPre=/usr/ sbin/nginx -t
ExecStart=/usr/sbin/nginx
ExecReload=/bin/kill -s HUP $MAINPID
KillMode=process
KillSignal=SIGQUIT
TimeoutStopSec=5
PrivateTmp=true

[Install]
WantedBy=multi-user.target

Mainly modify the path of the nginx executable file and the PID file path

10yue26 I accidentally saw the reminder today and accepted it. . There is still a small pitfall
Whether this file is created or modified, you need to execute the following command after completion to let systemd load it

systemctl daemon-reload

^_^

PHPzhong

You give this message as if your car won’t start and then ask others why

左手右手慢动作

Look at error.log

洪涛

Run the journalctl -xe command, which will display the reason why nginx failed to start. Viewing detailed logs can help you solve the problem faster.

不知道我这个回答哪儿里有不妥,被忽略。
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!