二维码

httpd 在启动时不启动

884 人阅读 | 时间:2021年12月08日 09:50

嗨,
在这个系统上,httpd 不会在启动时启动。我可以通过 service httpd start 手动启动它而不会出错。

chkconfig --list httpd
httpd           0:off   1:off   2:on    3:on    4:on    5:on    6:off

chkconfig 显示运行级别 N 的服务 httpd 的“on”设置仅意味着 /etc/rc.d/rcN.d/httpd 和 /etc/init.d/httpd 之间存在符号链接。

尝试查找链接:

find /etc/rc.d -name "*httpd*" | xargs ls -l

你应该看到这个(当然有不同的时间戳)

-rwxr-xr-x. 1 root root 3158 Apr 4 13:16 /etc/rc.d/init.d/httpd
lrwxrwxrwx. 1 root root 15 Jun 24 00:24 /etc/rc.d/rc0.d/K15httpd -> ../init.d/httpd
lrwxrwxrwx. 1 root root 15 Jun 24 00:24 /etc/rc.d/rc1.d/K15httpd -> ../init.d/httpd
lrwxrwxrwx. 1 root root 15 Jun 24 00:24 /etc/rc.d/rc2.d/S85httpd -> ../init.d/httpd
lrwxrwxrwx. 1 root root 15 Jun 24 00:24 /etc/rc.d/rc3.d/S85httpd -> ../init.d/httpd
lrwxrwxrwx. 1 root root 15 Jun 24 00:24 /etc/rc.d/rc4.d/S85httpd -> ../init.d/httpd
lrwxrwxrwx. 1 root root 15 Jun 24 00:24 /etc/rc.d/rc5.d/S85httpd -> ../init.d/httpd
lrwxrwxrwx. 1 root root 15 Jun 24 00:24 /etc/rc.d/rc6.d/K15httpd -> ../init.d/httpd

对于每一个“开”的运行级别,应该有开始与“S”在名称为S(tartup)的链接
的和启动使用K为K(ILL)的链路断开电平(0,1和6)

什么运行级别当您看不到 httpd 服务时,您的系统处于运行状态,这是另一种可能性,如果
它处于单用户级别 1,那么没有 httpd 是正确且符合预期的。

它在运行级别 5 中,我从该命令中得到了预期的结果:

代码:


$ find /etc/rc.d -name "*httpd*" | xargs ls -l
-rwxr-xr-x. 1 root root 3158 Apr  5 03:16 /etc/rc.d/init.d/httpd
lrwxrwxrwx  1 root root   15 Jun 22 16:37 /etc/rc.d/rc0.d/K15httpd -> ../init.d/httpd
lrwxrwxrwx  1 root root   15 Jun 22 16:37 /etc/rc.d/rc1.d/K15httpd -> ../init.d/httpd
lrwxrwxrwx  1 root root   15 Jun 22 16:37 /etc/rc.d/rc2.d/S85httpd -> ../init.d/httpd
lrwxrwxrwx  1 root root   15 Jun 22 16:37 /etc/rc.d/rc3.d/S85httpd -> ../init.d/httpd
lrwxrwxrwx  1 root root   15 Jun 22 16:37 /etc/rc.d/rc4.d/S85httpd -> ../init.d/httpd
lrwxrwxrwx  1 root root   15 Jun 22 16:37 /etc/rc.d/rc5.d/S85httpd -> ../init.d/httpd
lrwxrwxrwx  1 root root   15 Jun 22 16:37 /etc/rc.d/rc6.d/K15httpd -> ../init.d/httpd

我检查了这一行及其定义文档根目录的位置。我在一个单独的分区上有我的 http 文件用于备份,所以我可以从不同的操作系统访问它,我相信它在 httpd 启动之前没有被挂载。我还没有时间解决这个问题。

奇怪的是

  • 这在过去从未发生过(即使之前安装了 F13)

  • 我在 /var/logs/ 的任何日志中都找不到该错误


当我有时间尝试补救措施时,我会在这里向感兴趣的人报告。

我认为即使 Fedora 使用“upstart”而不是“init”,这也应该有效。

如果你这样做了,你需要小心当你获得 httpd 更新时会发生什么 - 它会检测到 httpd 脚本已被更改并将更新的版本保存为“httpd.rpmsave”,以便你可以手动查看更新和根据需要合并您的任何更改。

嗨,
尝试以下步骤..
i: /sbin/service httpd status
ii: 如果 staus 停止,则使用命令
/sbin/chkconfig --list httpd
上述命令的输出::
“httpd 0:off 1: off 2:off 3:off 4:off 5:off 6:off “
iii::然后使用命令 chkconfig
/sbin/chkconfig httpd on
option::: 要在特定级别启动服务,命令是:
/sbin/chkconfig --level 35 httpd on
it 会将级别 3 和 5 的状态更改为 ON 。
iv:: 使用命令“ii”检查级别的状态
它将显示::httpd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
v: 启动服务,命令是
/sbin/service httpd start
vi::now 检查浏览器的 URL http://localhost/
now httpd server start at the boot time...

©著作权归作者所有:来自ZhiKuGroup博客作者没文化的原创作品,如需转载,请注明出处,否则将追究法律责任 来源:ZhiKuGroup博客,欢迎分享。

评论专区
  • 昵 称必填
  • 邮 箱选填
  • 网 址选填
◎已有 0 人评论
搜索
作者介绍
30天热门
×
×
本站会员尊享VIP特权,现在就加入我们吧!登录注册×
»
会员登录
新用户注册
×
会员注册
已有账号登录
×