SSL certificate does not work with domain name

Discussion in 'Apache' started by eb110k, Jan 17, 2008.

  1. #1
    Hello,
    I"m a newbie to apache and my apache is Apache/1.3.37 and running on Fedora Core 6 64bit.

    I have installed all necessary .crt files and my website is running fine.
    However, https://www.mydomain.com does not work, but https://myipaddress works (i.e. https://192.168.0.1).

    I know I'm missing something on httpd.conf but I cannot find it.

    Here is virtual host part of my httpd.conf.
    This is only one website is running on my webserver.
    Please some one advise.

    Thank you.

    
    
    NameVirtualHost 192.168.0.1:80
    
    <VirtualHost 192.168.0.1:80> 
        ServerName mydomain.com
        ServerAlias www.mydomain.com 
        ServerAdmin webmaster@mydomain.com
        DocumentRoot /home/mydomain/public_html 
        <IfModule mod_suphp.c>
            suPHP_UserGroup webs webs
        </IfModule>
        <IfModule !mod_disable_suexec.c>
            User webs
            Group webs
        </IfModule>
        BytesLog /usr/local/apache/domlogs/mydomain.com-bytes_log
        CustomLog /usr/local/apache/domlogs/mydomain.com combined
        ScriptAlias /cgi-bin/ /home/mydomain/public_html/cgi-bin/
    </VirtualHost>
    
    
    
    <IfDefine SSL>
    
    <VirtualHost 192.168.0.1:443>
        ServerName mydomain.com
        ServerAlias www.mydomain.com
        DocumentRoot /home/mydomain/public_html
        ServerAdmin webmaster@mydomain.com
        UseCanonicalName off
        UserDir public_html
        <IfModule mod_suphp.c>
            suPHP_UserGroup webs webs
        </IfModule>
        <IfModule !mod_disable_suexec.c>
            User webs
            Group webs
        </IfModule>
        BytesLog /usr/local/apache/domlogs/mydomain.com-bytes_log
        ScriptAlias /cgi-bin/ /home/mydomain/public_html/cgi-bin/
        SSLEngine on
        SSLCertificateFile /etc/ssl/certs/mydomain.com.crt
        SSLCertificateKeyFile /etc/ssl/private/mydomain.com.key
        SSLCACertificateFile /etc/ssl/certs/mydomain.com.cabundle
        SSLLogFile /usr/local/apache/domlogs/mydomain.com-ssl_data_log
        CustomLog /usr/local/apache/domlogs/mydomain.com-ssl_log combined
        SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown
    </VirtualHost>
    
    </IfDefine>
    
    
    
    
    Code (markup):

     
    eb110k, Jan 17, 2008 IP
  2. Krnl

    Krnl Peon

    Messages:
    60
    Likes Received:
    3
    Best Answers:
    1
    Trophy Points:
    0
    #2
    Krnl, Jan 18, 2008 IP
  3. greys

    greys Peon

    Messages:
    49
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Change your
    to
    , and this will work.

    The reason you have it working for your http website is because of the
    NameVirtualHost 192.168.0.1:80, which basically tells your Apache to listen for any requests at port 80 (standard http port) and to then pick the vitualhost based on the hostname.

    You can't have NameVirtualHost for SSL websites, there can only be one host with :443 port in the standard Apache configuration.

    Good luck!
     
    greys, Jan 18, 2008 IP
  4. Krnl

    Krnl Peon

    Messages:
    60
    Likes Received:
    3
    Best Answers:
    1
    Trophy Points:
    0
    #4
    You can have more than one :443 virtual host in the same apache config just as long as they don't share the same IP address.
     
    Krnl, Jan 18, 2008 IP
  5. jayshah

    jayshah Peon

    Messages:
    1,126
    Likes Received:
    68
    Best Answers:
    1
    Trophy Points:
    0
    #5
    Theres actually a mod (mod_gnutils I believe) that allows you to have multiple SSL enabled domains on a single IP (using NameVirtualHost). It actually works (because I've used it), so you may want to give it a try (not 100% compatible with all browsers, mind).

    Jay
     
    jayshah, Jan 22, 2008 IP
  6. Krnl

    Krnl Peon

    Messages:
    60
    Likes Received:
    3
    Best Answers:
    1
    Trophy Points:
    0
    #6
    One would still need to buy multiple SSL certificates even if the same IP is used for SSL, yes? That's my biggest issue with SSL...having to buy a separate certificate for each domain...it kinda sucks spending the kind of money it takes to SSL several sites.
     
    Krnl, Jan 23, 2008 IP
  7. greenfday6

    greenfday6 Member

    Messages:
    83
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    43
    #7
    from what I understand if you use NamVirtualHost you still get a ssl connection, but your browser will throw a dns error.
     
    greenfday6, Jan 23, 2008 IP