添加SSL证书后,Apache无法启动

时间:2019-11-24 14:48:06

标签: apache ssl centos

你好,这是问题所在

我在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重新启动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]:unix-process的未注册身份验证代理:6639:684652621   (系统总线名称:1.4409,对象路径   / org / freedesktop / PolicyKit1 / AuthenticationAgent,语言环境11月24日   18:36:04 MyWay sshd [6652]:来自80.241.211.237的无效用户oracle   端口54600 11月24日18:36:04 MyWay sshd [6652]:input_userauth_request:   无效的用户oracle [preauth] 11月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 11月24日18:36:06 MyWay sshd [6652]:   从80.241.211.237端口54600:11收到断开连接:正常   关机,谢谢您的参与[preauth] 11月24日18:36:06 MyWay   sshd [6652]:已从80.241.211.237端口54600断开连接[preauth] 11月   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] 11月24日18:36:18   MyWay polkitd [568]:已注册的身份验证代理   unix-process:6655:684654361(系统总线名称:1.4410   [/ usr / bin / pkttyagent --notify-fd 5 --fallback],对象路径   / org / freedes Nov 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 Server。   -主题:httpd.service单元已关闭   -定义:systemd

     

-支持:http://lists.freedesktop.org/mailman/listinfo/systemd-devel

     

-单元httpd.service已完成关闭。 11月24日18:36:19 MyWay systemd [1]:启动Apache HTTP Server ...   -主题: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 11月24日18:36:19 MyWay杀死[6667]:杀死:找不到   process“” Nov 24 18:36:19 MyWay systemd [1]:httpd.service:控制   进程已退出,代码=退出状态= 11月24日18:36:19 MyWay systemd [1]:   无法启动Apache HTTP Server。   -主题:单元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进程的身份验证代理:6655:684654361(系统总线名称   :1.4410,对象路径/ org / freedesktop / PolicyKit1 / AuthenticationAgent,   区域设置e [

因此,我检查了很多操作系统解决方案,但此问题仍然存在,请注意,当我注释掉httpd.conf和ssl.conf中的所有更改后,apache便开始正常工作。

预先感谢

1 个答案:

答案 0 :(得分:0)

已解决

将文件重命名为PEM有助于解决该问题,此外,我还遇到了其他一些导致错误的问题(查找ata apache日志有助于解决这些问题)

  1. 用于Apache的内存已满,所以我不得不增加它。

  2. 我在ssl.conf文件中复制了SSLCertificateKeyFile,并注释掉了默认文件链接。

相关问题