VHM and hard-wired URLs generated by stock Zope code
Running Zope 2.3.3 with python 1.5.2 I run Zope on a private IP numbered server for users on our LAN but expose some parts of the Zope tree via Apache using ProxyPass and VHM to adjust the URLs on our pages. The problem I'm having is with some of the hard-wired URLs produced by some of the standard Zope code. For instance, the dtml-tree tag generates things like: <IMG SRC="/p_/mi" ALT="-" BORDER=0> The ZMI also does the same although that is less of a problem as, in general, I do not use the ZMI through the Apache proxy. But I might want to in the future. I do not want to use extra ProxyPass directives in my Apache config to handle these "unadjustable" hard-wired URLs. Aside from hacking at the source code does anyone know of a clean solution for this problem.
On Tue, Nov 06, 2001 at 02:35:00PM +0000, Richard Barrett wrote:
I do not want to use extra ProxyPass directives in my Apache config to handle these "unadjustable" hard-wired URLs. Aside from hacking at the source code does anyone know of a clean solution for this problem.
Depends on if the vast majority of the content is in Apache, Zope, or neither. If it's in Apache, I'd bite the bullet and add the few extra directives for the /p_ directories and similar. If most of the content is in Zope, I'd use something similar to my howto at www.zope.org/Members/mwr, which assumes that Apache content is the exception rather than the rule (or at least the Apache content can be found in a few standard URL regular expressions). If the content is relatively evenly divided, I'd flip a coin. -- Mike Renfro / R&D Engineer, Center for Manufacturing Research, 931 372-3601 / Tennessee Technological University -- renfro@tntech.edu
Hmm, I'm pretty sure that the ZMI works ok with the right config, we have many servers running in various places with the whole zope instance running through virtual hosting. In many cases the ports that zope runs on are blocked from outside. I too get the <img SRC="/p_/pl" ALT="+" BORDER=0> however this works fine through the rewrite rules we have, so I guess its a problem with you only giving access to certain parts of zope :-( We are rewriting the whole of say myzope.mydomain.com to somewhere like localhost:8080/stuff/users/myzope This is my proxy pass from apache.conf, works with a Virtual Host Monster in the root :-) <VirtualHost localzope> ServerName myserver.mydomain.com ServerAdmin me@mydomain.com RewriteEngine On RewriteRule ^/error/(.*)$ /error/$1 [L] RewriteRule ^(.*)$ http://localhost:8080/VirtualHostBase/http/myserver.mydomain.com:80/VirtualH... [P] ProxyPassReverse / http://localhost:8080/VirtualHostBase/http/myserver.mydomain.com:80/VirtualH... ErrorDocument 502 /error/error502.html CustomLog /mylogdir/access_log combined ErrorLog /mylogdir/error_log </VirtualHost> There is some extra stuff so apache displays an error if zope is not running, but the two rewrite lines are there Hope thats of some use :-) ChrisK Richard Barrett wrote:
Running Zope 2.3.3 with python 1.5.2
I run Zope on a private IP numbered server for users on our LAN but expose some parts of the Zope tree via Apache using ProxyPass and VHM to adjust the URLs on our pages.
The problem I'm having is with some of the hard-wired URLs produced by some of the standard Zope code. For instance, the dtml-tree tag generates things like:
<IMG SRC="/p_/mi" ALT="-" BORDER=0>
The ZMI also does the same although that is less of a problem as, in general, I do not use the ZMI through the Apache proxy. But I might want to in the future.
I do not want to use extra ProxyPass directives in my Apache config to handle these "unadjustable" hard-wired URLs. Aside from hacking at the source code does anyone know of a clean solution for this problem.
_______________________________________________ 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 )
At 14:35 06/11/2001 +0000, Richard Barrett wrote:
Running Zope 2.3.3 with python 1.5.2
I run Zope on a private IP numbered server for users on our LAN but expose some parts of the Zope tree via Apache using ProxyPass and VHM to adjust the URLs on our pages.
The problem I'm having is with some of the hard-wired URLs produced by some of the standard Zope code. For instance, the dtml-tree tag generates things like:
<IMG SRC="/p_/mi" ALT="-" BORDER=0>
The ZMI also does the same although that is less of a problem as, in general, I do not use the ZMI through the Apache proxy. But I might want to in the future.
I do not want to use extra ProxyPass directives in my Apache config to handle these "unadjustable" hard-wired URLs. Aside from hacking at the source code does anyone know of a clean solution for this problem.
I did create a partial solution to this problem. The code in TreeTag.py that generates the /p_/mi and /p_/pl URLs appears to prefix them with the contents of the variable REQUEST['SCRIPT_NAME'. By using REQUEST.set() to force the value of this to one appropriate to the request target, using the absolute_url function, the IMG SRC URLs come out as appropriately VHM adjusted URLs. When the browser feeds these URLs back to the server whether via the Apache proxy or by direct request to Zope, Zope acquisition finds the required files. For instance, my DTML method for building the tree view HTML looks like: <dtml-call "REQUEST.set('SCRIPT_NAME', absolute_url())"> <dtml-tree sort="title" branches_expr="listObjectsForTree(['File', 'Folder', 'ExtFile', 'DTML Document'])"> <div class="maintext"> <dtml-if "meta_type=='Folder'"> <dtml-var title_or_id> <dtml-else> <a href="<dtml-var absolute_url>"><dtml-var title_or_id></a> </dtml-if> </div> </dtml-tree> The result is no additional ProxyPass needed for Apache to access the /p_ URLs. If anybody has better idea, I'd love to hear it because my solution is a really disgusting hack. That said, the whole /p_ and /misc_ URL thing is pretty ugly in my view.
participants (3)
-
Chris Keyes -
Mike Renfro -
Richard Barrett