我想做的是将我的网站定向到 Amazon EC2 实例上,以便我能够在 HTTPS 协议(protocol)上打开。我的网站以前运行过,但警告说它没有有效的证书,使用此链接示例 https://my.site.name.edu但现在当我尝试访问该站点时,会收到“网页不可用”提示。
请注意我有:
使用 Apache 在 Linux 服务器上为这个测试站点安装了 Drupal
我的 EC2 实例附加到弹性 IP
使用本指南中的步骤:Creating, Uploading, and Deleting Server Certificates
有效的 CA 签署的 Apache 证书
安装在/home/ec2-user 文件夹中的 openssl-1.0.1f 文件
使用此链接创建虚拟主机:http://ananthakrishnanravi.wordpress.com/2012/04/15/configuring-ssl-and-https-for-your-website-amazon-ec2/
下面是发生错误的时候,在尝试解决HTTPS访问问题时
我尝试更改此链接中的 ssl.conf 文件以查看是否可以解决问题:Setup an SSL certificate on an EC2 instance
我复制了一个新的 ssl.conf 文件,注释了旧的 SSLCertificateKeyFile、SSLCertificateFile 和 SSLCertificateChainFile。然后,在我像这样编写前四行代码后,我将复制的、修改后的文件粘贴到目录中:
<VirtualHost 00.00.00.00:443>
SSLCertificateKeyFile /home/ec2-user/castestingapache/privatekey.pem
SSLCertificateFile /home/ec2-user/castestingapache/my_site_name_edu.pem
SSLCertificateChainFile /home/ec2-user/castestingapache/my_site_name_edu_interm.crt
但是当我重新启动 Apache 时:
service httpd restart
我收到此错误消息:
Stopping httpd: [FAILED]
Starting httpd: [Wed May 21 14:44:31 2014] [warn] module ssl_module is already loaded, skipping
(98)Address already in use: make_sock: could not bind to address [::]:443
[ OK ]
我的 httpd.conf 是这样设置的:
<VirtualHost 00.00.00.00:443> #Same as the IP in the ssl.conf#
ServerAdmin ec2-user@ec2-00-00-00-00.compute.amazonaws.com
DocumentRoot /var/www/html
ServerName https://my.site.name.edu
SSLEngine on
SSLProtocol all -SSLv2
SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM
# ErrorLog logs/errorlogs
# CustomLog logs/custom
SSLCertificateFile /home/ec2-user/castestingapache/my_site_name_edu.pem
SSLCertificateKeyFile /home/ec2-user/castestingapache/privatekey.pem
SSLCertificateChainFile /home/ec2-user/castestingapache/my_site_name_edu_interm.crt
# SSLCACertificateFile /etc/httpd/conf/bundle.txt
SetEnvIf User-Agent “.*MSIE.*” nokeepalive ssl-unclean-shutdown
# CustomLog /usr/local/apache/logs/ssl_request_log \
# “%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \”%r\” %b”
</VirtualHost>
编辑: 我尝试恢复到旧的 ssl.conf,但是当我尝试重新启动 Apache 时,它给了我同样的错误。 这个问题已经解决了 我不得不删除其中一个 ssl.conf,即使我已经重命名了它...
更新 我已将此行添加到 httpd.conf 文件中:
NameVirtualHost 00.00.00.00:443
我认为问题是我的证书没有指向这个 IP 地址。
更新 我刚刚在这里运行了证书安装检查器测试 http://ssltool.com/?action=sslCheckOpenSSL这就是我得到的:
注意:IP 12-34-56-78 是我在 AWS EC2 实例上的私有(private) IP 地址。
非常感谢任何帮助。
谢谢,
最佳答案
呃....答案一直在这个链接中...
Setup an SSL certificate on an EC2 instance
ssl.conf 中的这一行:
<VirtualHost 00.000.000.00:443>
必须更改为:
<VirtualHost _default_:443>
添加其余部分:
SSLCertificateKeyFile /etc/ssl/mydomain_com.key
SSLCertificateFile /etc/ssl/mydomain_com.crt
SSLCertificateChainFile /etc/ssl/mydomain_com.ca-bundle
</VirtualHost>
瞧!您的 HTTPS: 链接应该有效...
关于apache - (98)地址已在使用:make_sock:无法绑定(bind)到地址 [::]:443,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23787574/