[Zope-dev] Need to patch SiteRoot ?
Leonardo Rochael Almeida
leo@hiper.com.br
20 Jun 2002 12:45:56 -0300
On Thu, 2002-06-20 at 06:54, Romain Slootmaekers wrote:
> Yo,
> we have a website with 2 parts:
> a public part (http://www.greatsite.com)
> and a private part (https://www.greatsite.com/private/)
Here is how you'd do it with VirtualHostMonster and apache:
1. add a single one virtual host monster to your Zope root. Give it any
id you want. You can be creative, 'cause it won't matter :-)
2. In apache, change your configuration to read like below. To
understand why the ProxyPass urls read like that, look at the
VirtualHostMonster object or consult the SiteAccess2 documentation here:
http://www.zope.org/Members/4am/SiteAccess2/info
### Apache ###
# better to use the IP address instead of the name here,
# to avoid dns lookups on apache initialization
NameVirtualHost www.greatsite.com
# better to use the IP address here too, for the same reason
<VirtualHost www.greatsite.com>
# here you put the server name instead of the address.
# it won't result in a dns lookup.
ServerName www.greatsite.com
# secure /private
RedirectMatch permanent ^/private https://www.greatsite.com/private$1
# the :80 below is NECESSARY. Don't ommit it
ProxyPass / http://127.0.0.1:8080/VirtualHostBase/http/www.greatsite.com:80/greatsite/VirtualHostRoot/
</VirtualHost>
NameVirtualHost www.greatsite.com:443
<VirtualHost www.greatsite.com:443>
ServerName www.greatsite.com
# note the protocol specification after VirtualHostBase. As above,
# the port specification is not optional
ProxyPass / http://127.0.0.1:8080/VirtuaHostBase/https/www.greatsite.com:443/greatsite/VirtualHostRoot/
SSLEngine on
SSLCertificateFile /etc/httpd/ssl.crt/server.crt
SSLCertificateKeyFile /etc/httpd/ssl.key/server.key
</VirtualHost>
EOF
I haven't tested the configuration above. I'd use RewriteRules instead
of RedirectMatch and ProxyPass, but just because that's what I'm used to
doing.
Notice that ProxyPassReverse directives aren't needed, because the
VirtualHostMonster, when presented with the above URLs, effectively
convinces Zope that it's running in the above mentioned ports and
protocols.
No SiteRoot objects are needed.
--
Ideas don't stay in some minds very long because they don't like
solitary confinement.