我在使用sslencryption时遇到了Apache 2.4.18服务器的问题。 我的服务器设置是:apache服务器将端口80(http)上的所有内容redirect到端口443(ssl),这是通过不同的站点configuration实现的。
现在我的问题是:如果我打开链接https://www.example.com ,我得到我想要的网站。
但是,如果我打开https://example.com ,我得到错误: ERR_CONNECTION_REFUSED
为什么这样,我该如何解决呢?
虚拟主机文件的SSL:
<IfModule mod_ssl.c> <VirtualHost *:443> ServerAdmin [email protected] DocumentRoot /var/www/html ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined # SSLCertificateFile directive is needed. SSLCertificateFile /etc/letsencrypt/live/footprintgaming.de/fullchain.pem SSLCertificateKeyFile /etc/letsencrypt/live/footprintgaming.de/privkey.pem #SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire <FilesMatch "\.(cgi|shtml|phtml|php)$"> SSLOptions +StdEnvVars </FilesMatch> <Directory /usr/lib/cgi-bin> SSLOptions +StdEnvVars </Directory> </VirtualHost> </IfModule> # vim: syntax=apache ts=4 sw=4 sts=4
footprintgaming.de有一个Alogging指向89.31.143.1,它似乎住在AS15598。
www.footprintgaming.de最终解决到46.5.192.81,似乎住在AS29562。
似乎没有任何关联的IPv6地址logging。
“连接被拒绝”意味着TCP SYN被TCP RST / ACK响应。 这通常发生在没有绑定到IP地址和TCP端口的监听套接字时,但也可能由防火墙引起。
我能够连接到80端口都很好。
我能够连接到后者只需443端口,但不是前者。 这匹配你的结果。
有些事情要检查:
netstat -an | grep 443 netstat -an | grep 443将是一个开始。 iptables -L -n开始并从那里开始。 其他操作系统将是相似但不同的。 mod_ssl模块是否实际加载? 试试apachectl -M (见这里 )。 apachectl configtest和apachectl graceful应该是你的朋友。 ServerName在哪里? 检查你的apachectl -S输出。 (这通常会导致你得到错误的内容或在这种情况下HTTPS错误的证书,而不是一个连接拒绝的错误,但我包括它,因为你可能会遇到,第二你得到一个TCP连接.. 。)