尝试使用HTTPS时发生错误102

我试图让我的SSL证书在Ubuntu的Apache2上工作。

铬给我只是错误:错误102(净:: ERR_CONNECTION_REFUSED):

在这个configuration上: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 

我该如何解决它?

拒绝连接表明,Apache不在端口443上进行监听,或者有一个防火墙拒绝你在apache主机上的连接或两者之间的连接。

如果apache没有监听连接(你可以用netstat -ntpl | grep:443来检查它),你应该为你的configuration添加一个合适的Listen指令,比如

 Listen 443