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>
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>
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>
Much thanks for any help. ;-)