Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am getting a "Unable to connect" error message when I try to load the https version of a website in Firefox.

There is no error message in the log file, only:

[Thu Dec 09 16:55:24 2010] [warn] Init: Session Cache is not configured [hint: SSLSessionCache]
[Thu Dec 09 16:55:25 2010] [notice] Digest: generating secret for digest authentication ...
[Thu Dec 09 16:55:25 2010] [notice] Digest: done
[Thu Dec 09 16:55:26 2010] [notice] Apache/2.2.16 (FreeBSD) mod_ssl/2.2.16 OpenSSL/0.9.8n DAV/2 PHP/5.3.3 with Suhosin-Patch configured -- resuming normal operations

I followed this guide: http://www.akadia.com/services/ssh_test_certificate.html

My configuration file looks like this:

<Directory "/usr/local/www/apache22/data">
    #
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    #
    # The Options directive is both complicated and important.  Please see
    # http://httpd.apache.org/docs/2.2/mod/core.html#options
    # for more information.
    #
    Options Indexes FollowSymLinks

    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   Options FileInfo AuthConfig Limit
    #
    AllowOverride All

    #
    # Controls who can get stuff from this server.
    #
    Order allow,deny
    Allow from all
</Directory>

NameVirtualHost *:443
<VirtualHost *:443>
    DocumentRoot "/usr/local/www/apache22/data"

    ServerName "domain.name"

    SSLEngine on
    SSLCertificateFile /some-folder/ssl-key/server.crt
    SSLCertificateKeyFile /some-folder/ssl-key/server.key

    CustomLog "/some-folder/log/httpd-ssl_request.log" \
          "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
</VirtualHost>

NameVirtualHost *:80
<VirtualHost *:80>
    DocumentRoot "/usr/local/www/apache22/data"

    ServerName "domain.name"
</VirtualHost>

(Redacted a small amount, but you should be able to see what I've done right/wrong...)

share|improve this question
    
Cross-posted from here on GregS' advice: stackoverflow.com/questions/4401452/… –  olive Dec 10 '10 at 11:11

1 Answer 1

up vote 2 down vote accepted

Apache doesn't listen on port 443 (the port used for SSL communication) by default (to my knowledge). So, in order to be able to connect to to your newly configured SSL server, you need to include the following line in the configuration:

Listen 443

Configuring a virtual host doesn't automatically makes the server listen on the port specified in the configuration.

share|improve this answer
    
Thanks! Mmm, a shame the guide made no mention of that. :) –  olive Dec 10 '10 at 11:37

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.