[Zope] Virtual Hosts with apache rewriterule module and siteroot

Hervé Richard Herve.Richard@avignon.inra.fr
Tue, 5 Mar 2002 15:50:41 +0100


Hi,

Since a long time i try to install apache with 2 independant zope servers on 
the same machine (solaris 5.7) by using virtual hosting ans siteroot zope 
object, i scan hows-to and mail archives but i can't solve my pb :

i want to have two zope servers on my sun: 
http://www.mysite.fr:9080 and 
http://www.another.org:6080 (virtual)
in the second i create a folder "another" which contain a siteroot object :

/another/siteroot
    base = http://www.another.org
    path = /another

I want to use apache with *rewriterule module*, so i add some directives in 
my httpd.conf (see bottom)
When i restart Apache and i try it (with netscape), to the request :
  http://www.mysite.fr  i see the right web page
  http://www.another.org i see the apache server response :

		Proxy Error
		The proxy server could not handle the request GET/
		Reason : Host not found

When i try with the www.another.org zope server down, (i.e. like  a classic 
directory) it's right: i see the welcome pages.
 
I think that the matter come from my siteroot object

please, have you any idea, experience ?

Greats


 -------------------------------------------------------------
# piece of http.conf 

LoadModule proxy_module       libexec/libproxy.so
AddModule mod_proxy.c

NameVirtualHost x.x.0.2

<VirtualHost x.x.0.2>
 ServerName www.mysite.fr
 ServerAdmin Herve.Richard@mysite.fr
 DocumentRoot /usr/local/apache/htdocs/www.mysite.fr
 RewriteEngine on
 RewriteLog logs/rewrite.log
 RewriteLogLevel 1

 RewriteCond %{REQUEST_URI} !^/stcmysite/
 RewriteCond %{HTTP:Authorization} ^(.*)
 RewriteRule ^(.*) http://www.mysite.fr:9080/$1 [P]

 ErrorLog logs/mysite_error.log
 CustomLog logs/mysite_access.log common

 <Directory "/usr/local/apache/cgi-bin">
  AllowOverride None
  Options None
  Order allow,deny
  Allow from all
 </Directory>


</VirtualHost>

<VirtualHost x.x.0.2>
 ServerName www.another.org
 ServerAdmin hr@another.org
 DocumentRoot /usr/local/apache/htdocs/www.another.org

 ErrorLog logs/EuFireLab_error.log

 RewriteEngine on
 RewriteLog logs/rewrite.log
 RewriteLogLevel 1

 RewriteCond %{REQUEST_URI} !^/stcanother/
 RewriteCond %{HTTP:Authorization} ^(.*)
 RewriteRule ^/(.*) http://www.another.org:6080/another/$1 [P]
</VirtualHost>

-- 
_____________________________________________________________________________
Herve RICHARD		   Tel: 04 32 72 21 79	Herve.Richard@avignon.inra.fr
INRA - Biometrie - AVIGNON Fax: 04 32 72 21 82	rv.richard@oreka.com
_____________________________________________________________________________