【发布时间】:2020-03-19 23:32:52
【问题描述】:
你好,问题来了
我在 CentOS 上生成了 CSR,并在 Comodo 上购买了 SSL。
我在 ssl.conf 中添加了以下几行
ServerName mydomain.com
DocumentRoot /var/www/html
SSLEngine on
SSLCertificateKeyFile /etc/pki/tls/certs/mydomain.key
SSLCertificateFile /etc/pki/tls/certs/mydomain.crt
SSLCACertificateFile /etc/pki/tls/certs/mydomainCA.crt
以下几行到 httpd.conf
<VirtualHost *:80>
ServerName thedomain.com
Redirect "/" "https://thedomain.com/"
</VirtualHost>
之后,当我执行 systemctl restart httpd 时,会出现以下错误:
Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl-xe" 了解详情。
当我查看 journalctl -xe 了解详细信息时,它的内容如下:
-- 主题:单元httpd.service已完成启动 -- 定义者:systemd
-- 支持:http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 单元 httpd.service 已完成启动。
-- 启动结果完成。 11 月 24 日 18:36:01 MyWay polkitd [568]: unregistered Authentication Agent for unix-process:6639:684652621 (系统总线名称:1.4409,对象路径 /org/freedesktop/PolicyKit1/AuthenticationAgent,语言环境 e Nov 24 18:36:04 MyWay sshd [6652]:来自 80.241.211.237 的无效用户 oracle 端口 54600 Nov 24 18:36:04 MyWay sshd[6652]: input_userauth_request: 无效用户 oracle [preauth] Nov 24 18:36:04 MyWay sshd[6652]: pam_unix(sshd:auth): 校验通过;用户未知 11 月 24 日 18:36:04 MyWay sshd[6652]: pam_unix(sshd:auth): 认证失败;登录名= uid=0 euid=0 tty=ssh ruser=rhost=vmi306916.contaboserver.net 11 月 24 日 18:36:06 MyWay sshd [6652]:无效用户 oracle 的密码失败 从 80.241.211.237 端口 54600 ssh2 Nov 24 18:36:06 MyWay sshd[6652]: 从 80.241.211.237 端口 54600:11 收到断开连接:正常 关机,谢谢你玩 [preauth] Nov 24 18:36:06 MyWay sshd [6652]:从 80.241.211.237 端口 54600 [preauth] 断开连接 24 18:36:16 MyWay sshd [6651]:收到与 112.85.42.94 的断开连接 端口 31545:11:[preauth] 11 月 24 日 18:36:16 MyWay sshd [6651]: 从 112.85.42.94 端口 31545 断开 [preauth] Nov 24 18:36:18 MyWay polkitd[568]:注册身份验证代理 Unix进程:6655:684654361(系统总线名称:1.4410 [/usr/bin/pkttyagent --notify-fd 5 --fallback],对象路径 /org/freedes 11 月 24 日 18:36:18 MyWay systemd[1]:停止 Apache HTTP 服务器... -- 主题:单元 httpd.service 已开始关闭 -- 定义者:systemd
-- 支持:http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 单元 httpd.service 已开始关闭。 11 月 24 日 18:36:19 MyWay systemd[1]:停止了 Apache HTTP 服务器。 -- 主题:单元 httpd.service 已完成关闭 -- 定义者:systemd
-- 支持:http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 单元 httpd.service 已完成关闭。 11 月 24 日 18:36:19 MyWay systemd[1]:启动 Apache HTTP 服务器... -- 主题:单元httpd.service已经开始启动 -- 定义者:systemd
-- 支持:http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 单元 httpd.service 已开始启动。 11 月 24 日 18:36:19 MyWay systemd[1]: httpd.service: 主进程退出,代码=退出, status=1/FAILURE Nov 24 18:36:19 MyWay kill[6667]: kill: 找不到 进程“”11月24日18:36:19 MyWay systemd [1]:httpd.service:控制 进程退出,code=exited status=1 Nov 24 18:36:19 MyWay systemd[1]: 无法启动 Apache HTTP 服务器。 -- 主题:单元 httpd.service 失败 -- 定义者:systemd
-- 支持:http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 单元 httpd.service 失败。
-- 结果失败。 11 月 24 日 18:36:19 MyWay systemd[1]:单元 httpd.service 进入失败状态。 11 月 24 日 18:36:19 MyWay systemd[1]: httpd.service 失败。 11 月 24 日 18:36:19 MyWay polkitd[568]:未注册 unix-process:6655:684654361 的身份验证代理(系统总线名称 :1.4410,对象路径/org/freedesktop/PolicyKit1/AuthenticationAgent, 语言环境 [
所以我检查了很多操作系统解决方案,但这个问题仍然存在,请注意,当我注释掉 httpd.conf 和 ssl.conf 中的所有更改时,apache 开始正常工作。
提前谢谢大家
【问题讨论】:
-
查看 apache 的错误日志(请参阅可以找到此文件的 apache 配置)。我的猜测是,您在配置中提供的文件之一要么不存在,要么类型错误(即交换密钥和证书)或编码(预期为 PEM,也许您使用过 DER)。