Americas

  • United States

Getting SSL to work across virtual hosts in Apache

Opinion
Jan 16, 20062 mins
ApacheEnterprise ApplicationsSecurity

I have an Apache server running a number of named virtual hosts that I want to use SSL with. Apache doesn’t support named virtual hosts in the SSL configuration file, because of the way the protocols work. I need to route requests by hostname using SSL. How can I do that?

Apache cannot support named virtual hosts in SSL host configuration files, because it cannot see the hostname header when the SSL request is being processed. You can use a directory-level configuration file, typically called .htaccess, to redirect the request, because the host name information is available at that later point in the processing.

To do this, include the line

AllowOverride Options FileInfo AuthConfig

in the general configuration section of the apache httpd.conf server configuration file. This allows you to use the Apache URL rewriting engine from a directory-level configuration file.

In the directory defined as DocumentRoot in the 443>