尝试使用 HTTPS 时出现错误 102

尝试使用 HTTPS 时出现错误 102

我尝试让我的 SSL 证书与 ubuntu 上的 apache2 一起使用。

Chrome 只给我错误:错误 102 (net::ERR_CONNECTION_REFUSED):

在此配置上:ServerAdmin webmaster@localhost

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 ${APACHE_LOG_DIR}/error.log

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn

CustomLog ${APACHE_LOG_DIR}/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 /etc/apache2/ssl/swenet_info.crt
SSLCertificateKeyFile /etc/apache2/ssl/swenet_info.key  

<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
# MSIE 7 and newer should be able to use keepalive
BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown

我该如何修复它?

答案1

连接被拒绝表明 Apache 没有监听端口 443,或者是 Apache 主机上的防火墙拒绝了您的连接,或者两者之间有冲突。

如果 apache 没有监听连接(你可以用 netstat -ntpl | grep :443 检查),你应该添加一个适当的指令到您的配置,例如

Listen 443

相关内容