修改:看起来this issue是根本原因。有问题的网站是一个http网站,但它会自动重定向到https,所以我决定安装一个SSL证书来查看结果。 / end edit。
我跟着the answer here为我的WampServer 3.1.0 64位创建了本地SSL证书。
我制作了我们网站的本地副本,将数据库迁移到新的本地URL(www.superiorit.dev),在httpd-vhosts.conf
中创建了一个条目,并在<VirtualHost www.superiorit.dev:443>
中添加了C:\wamp64\bin\apache\apache2.4.27\conf\extra\httpd-ssl.conf
条目{1}}包含.cert
和.key
文件的正确路径。
当我尝试在浏览器中加载https://www.superiorit.dev
时,收到错误:
This site can’t be reached www.superiorit.dev refused to connect. Try: Checking the connection Checking the proxy and the firewall ERR_CONNECTION_REFUSED
这是http-vhosts.conf
中的条目:
<VirtualHost www.superiorit.dev:8080>
ServerName www.superiorit.dev
ServerAlias www.superiorit.dev
DocumentRoot "C:/wamp64/www/superiorit"
<Directory "C:/wamp64/www/superiorit">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>
这是http-ssl.conf
中的条目:
<VirtualHost www.superiorit.dev:443>
DocumentRoot "c:/wamp64/www/superiorit"
ServerName www.superiorit.dev:443
ServerAdmin steve.doig@superiorit.dev
ErrorLog "c:/wamp64/logs/error.log"
TransferLog "c:/wamp64/logs/access.log"
SSLEngine on
SSLCertificateFile "C:/wamp64/bin/apache/apache2.4.27/conf/demoCA/cacert.cert"
SSLCertificateKeyFile "C:/wamp64/bin/apache/apache2.4.27/conf/demoCA/private/cacert.key"
<FilesMatch "\.(cgi|shtml|phtml|php)$">
SSLOptions +StdEnvVars
</FilesMatch>
<Directory "c:/Apache24/cgi-bin">
SSLOptions +StdEnvVars
</Directory>
BrowserMatch "MSIE [2-5]" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
CustomLog "c:/Apache24/logs/ssl_request.log" \
"%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
</VirtualHost>
帮助表示赞赏。