[Zope-dev] Need to patch SiteRoot ?

Romain Slootmaekers romain@zzict.com
Thu, 20 Jun 2002 11:54:25 +0200 (CEST)


Yo,
we have a website with 2 parts:
a public part (http://www.greatsite.com)
and a private part (https://www.greatsite.com/private/)

We use
the apache proxy + SiteRoot approach.
(configuration added below )

Anyway, everything works perfectly for the users of the site.
The problem is that we can't manage the site through https because the
SiteRoot object for the public site returns http url's instead of https.
Logical, but a nuissance.


My idea is to patch the SiteRoot code so that the protocol for the virtual
root is the same as the protocol used by the request. so
https://www.greatsite.com/manage will return pages with
urls of the form https://www.greatsite.com/<whatever>.

This is probably 30 minutes of source code browsing and 5 minutes of
patching and testing.

My questions are:

-) are there different solutions to this problem ?
-) If I patch the SiteRoot, will you guys check it in our do I have to
   patch future releases again and again ( Syssiphus like torture )

TIA,

Sloot



------- begin of configuration ------------------------

###### Apache ####
NameVirtualHost www.greatsite.com
<VirtualHost www.greatsite.com>
ServerName www.greatsite.com
ProxyPass / http://127.0.0.1:8080/greatsite/
ProxyPassReverse / http://127.0.0.1:8080/greatsite/
</VirtualHost>


NameVirtualHost www.greatsite.com:443
#
<VIRTUALHOST www.greatsite.com:443>
ServerName www.greatsite.com
ProxyPass / http://127.0.0.1:8080/greatsite/
ProxyPassReverse / https://127.0.0.1:8080/greatsite/
SSLEngine on
SSLCertificateFile /etc/httpd/ssl.crt/server.crt
SSLCertificateKeyFile /etc/httpd/ssl.key/server.key
</VIRTUALHOST>


and 2 SiteRoot objects (in the ZODB)

in /greatsite folder
base http://www.greatsite.com
path : /

in /greatsite/private folder
base https://www.greatsite.com/private/
path : /


---------------------------- end of configuration ----------------


"Science can amuse and fascinate us all,
 but it is engineering that changes the world."
                                 Isaac Asimov