[Zope] small zope <-> apache improvement/suggestion

Chris McDonough chrism@digicool.com
Sat, 14 Apr 2001 14:22:31 -0400


Hi Thomas,

Thanks for the note!!  Do you think you can put this in the Collector?
http://classic.zope.org:8080/Collector .

----- Original Message -----
From: "Thomas Dunne (Sys. Admin.)" <dunne@dpunkt.de>
To: <zope@zope.org>
Cc: <rene@dpunkt.de>; "Lutz Ehrlich" <lutz.ehrlich@lionbioscience.com>
Sent: Saturday, April 14, 2001 7:04 AM
Subject: [Zope] small zope <-> apache improvement/suggestion


> Hey!
>
> I just spent a "bit of a long time"  trying to get apache to pass through
> the HTTP_Auth Headers to the zope pcgi-wrapper.
> (obviously I was doing something wrong ;) )
>
> well to make a long story short:
> the suggested apache conf setup for using zope with pcgi and w/o fastcgi
> in the file doc/WEBSERVER.txt (line 300) is at the moment:
>
>       # Zope configuration maps /Zope/ to the Zope.cgi CGI script
>       RewriteEngine on
>       RewriteCond %{HTTP:Authorization}  ^(.*)
>       RewriteRule ^/Zope(.*) /usr/local/apache/cgi-bin/Zope.cgi/$1
[e=HTTP_CGI_A
> UTHORIZATION:%1,t=application/x-httpd-cgi,l]
>
> as also mentioned in the file, that is one long (and a bit ugly)
rewriterule.
> Disadvantages of this approach:
>  1. only applies when header contains an "Auth-Tag" (surprise!)
>  2. creates small havock and some confusion with the already defined
>     ScriptAlias line, in that one doesn't definitely know if only
>     the ScriptAlias or also the RewriteRule are being applied
>  3. it's a really long line
>
> alternative suggestion:
>  * drop the ScriptAlias line
>  * drop the unnecessary RewriteCond-query
>  * always apply the RewriteRule
>  * split the RewriteRule into 3 lines :)
>
> the result then:
>
>   RewriteEngine on
>   RewriteRule ^/(.*)$  /var/www-edit/cgi-bin/zope.dpunkt.de/zope/$1
>   RewriteRule ^(.*)$   $1
[e=HTTP_CGI_AUTHORIZATION:%{HTTP:Authorization}]
>   RewriteRule ^(.*)$   $1  [t=application/x-httpd-cgi,l]
>
> a bit nicer to read, and (thank God) it works :)
>
> best wishes + great software!
>  tom
>
>
> __________________________________________________
> save the whales, feed the hungry, free the mallocs
>
>
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )
>