Re: [Zope] ADVICE needed: multi-site Zope installations, PCGI and ZServer
Steve, Thanks for the reply, I delayed replying as I wanted to check my virtual hosts setup; At 8:54 am -0500 14/9/99, Steve Spicklemire wrote:
Hi Tony,
"Tony" == Tony McDonald <tony.mcdonald@ncl.ac.uk> writes:
I do this all the time with no mangled screens. I've mailed the zope list... but I rarely see a comment about this approach. Have you tried anything like this?:
<VirtualHost www.sample.com> Port 80 ServerAdmin steve@spvi.com DocumentRoot /webroot/sites/sample ServerName www.sample.com ErrorLog /var/log/sample_error.log TransferLog /var/log/sample_access.log RewriteEngine on RewriteRule ^/sample/(.*) /$1 RewriteCond %{HTTP:Authorization} ^(.*) RewriteRule ^/(.*) /usr/local/etc/zope/Zope.cgi/sample/$1 [e=HTTP_CGI_AUTHORIZATION:%1,t=application/x-httpd-cgi,l] </VirtualHost>
My *main* virtual setup is <VirtualHost nle.ncl.ac.uk> ServerAdmin Tony.McDonald@ncl.ac.uk DocumentRoot /home/nnle/public_html/ ServerName nle.ncl.ac.uk ScriptAlias /cgi-bin/ /home/nnle/cgi-bin/ RewriteEngine on RewriteRule ^/web_logs - [L] RewriteRule ^/website/handbooks - [L] RewriteRule ^/img - [L] RewriteRule ^/images - [L] RewriteRule ^/include - [L] RewriteRule ^/site_web_resources - [L] RewriteRule ^/testing - [L] RewriteCond %{HTTP:Authorization} ^(.*) RewriteRule ^/(.*) /home/nnle/cgi-bin/Zope.cgi/$1 [e=HTTP_CGI_AUTHORIZATION:%1,t=application/x-httpd-cgi,l] <Location /test> ForceType application/x-httpd-php3 </Location> ErrorLog "/home/nnle/wwwserver/logs/error_log" TransferLog "/home/nnle/wwwserver/logs/access_log" UserDir disabled <Directory /home/nnle/public_html> AllowOverride AuthConfig fileInfo Indexes Limit Options </Directory> </VirtualHost> Apart from your RewriteRule ^/sample/(.*) /$1 line, they appear to do the same thing. I don't *believe* the blank line before the RewriteCond line is important. For one of my 'subsites' I have <VirtualHost mf.ncl.ac.uk> ServerAdmin a.n.other@ncl.ac.uk DocumentRoot /home/dnle/public_html/ ServerName mf.ncl.ac.uk ScriptAlias /cgi-bin/ /home/dnle/cgi-bin/ RewriteEngine on RewriteRule ^/icons - [L] RewriteRule ^/dur_cmc - [L] RewriteRule ^/mcq - [L] RewriteRule ^/res_upload - [L] RewriteRule ^/site_web_resources - [L] RewriteCond %{HTTP:Authorization} ^(.*) RewriteRule ^/(.*) /home/nnle/cgi-bin/Zope.cgi/nle/dnle/$1 [e=HTTP_CGI_AUTHORIZATION:%1,t=application/x-httpd-cgi,l] ErrorLog "/home/dnle/wwwserver/logs/error_log" TransferLog "/home/dnle/wwwserver/logs/access_log" UserDir disabled <Directory /home/dnle/public_html> AllowOverride AuthConfig fileInfo Indexes Limit Options </Directory> </VirtualHost> As you can see this virtual host is pointed into a subfolder of the main Zope site (dnle to be specific). The problem is that once the manager logs into that site they get the following on the right hand screen (after some traversing in their 'neck of the woods') Folder at /nle / dnle / nle / dnle / nle / dnle / nle / dnle Which, although the site appears to work ok, is an additional bit of confusion for the manager. Additionally, some people on the list have recommended using; RewriteRule ^(.*) /home/nnle/cgi-bin/Zope.cgi/nle/dnle/$1 [e=HTTP_CGI_AUTHORIZATION:%1,t=application/x-httpd-cgi,l] rather than RewriteRule ^/(.*) /home/nnle/cgi-bin/Zope.cgi/nle/dnle/$1 [e=HTTP_CGI_AUTHORIZATION:%1,t=application/x-httpd-cgi,l] although the latter does (almost) work (the almost being this issue with repeating folder names). Cheers tone. ------ Dr Tony McDonald, FMCC, Networked Learning Environments Project http://nle.ncl.ac.uk/ The Medical School, Newcastle University Tel: +44 191 222 5888 Fingerprint: 3450 876D FA41 B926 D3DD F8C3 F2D0 C3B9 8B38 18A2
Hi Tony,
"Tony" == Tony McDonald <tony.mcdonald@ncl.ac.uk> writes:
deletia... Tony> Apart from your RewriteRule ^/sample/(.*) /$1 line, they Tony> appear to do the same thing. I don't *believe* the blank Tony> line before the RewriteCond line is important. but that's the key rewrite! The problem is that Zope is 'adding' stuff to the front of the URL with it's BASE tag. This rewrite just strips that off so that you don't get that mess. Tony> As you can see this virtual host is pointed into a subfolder of the Tony> main Zope site (dnle to be specific). Tony> The problem is that once the manager logs into that site they get the Tony> following on the right hand screen (after some traversing in their Tony> 'neck of the woods') Tony> Folder at /nle / dnle / nle / dnle / nle / dnle / nle / dnle Yes... that's the mess you get. If you put in a rewrite like: RewriteRule ^/nle/dnle(.*) /$1 then you won't get all that. You will *see* /nle/dnle/blah/blah in your URLs (if you have them displayed) but the web server will strip them before forwarding your request to Zope. -steve
At 8:38 am -0500 15/9/99, Steve Spicklemire wrote:
Hi Tony,
"Tony" == Tony McDonald <tony.mcdonald@ncl.ac.uk> writes:
deletia...
Tony> Apart from your RewriteRule ^/sample/(.*) /$1 line, they Tony> appear to do the same thing. I don't *believe* the blank Tony> line before the RewriteCond line is important.
but that's the key rewrite! The problem is that Zope is 'adding' stuff to the front of the URL with it's BASE tag. This rewrite just strips that off so that you don't get that mess.
doh! *many* thanks for that Steve. I reckon you've nailed one of the most often-asked questions about serving Zope from Apache there.
Tony> As you can see this virtual host is pointed into a subfolder of the Tony> main Zope site (dnle to be specific). Tony> The problem is that once the manager logs into that site they get the Tony> following on the right hand screen (after some traversing in their Tony> 'neck of the woods') Tony> Folder at /nle / dnle / nle / dnle / nle / dnle / nle / dnle
Yes... that's the mess you get. If you put in a rewrite like:
RewriteRule ^/nle/dnle(.*) /$1
then you won't get all that. You will *see* /nle/dnle/blah/blah in your URLs (if you have them displayed) but the web server will strip them before forwarding your request to Zope.
-steve
Things are a *lot* clearer now. :) Cheers loads, Tone. ------ Dr Tony McDonald, FMCC, Networked Learning Environments Project http://nle.ncl.ac.uk/ The Medical School, Newcastle University Tel: +44 191 222 5888 Fingerprint: 3450 876D FA41 B926 D3DD F8C3 F2D0 C3B9 8B38 18A2
Hi, On 15-Sep-99 Steve Spicklemire wrote:
Tony> Apart from your RewriteRule ^/sample/(.*) /$1 line, they Tony> appear to do the same thing. I don't *believe* the blank Tony> line before the RewriteCond line is important.
but that's the key rewrite! The problem is that Zope is 'adding' stuff to the front of the URL with it's BASE tag. This rewrite just strips that off so that you don't get that mess.
I don't know, if my setup is exactly the same. What i have done is to set up multiple apache virtual hosts running with only one PCGI/ZServer and the hierarchy within Zope of ... / VirtualDomains www_virtual1_de www_virtual2_de www_virtual3_de ... an a rewriting like ... ^(.*) /usr/lib/cgi-bin/Zope/VirtualDomains/www_virtualX_de$1 But the problem now is, that i cannot delete objects from the virtual domains root when logged in at for example ... http://www.virtual2.de/manage ... as the webmaster for the domain. If i mark the objects and press delete, i get the index_html rendered in the management frame and the object isn't deleted. If i log in through the NameVirtualHost with a rewriting like ... ^(.*) /usr/lib/cgi-bin/Zope$1 ... there is no problem going through the hierarchy and deleting the object. Even nastier, i can be logged in as the webmaster and enter the url ... http://www.virtual2.de/manage_delObjects?ids:list=goAwayObject ... and the objects does exactly that ... going away ... gnarz :( Any ideas for that? bye Sascha Flohr, Cymes - Management. -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Cymes GmbH Berliner Platz 1 tel 0531 27385-100 ------------- 38102 Braunschweig fax 0531 27385-199 Internet Solution info@cymes.net Partner www.cymes.net ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
participants (3)
-
Sascha Flohr -
Steve Spicklemire -
Tony McDonald