[Sussex] Apache + SSL + virtual host

Ronan Chilvers ronan at thelittledot.com
Wed May 25 08:06:18 UTC 2005


Colin Tuckley wrote:
> Diego Moore wrote:
> I seem to remember reading somewhere that what you are trying to do is
> impossible.
>
> You can't run virtual hosts and a secure server from the same instance of httpd.
>
> The reason is (I believe) that you need to be able to inspect the incoming
> request to determine which virtual host it is for, but with a secure server
> you can't do that. Maybe someone who understands apache better can give a
> better reason.
>

You can, you just can't have more than one SSL site.  So

NameVirtualHost *:80
NameVirtualHost *:443

<VirtualHost *:80>
	ServerName www.site1.com
	Blah
</VirtualHost>

<VirtualHost *:80>
	ServerName www.site2.com
	Blah
</VirtualHost>

<VirtualHost *:443>
	ServerName secure.site3.com
	Blah
</VirtualHost>

works fine.  But you can't add another SSL site - the hostname is
embedded in the certificate for one thing so if it differs, you'll end
up with warnings from the browser.

--
Ronan

e: ronan at thelittledot.com
w: www.thelittledot.com
t: 01903 739 997
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 256 bytes
Desc: OpenPGP digital signature
Url : http://mailman.lug.org.uk/pipermail/sussex/attachments/20050525/ad889c9a/attachment.pgp 


More information about the Sussex mailing list