Apache 2, SSL and Virtual Hosts: Help!

I'm deeply confused in this situation here. I'm not that skillful when it comes to advance Apache configuration, like virtual hosts.

I'm trying to setup SSL for my sites on my development Linux server. Each site has its own directory in /home/myUser/www

OpenSSL is installed, mod_ssl is enabled, and I've created the key and certificate on my local server.

Now I need to figure out how to setup the virtual hosts with SSL enabled.

Using a SitePoint SSL article as a guide, the author provides this portion of code to follow:

Code:
<IfDefine HAVE_SSL>
    <VirtualHost 10.0.0.5:443>
        DocumentRoot /home/sites/domainname.com/html
        ServerName domainname
        ServerAlias domainname
        ServerAdmin domainnameEmail
        ErrorLog /home/sites/domainname.com/logs/error_log
        TransferLog / home/sites/domainname.com/logs/access_log
        SSLEngine on
        SSLCertificateFile /etc/httpd/conf/ssl.crt/domainname.com.crt
        SSLCertificateKeyFile /etc/httpd/conf/ssl.key/domainname.com.key
        SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown
    </VirtualHost>
</IfDefine>
Here is what my virtual host section of httpd.conf looks like:

Code:
NameVirtualHost *:80

<VirtualHost *:80>
     ServerName 192.168.3.105
     DocumentRoot /home/myUser/www
</VirtualHost>

<VirtualHost *:80>
     ServerName myTestSite
     DocumentRoot /home/myUser/www/myTestSite
</Virtualhost>
I need to setup the port 443 version of these virtual hosts somehow with the document root being /home/myUser/www/ssl or /home/myUser/www/myTestSite/ssl

So I can access them in the browser via http$://myTestSite/ or http$://192.168.3.105/

Would I do this by something like:

Code:
<IfDefine HAVE_SSL>
    NameVirtualHost *:443
    
    <VirtualHost myTestSite:443>
        ServerName myTestSite
        DocumentRoot /home/myUser/www/myTestSite/ssl

        SSLEngine on
        SSLCertificateFile /etc/httpd/conf/devSSL.crt
        SSLCertificateKeyFile /etc/httpd/conf/devSSL.key
        SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown
    </VirtualHost>
</IfDefine>
And does it matter where I place this in httpd.conf (i.e. specifically, above or under my current virtual hosts)

Much thanks for any help. ;-)

 

 

 

 

Top