[Zope] apache ssl management pages
Jesse Goerz
jgoerz@cfl.rr.com
19 Oct 2002 09:10:08 -0400
I recently got ssl working on my system and wanted to use ssl for the
management pages of zope. I'm using apache + zope + vhm.
I'd like to be able to type the normal http url and if a management
screen is viewed have it "redirect" (is that the right term) everything
through secure pages. Everything is working now but I have to actually
type https://... (oh, the agony) rather than just http://... In other
words, I'd rather just type .../manage at the end and just log in and
start working. Currently, that isn't happening, I have to manually type
in the https or it doesn't get encrypted.
Here's the httpd.conf (mind the word wrap):
===================================================
NameVirtualHost 192.168.100.253:80
NameVirtualHost 192.168.100.253:443
<VirtualHost 192.168.100.253:80>
ServerName mydomain.org
# Secure management screens
RewriteCond %{SERVER_PORT} !443
RewriteCond %{REQUEST_URI} ^/(.*(manage).*)
RewriteRule ^/(.*)
http://127.0.0.1:9673/VirtualHostBase/https/%{HTTP_HOST}:443/jesse/VirtualHostRoot/$1 [L,P]
# Rewrite rules for normal zope browsing
RewriteCond %{HTTP_HOST} ^.*:80$
RewriteRule ^/(.*)
http://127.0.0.1:9673/VirtualHostBase/http/%{HTTP_HOST}/jesse/VirtualHostRoot/$1 [L,P]
# A "static" directory within zope
RewriteCond %{REQUEST_URI} !^/nz/
RewriteRule ^/(.*)
http://127.0.0.1:9673/VirtualHostBase/http/%{HTTP_HOST}:80/jesse/VirtualHostRoot/$1 [L,P]
</VirtualHost>
<VirtualHost 192.168.100.253:443>
ServerName mydomain.org
<IfModule mod_ssl.c>
SSLEngine on
SSLCertificateFile /etc/apache/ssl.crt/server.crt
SSLCertificateKeyFile /etc/apache/ssl.key/server.key
SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown
</IfModule>
RewriteEngine On
RewriteRule ^/(.*)
http://127.0.0.1:9673/VirtualHostBase/https/%{HTTP_HOST}:443/jesse/VirtualHostRoot/$1 [L,P]
</VirtualHost>