我正在Win Server 16下运行WAMP服务器v3.1.3,托管了多个网站。在我决定将SSL证书添加到我的一个站点(Apache虚拟主机)之前,一切都很好。现在,Web服务器正在拒绝从外部到该站点的HTTPS连接,但是我能够通过HTTPS在本地正确访问该站点。所有其他站点都可以正常运行。显然我在某个地方弄乱了配置,但不确定在哪里,这可能是一个愚蠢的错误。
在httpd.conf中,我启用了ssl_module,socache_shmcb模块,并且包含了httpd-ssl.conf。另外,我已将证书和密钥放在Apache conf文件夹中。 Httpd说Sintax可以,但是我无法在日志中检测到任何错误。其他大多数设置都有其默认值。 Web服务器应该在端口443上进行侦听,但拒绝来自外部的连接。我可以在本地正常访问该站点,并且可以正确指示HTTPS。我使用相同的url(https:// ...; 3)在本地和远程访问它,该站点在本地使用HTTPS正常工作;远程,我收到“ ERR_CONNECTION_REFUSED” HTTP错误。 Apache版本是2.4.33; 任何帮助将不胜感激!
以下是一些提示:
httpd-vhosts.conf 看起来像这样:
<VirtualHost *:443>
SSLEngine On
SSLCertificateFile
"C:/WAMP64/bin/apache/apache2.4.33/conf/key/certificate.crt"
SSLCertificateKeyFile "C:/WAMP64/bin/apache/apache2.4.33/conf/key/key.key"
SSLCACertificateFile "C:/WAMP64/bin/apache/apache2.4.33/conf/key/ca.crt"
ServerName domain.com
ServerAlias www.domain.com
DocumentRoot "c:/wamp64/www/domain"
<Directory "c:/wamp64/www/domain/">
Require all granted
</Directory>
</VirtualHost>
#
<VirtualHost *:80>
ServerName domain.com
ServerAlias www.domain.com
DocumentRoot "c:/wamp64/www/domain"
<Directory "c:/wamp64/www/domain/">
Require all granted
</Directory>
</VirtualHost>
#
<VirtualHost *:80>
ServerName site2.domain.com
DocumentRoot "c:/wamp64/www/site2"
<Directory "c:/wamp64/www/site2/">
Require all granted
</Directory>
</VirtualHost>
httpd-ssl.conf 看起来像这样:
Listen 443
SSLCipherSuite HIGH:MEDIUM:!MD5:!RC4:!3DES
SSLProxyCipherSuite HIGH:MEDIUM:!MD5:!RC4:!3DES
SSLHonorCipherOrder on
SSLProtocol all -SSLv3
SSLProxyProtocol all -SSLv3
SSLPassPhraseDialog builtin
SSLSessionCache
"shmcb:C:/WAMP64/bin/apache/apache2.4.33/logs/ssl_scache(512000)"
SSLSessionCacheTimeout 300
<VirtualHost _default_:443>
DocumentRoot "c:/WAMP64/www"
ServerName domain.com:443
ServerAdmin admin@domain.com
ErrorLog "C:/WAMP64/bin/apache/apache2.4.33/logs/error.log"
TransferLog "C:/WAMP64/bin/apache/apache2.4.33/logs/access.log"
SSLEngine on
SSLCertificateFile "C:/WAMP64/bin/apache/apache2.4.33/conf/key/certificate.crt"
SSLCertificateKeyFile "C:/WAMP64/bin/apache/apache2.4.33/conf/key/key.key"
SSLCertificateChainFile "C:/WAMP64/bin/apache/apache2.4.33/conf/key/ca.crt"
<FilesMatch "\.(cgi|shtml|phtml|php)$">
SSLOptions +StdEnvVars
</FilesMatch>
<Directory "C:/WAMP64/www">
SSLOptions +StdEnvVars
</Directory>
BrowserMatch "MSIE [2-5]" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
CustomLog "C:/WAMP64/bin/apache/apache2.4.33/logs/ssl_request.log" \
"%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
</VirtualHost>
答案 0 :(得分:0)
已解决。当然,原因是一个愚蠢的错误-我的路由器未打开端口443 :)