【问题标题】:Unable to start httpd service on Centos 7 "GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: Cannot determine user of subject"无法在 Centos 7 上启动 httpd 服务“GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: 无法确定主题用户”
【发布时间】:2020-11-11 11:15:00
【问题描述】:

当尝试(重新)启动 httpd 服务时,我收到以下错误:

** (pkttyagent:2574): WARNING **: 01:33:55.345: Unable to register authentication agent:
GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: Cannot determine user of subject Error registering authentication agent:
GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: Cannot determine user of subject (polkit-error-quark, 0) Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details.

然后

systemctl status httpd.service

没有说明问题:

httpd.service - Web server Apache
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Wed 2020-07-22 01:33:55 BST; 26min ago
  Process: 2578 ExecStart=/usr/local/apache/bin/apachectl start (code=exited, status=1/FAILURE)

Jul 22 01:33:55 server... systemd[1]: Starting Web server Apache...
Jul 22 01:33:55 server... systemd[1]: httpd.service: control process exited, code=exited status=1
Jul 22 01:33:55 server... systemd[1]: Failed to start Web server Apache.
Jul 22 01:33:55 server... systemd[1]: Unit httpd.service entered failed state.
Jul 22 01:33:55 server... systemd[1]: httpd.service failed.

这可能是什么原因造成的?我应该去哪里调试?

【问题讨论】:

  • 分享/usr/local/apache/bin/httpd -t命令输出。
  • /usr/local/apache/bin/httpd -t 显示Syntax OK
  • 使用 /usr/local/apache/bin/httpd -k start 启动 Apache 并告诉我结果。
  • /usr/local/apache/bin/httpd -k start没有错误报告
  • 您使用ps -ef | grep httpd检查进程是否启动。如果进程成功启动,则使用/usr/local/apache/bin/httpd -k start 停止进程并开始使用systemctl start httpd

标签: apache centos polkit


【解决方案1】:

[Thu Jul 23 05:40:44.885963 2020] [ssl:emerg] [pid 2877:tid 140514669713280] AH02565:证书和私钥不匹配

看起来密钥和证书不匹配。请检查密钥和证书文件的 md5。

【讨论】:

  • 感谢 Pandurang :) 奇怪的是导致问题的 2 个证书具有相同的时间戳,但我需要替换它们才能启动 Apache 服务器。只能想象原始证书文件以某种方式损坏
猜你喜欢
  • 2018-09-16
  • 1970-01-01
  • 2020-07-12
  • 2015-07-22
  • 1970-01-01
  • 2016-05-31
  • 1970-01-01
  • 2020-10-21
  • 2019-02-08
相关资源
最近更新 更多