(98)已在使用的地址:make_sock:无法绑定到地址[::]:443

时间:2014-05-21 15:24:38

标签: apache ssl amazon-web-services amazon-ec2

我要做的是将我的网站引导到Amazon EC2实例上,以便我能够在HTTPS协议上打开。我的网站之前正在运行,但警告说它没有有效的证书,使用此链接示例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运行了证书安装检查程序测试,这就是我得到的: enter image description here

注意:IP 12-34-56-78是我的AWS EC2实例上的私有IP地址。

非常感谢任何帮助。

谢谢,

1 个答案:

答案 0 :(得分:0)

呃......答案一直都在这个环节......

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:链接应该有用......