由于 /var/run 下缺少目录,Httpd 服务拒绝启动

由于 /var/run 下缺少目录,Httpd 服务拒绝启动

看起来我的 centos 上的 httpd 服务无法创建 /var/run/httpd,导致他拒绝启动。

只是为了提醒你们 /var/run 指向 /run

[root@build72 var]# ls -ld /var/run
lrwxrwxrwx. 1 root root 6 Oct 28  2014 /var/run -> ../run

/run 是临时文件(机器重启后内容会被清除):

[root@build72 var]# mount | grep /run
tmpfs on /run type tmpfs (rw,nosuid,nodev,mode=755)
tmpfs on /run/user/0 type tmpfs (rw,nosuid,nodev,relatime,size=800948k,mode=700)

我总是必须创建 /run/httpd 以便我的 httpd 服务启动,否则它将失败:

mkdir /run/httpd

error_logs 中的输出如下:

 [Tue Nov 08 11:10:29.378421 2016] [auth_digest:notice] [pid 1370] AH01757: generating secret for digest authentication ...
 [Tue Nov 08 11:10:29.378447 2016] [auth_digest:error] [pid 1370] (2)No such file or directory: AH01762: Failed to create shared memory segment on file /run/httpd/authdigest_shm.1370
 [Tue Nov 08 11:10:29.378459 2016] [auth_digest:error] [pid 1370] (2)No such file or directory: AH01760: failed to initialize shm - all nonce-count checking, one-time nonces, and MD5-sess algorithm disabled
 [Tue Nov 08 11:10:29.378462 2016] [:emerg] [pid 1370] AH00020: Configuration Failed, exiting

CentOS版本:

CentOS Linux release 7.2.1511 (Core) 

httpd 版本:

[root@build72 var]# httpd -v
Server version: Apache/2.4.6 (CentOS)
Server built:   Jul 18 2016 15:30:14

selinux 已禁用。

任何帮助都将不胜感激。谢谢!

相关内容