无法使用SSL与Apache一起工作

好吧,所以我试图configuration我的服务器接受SSL连接,我无法得到它的工作。 我知道网站上有很多类似的问题,但是我到目前为止所遇到的每个问题似乎都没有帮助。

我会尽可能多地发布信息,希望你能帮上忙。

我的apache版本是:2.2.14(在Ubuntu上运行)。 下面的信息似乎表明,SSLconfiguration和运行良好,但是当我尝试访问https://website.com请求超时。

我通过GoDaddy获得了一个SSL证书,然后按照这个过程生成.crt文件。

我有以下文件:

/home/ubuntu/ssl/website.com.crt /home/ubuntu/ssl/website.com.key /home/ubuntu/ssl/gd_bundle.crt 

根据我的configuration文件:

/etc/apache2/ports.conf

 NameVirtualHost *:80 NameVirtualHost *:443 Listen 80 Listen 443 

在/ etc / apache2的/启用的站点- / 000默认的SSL

 <VirtualHost *:443> ServerAdmin webmaster@localhost ServerName website.com DocumentRoot /var/www <Directory /> Options FollowSymLinks AllowOverride None </Directory> <Directory /var/www/> Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all </Directory> ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ <Directory "/usr/lib/cgi-bin"> AllowOverride None Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch Order allow,deny Allow from all </Directory> ErrorLog /var/log/apache2/error.log LogLevel warn CustomLog /var/log/apache2/ssl_access.log combined Alias /doc/ "/usr/share/doc/" <Directory "/usr/share/doc/"> Options Indexes MultiViews FollowSymLinks AllowOverride None Order deny,allow Deny from all Allow from 127.0.0.0/255.0.0.0 ::1/128 </Directory> SSLEngine on SSLCertificateFile /home/ubuntu/ssl/website.com.crt SSLCertificateKeyFile /home/ubuntu/ssl/website.com.key SSLCertificateChainFile /home/ubuntu/ssl/gd_bundle.crt <FilesMatch "\.(cgi|shtml|phtml|php)$"> SSLOptions +StdEnvVars </FilesMatch> <Directory /usr/lib/cgi-bin> SSLOptions +StdEnvVars </Directory> BrowserMatch "MSIE [2-6]" \ nokeepalive ssl-unclean-shutdown \ downgrade-1.0 force-response-1.0 BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown </VirtualHost> 

该网站正常工作正常HTTP,所以我不会发布的configuration(我可以,如果你想看到它!)

  • Apache重新启动没有错误。
  • 在错误日志文件中似乎没有任何错误。

netstat命令显示apache在正确的端口上侦听:

  netstat -tap | grep https tcp 0 0 *:https *:* LISTEN 24840/apache2 

我遇到s_client命令也可能是有用的。

  openssl s_client -connect localhost:443 

使用本地主机时,一切似乎是正常的(不能说我知道什么是正常的,但有很多相关的信息输出,并没有出现任何错误)。

  openssl s_client -connect <ip-address>:443 openssl s_client -connect website.com:443 

上述两个输出错误:

  connect: Connection timed out connect:errno=110 

我在尝试获得SSL的工作时遇到了很多上面的诊断信息,但是我不知道如何处理这些信息,现在我被困住了。

如果你需要更多的信息,只需要问!

谢谢,汤姆。

错误

 Connection timed out 

表示openssl甚至无法完成服务器端口443上的TCP握手。

最可能的问题是你的iptablesconfiguration或者你的托pipe服务提供商运行的外部防火墙。

一个简单的谷歌SSL错误110带来了GoDaddy和SSL的许多问题。

如果GoDaddy也是你的主持人,我会build议把他们带走,因为这似乎是一个问题。

我注意到:

 <Directory "/usr/share/doc/"> Options Indexes MultiViews FollowSymLinks AllowOverride None Order deny,allow Deny from all Allow from 127.0.0.0/255.0.0.0 ::1/128 </Directory> 

特别是Allow from行。 所以基本上只允许从本地连接。 因此,连接到本地主机:443将正常工作,但通过面向外部的IP地址连接将无法正常工作。

我会比较这与任何你在非SSL的<VirtualHost>部分,并使用它。