【发布时间】:2020-07-27 17:51:21
【问题描述】:
经过一番挫折,我能够设置 SSL/TLS,via these instructions。我确实遇到了一些关于“缺少证书密钥”的错误,但我能够通过重新创建 CSR 文件来解决这个问题,将通用名称修复为:*.opensourceroads.com。
我请求并安装了 Comodo 通配符证书。
一切都在开发子域上工作。
现在,对于生产服务器....
首先,我将私钥和证书文件复制到主目录,并将这些 HOME 版本的权限设置为 755。这允许我从开发服务器下载它们并将它们上传到生产服务器,我这样做了。
顺便说一句,生产服务器托管内容为www.opensourceroads.com
这样做之后,我按照说明安装了 mod_ssl,将私有和证书文件移到了正确的位置,并按照教程更改了它们的权限和所有权。
sudo chown root:root custom.key
sudo chmod 600 custom.key
ls -al custom.key
sudo chown root:root custom.crt
sudo chmod 600 custom.crt
ls -al custom.crt
sudo chown root:root intermediate.crt
sudo chmod 644 intermediate.crt
ls -al intermediate.crt
然后我更改/etc/httpd/conf.d/ssl.conf 以匹配开发服务器上的内容。
但是,当我转到sudo service httpd restart 时,它并没有重新启动。当我journalctl -xe 时,我在日志中看到以下几行:
-- Unit httpd-init.service has begun starting up.
Jul 27 17:30:04 ip-172-31-21-209.us-east-2.compute.internal httpd-ssl-gencerts[56816]: Missing certificate key!
Jul 27 17:30:04 ip-172-31-21-209.us-east-2.compute.internal systemd[1]: httpd-init.service: Main process exited, code=exited, status=1/FAILURE
Jul 27 17:30:04 ip-172-31-21-209.us-east-2.compute.internal systemd[1]: httpd-init.service: Failed with result 'exit-code'.
Jul 27 17:30:04 ip-172-31-21-209.us-east-2.compute.internal systemd[1]: Failed to start One-time temporary TLS key generation for httpd.service.
-- Subject: Unit httpd-init.service has failed
-- Defined-By: systemd
-- Support: https://access.redhat.com/support
--
-- Unit httpd-init.service has failed.
--
-- The result is failed.
Jul 27 17:30:04 ip-172-31-21-209.us-east-2.compute.internal systemd[1]: Starting The Apache HTTP Server...
-- Subject: Unit httpd.service has begun start-up
-- Defined-By: systemd
-- Support: https://access.redhat.com/support
--
-- Unit httpd.service has begun starting up.
Jul 27 17:30:04 ip-172-31-21-209.us-east-2.compute.internal systemd[1]: httpd.service: Main process exited, code=exited, status=1/FAILURE
Jul 27 17:30:04 ip-172-31-21-209.us-east-2.compute.internal systemd[1]: httpd.service: Failed with result 'exit-code'.
Jul 27 17:30:04 ip-172-31-21-209.us-east-2.compute.internal systemd[1]: Failed to start The Apache HTTP Server.
-- Subject: Unit httpd.service has failed
-- Defined-By: systemd
-- Support: https://access.redhat.com/support
--
-- Unit httpd.service has failed.
--
-- The result is failed.
Jul 27 17:30:04 ip-172-31-21-209.us-east-2.compute.internal sudo[56802]: pam_unix(sudo:session): session closed for user root
不知何故,找不到证书密钥!!我重新检查配置行SSLCertificateKeyFile /etc/pki/tls/private/custom.key指定的密钥文件是否存在:ls -al /etc/pki/tls/private/custom.key 。存在,权限600。
我不知道我做错了什么。我是否必须为此服务器创建不同的私钥,和/或重新向 CA 请求证书?
【问题讨论】:
-
我创建了新的私钥和CSR,同名,尝试重新启动httpd,但它仍然没有工作......
标签: linux amazon-web-services apache ssl