Hosting Multiple SSL Web Sites On One IP Address With Apache 2.2 And GnuTLS (Debian Lenny)
|
Submitted by todgerme (Contact Author) (Forums) on Wed, 2011-02-02 18:26. :: Debian | Web Server | Apache
Hosting Multiple SSL Web Sites On One IP Address With Apache 2.2 And GnuTLS (Debian Lenny)This tutorial describes how you can host multiple SSL-encrypted web sites (HTTPS) on one IP address with Apache 2.2 and GnuTLS on a Debian Lenny server. For more information on why this couldn't be done prior to OpenSSL 0.98g or with GnuTLS please refer to http://en.wikipedia.org/wiki/Server_Name_Indication. I will mention that Virtual Hosting SSLs on the same IP address has 1 or 2 caveats before beginning and before anyone begins ripping out and handing back IPs to their ISPs. 1. Firefox 2.0+ works on all platforms (Mac/Windows/Linux) - it has its own TLS implementation - if you have SSLv2 enabled for VMware tools, Firefox doesn't work either, but by default Firefox comes with v2 disabled by default Let's assume you have written a cool Web 2.0 app behind an SSL which only runs in the latest and greatest browsers because of excessive amounts of Javascript the everything I said above will be fine because your website won't work anyway in the older browsers O/Ses anyways without Firefox. You can test if your browser is passing SNI by visiting here: https://sni.velox.ch/ Let's begin: apt-get install libapache2-mod-gnutls a2dismod ssl a2enmod gnutls Edit /etc/apache2/ports.conf and add the following line: Listen 443 Also comment out the following in /etc/apache2/ports.conf: <IfModule mod_ssl.c> # SSL name based virtual hosts are not yet supported, therefore no # NameVirtualHost statement here Listen 443 </IfModule> Finally create a file called /etc/apache2/ssl.conf: NameVirtualHost xx.yy.zz.kk:443 <VirtualHost xx.yy.zz.kk:443> ServerName secure.domain1.com:443 GnuTLSEnable on GnuTLSCertificateFile /etc/apache2/ssl-certs/secure.domain1.com.crt GnuTLSKeyFile /etc/apache2/ssl-certs/secure.domain1.com.key GnuTLSPriorities NORMAL DocumentRoot /web/www1 </VirtualHost> <VirtualHost xx.yy.zz.kk:443> ServerName secure.domain2.com:443 GnuTLSEnable on GnuTLSCertificateFile /etc/apache2/ssl-certs/secure.domain2.com.crt GnuTLSKeyFile /etc/apache2/ssl-certs/secure.domain2.com.key GnuTLSPriorities NORMAL DocumentRoot /web/www2 </VirtualHost> Add in an include line in /etc/apache2/apache2.conf: Include "/etc/apache2/ssl.conf" Finally restart Apache2 with: apache2ctl restart Note on Godaddy SSLs: With Godaddy you normally have you import a gd_bundle into Apache with the following OpenSSL directive: SSLCertificateChainFile /etc/apache2/ssl-certs/gd_intermediate_bundle.crt In order to use this root certificate in GnuTLS simply run: cat gd_intermediate_bundle.crt >> /etc/apache2/ssl-certs/secure.domain1.com.crt This simply appends the bundle to the end of the certificate and GnuTLS is very happy using it.
|



Recent comments
22 hours 50 min ago
22 hours 55 min ago
1 day 3 hours ago
1 day 10 hours ago
1 day 11 hours ago
1 day 12 hours ago
1 day 16 hours ago
1 day 23 hours ago
2 days 3 hours ago
2 days 5 hours ago