[Zope] How to have Apache rewrite to multiple Zopes?

Alec Mitchell apm13 at columbia.edu
Wed Jan 7 00:36:05 EST 2004


On Tuesday 06 January 2004 04:35 pm, Dylan Reinhardt wrote:
> On Tue, 2004-01-06 at 16:12, Jens Vagelpohl wrote:
> > You can serve as many
> > NameVirtualHosts off of a single IP port 443
>
> This *seems* like it should be true, but it simply isn't.
>
> See:
>   http://httpd.apache.org/docs-2.0/ssl/ssl_faq.html#vhosts
>   http://httpd.apache.org/docs-2.0/ssl/ssl_faq.html#vhosts2

Strange, I've certainly set up multiple perfectly working NameVirtualHosts 
over SSL on apache 1.3.  Of course they all use the same SSL certificate, but 
that is only a minor annoyance for the hosts which are not on the cert.  The 
config entries follow:

<VirtualHost *:443>
  ServerName site1.bogus.com
  RewriteEngine On

  RewriteRule ^/bogus-images(.*) /var/www/bogus.com/images$1 [L]

  RewriteCond %{HTTP_HOST} ^.*:443$
  RewriteRule ^/(.*) 
http://127.0.0.1:8080/VirtualHostBase/https/%{HTTP_HOST}/site1/VirtualHostRoot/$1 
[P]
  RewriteRule ^/(.*) 
http://127.0.0.1:8080/VirtualHostBase/https/%{HTTP_HOST}:443/site1/VirtualHostRoot/$1 
[L,P]

[boring SSL and logging stuff removed]
</VirtualHost>

<VirtualHost *:443>
  ServerName site2.bogus.com
  RewriteEngine On

  RewriteRule ^/bogus-images(.*) /var/www/bogus.com/images$1 [L]

  RewriteCond %{HTTP_HOST} ^.*:443$
  RewriteRule ^/(.*) 
http://127.0.0.1:8080/VirtualHostBase/https/%{HTTP_HOST}/site2/VirtualHostRoot/$1 
[P]
  RewriteRule ^/(.*) 
http://127.0.0.1:8080/VirtualHostBase/https/%{HTTP_HOST}:443/site2/VirtualHostRoot/$1 
[L,P]

[more boring SSL and logging stuff removed]
</VirtualHost>

I'm surprised to find that I have unwittingly done the impossible.  I think 
it's more likely that the SSL incompatability with NameVirtualHost is new in 
2.0, but who knows?

Alec




More information about the Zope mailing list