Apache issue
Facing issues with Apache as it goes down every now and then. The CloudLinux support identified that the problem is related to "httpd.service: Can't open PID file /var/run/apache2/httpd.pid (yet?) after start: No such file or directory" and the suggested solution:
Incorrect permissions for the /run/apache2 directory:
[root@on ~]# ls -la /run/apache2
total 4
drwxr-xr-x 3 root nobody 100 Jul 21 18:47 .
drwxr-xr-x 51 root root 2920 Jul 21 18:56 ..
srwx------ 1 nobody root 0 Jul 21 18:47 cgid_sock.300232
drwx------ 2 nobody nobody 40 Jul 11 06:25 htcacheclean
-rw-r--r-- 1 root root 7 Jul 21 18:47 httpd.pid <---
I have changed the owner and group for the /run/apache2 directory and all subdirectories in it:
[root@on ~]# chown -R nobody:nobody /run/apache2
and after this reboot httpd and run systemctl daemon-reload:
[root@on ~]# systemctl daemon-reload
[root@on ~]# systemctl restart httpd
Please note that this problem was directly related to Apache. In this case, it is EasyApache4.
-
By the way, following the solution fixed the issue but it came back again within 24 hours.
0 -
He suggested that httpd.pid should be nobody|nobody but it keeps resetting to root.
0 -
Hey there! On a test machine, /run/apache2 is always root:nobody ownership and 710 permissions. Inside that directory, the httpd.pid file is always 644 root:root, so that seems to be working as normal.
When Apache restarts, what do you see in the log on the server?
0
Please sign in to leave a comment.
Comments
3 comments