CentOS7 : Fix Nginx PID Error[1]

Taspon K.
Feb 5, 2021

[Description]

Nginx logs an error when started on a VM-Machine After install

systemctl status nginx

Solutions

Create Directory as path : /etc/systemd/system/nginx.service.d

mkdir /etc/systemd/system/nginx.service.d

Create file override.conf and add configuration below

printf “[Service]\nExecStartPost=/bin/sleep 0.1\n” | \
> tee /etc/systemd/system/nginx.service.d/override.conf

or

vim /etc/systemd/system/nginx.service.d/override.conf

This is configuration in override.conf file

[Service]
ExecStartPost=/bin/sleep 0.1

Then restart service nginx

 systemctl daemon-reload
systemctl restart nginx
systemctl enable nginx
systemctl status nginx
systemctl status nginx | after create file : override.conf

Testing Nginx

Add firewall permission to allow service http,https

firewall-cmd --permanent --add-service=http
firewall-cmd --permanent --add-service=https
firewall-cmd --reload

Browser ip_address of your server

--

--

Taspon K.

Data Eng. , Studying Master Degree in Big Data Engineering Major.