无法连接(尝试在ubuntu中设置SSL)

时间:2014-12-15 12:02:15

标签: apache ubuntu ssl https

我购买了SSL证书并经过验证。然后供应商向我发送了文件。

这是我第一次向ubuntu添加SSL。

在Apache的我的站点启用文件夹中,我添加了一个新的conf文件example-ssl.conf

然后我添加了以下内容

<IfModule mod_ssl.c>
    <VirtualHost _default_:443>
        ServerAdmin info@example.ie
        ServerName example.ie
        ServerAlias www.example.ie

        DocumentRoot /var/www/html/example/

        #LogLevel info ssl:warn

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined


        SSLEngine on


        SSLCertificateFile  /etc/ssl/certs/example.crt
        SSLCertificateKeyFile /etc/ssl/private/example_private.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

        BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown

    </VirtualHost>
</IfModule>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

然后我跑了sudo a2ensite example-ssl.conf

但是错了......

Site example-ssl not properly enabled: /etc/apache2/sites-enabled/example-ssl.conf is a real file, not touching it

所以我决定使用与上面相同的信息更改default-ssl.conf,

然后我运行了sudo a2ensite default-ssl.conf

我重启了apache,

但是当我转到https://www.example.com时,我无法连接错误,就好像该网站根本不存在一样。 “Firefox无法在www.example.ie上建立与服务器的连接。”

谢谢

编辑:有点背景,我使用Digital Ocean进行设置。我现在意识到当我尝试使用https时,我的所有飞溅都会发生这种情况。所以也许它是linux上更通用的设置我需要启用

1 个答案:

答案 0 :(得分:0)

你不会显示任何&#34;听443&#34;指示。如果您希望Apache在新端口上侦听连接,那么这就是第一步。

如果由于你的ifModule而没有加载mod_ssl,那么你发布的所有内容都是无操作的。