I realise there are lots of different variations on this question on serverfault but I haven't had any luck with combining answers to match our situation.
We have a CentOS 6.2 web server running Apache 2.2 hosting dozens of websites with the same parent domain - i.e. cat.example.com, bat.example.com, rat.example.com
We'd like to add https to some (but not all) of these sub-domains. The sub-domains that are https would run https permanently. For example http://bat.example.com would redirect to https://bat.example.com
We have purchased a Comodo Multi-Domain SSL Certificate License for the SSL, which allows us to create certificates for multiple domains. The web server only has a single public facing IP.
How do we setup Apache to do this? If the Virtual Host entry in httpd.conf for bat.example.com is:
<VirtualHost *:80> ServerName bat.example.com DocumentRoot /var/www/sites/bat ErrorLog logs/bat-error_log CustomLog logs/bat-access_log common </VirtualHost>