current position:Home>Troubleshoot the problem that nginx cannot boot and start automatically under the pagoda

Troubleshoot the problem that nginx cannot boot and start automatically under the pagoda

2022-09-23 10:34:49Unfinished code written every week

As the title shows, the environment on the server is not very pure. After installing the pagoda, it is found that the nginx service is turned on and does not start

View the pid in the configuration file

image-20220922150512055

Corresponding modification

vim /usr/lib/systemd/system/nginx.service[Unit]Description=The nginx HTTP and reverse proxy serverAfter=network-online.target remote-fs.target nss-lookup.targetWants=network-online.target[Service]Type=forkingPIDFile=/www/server/nginx/logs/nginx.pid# Nginx will fail to start if /run/nginx.pid already exists but has the wrong# SELinux context. This might happen when running `nginx -t` from the cmdline.# https://bugzilla.redhat.com/show_bug.cgi?id=1268621ExecStartPre=/usr/bin/rm -f /www/server/nginx/logs/nginx.pidExecStartPre=/www/server/nginx/sbin/nginx -tExecStart=/www/server/nginx/sbin/nginxExecReload=/www/server/nginx/sbin/nginx -s reloadKillSignal=SIGQUITTimeoutStopSec=5KillMode=processPrivateTmp=true[Install]WantedBy=multi-user.targetsystemctl daemon-reloadsystemctl start nginxsystemctl status nginxsystemctl enable nginx

copyright notice
author[Unfinished code written every week],Please bring the original link to reprint, thank you.
https://en.cdmana.com/2022/266/202209231031463656.html

Random recommended