VirtualHostMonster Question?
I have installed Apache and configured it with mod_proxy, mod_rewrite, mod_alias, mod_Vhosts-alias. I installed VHM in my root directory and edited the Vhosts.conf file which is an include in httpd.conf If my path were: http://localhost:8080/adir/bdir/cdir/index_html , how would do the rewrite? <VirtualHost 127.0.0.1> ServerName www.mysite.com Setenv VLOG RewriteEngine On RewriteRule ^/(.*)http://127.0.0.1:8080/VirtualHostBase/ http/www.mysite.com:80/adir/bdir/cdir/VirtualHostRoot/index_html/$1 [P] </VirtualHost> This doesn't seem to work. I keep getting an error:index GET
I struggled with VHM for a while before getting it to work. Here is some advice. Search the Zope How-To's with apache for a better explination 1) typo? Should have a space here RewriteRule ^/(.*)http://127.0.0.1 ... RewriteRule ^/(.*) http://127.0.0.1 ... 2) Assuming you are trying to make your root apache look like your root zope you should have no need to specify index_html at the end of your RewriteRule, end it with /VirtualHostRoot/$1 3) If you are worried about apache index.html vs zope index_html, a good trick I saw in a howto is to make a index.html dtml-method in your zope root with only <dtml-var index_html>, so now zope will translate any index.html requests from apaceh to the zopish form 3) your setup specifies that you have placed your Virtual Host Monster in the root directory of your zope instillation... since your are getting that error message I assume that the host monster is there basically in the request to apache http://localhost/A/B/C Apache will grab off the /A/B/C Apache will then send the request to :8080, the Virtual Host Monster will grab it and make sure to return what looks like an apache:80 location What zope gets: http://localhost:8080/A/B/C What user sees: http://localhost/A/B/C If you specify index_html at the end of your rewrite statement I believe the request will be rewitting to something like What zope gets: http://localhost:8080/index_html/A/B/C/ What user sees: http://localhost/A/B/C/ which won't make a lot of sense hope this helps on my windows xp machine with apache 1.3 I use these statements ==== httpd.conf ==== LoadModule proxy_module modules/mod_proxy.so LoadModule rewrite_module modules/mod_rewrite.so ... ... RewriteEngine On RewriteRule ^/local(.*) $1 [L] RewriteRule ^/(.*) http://localhost:8080/VirtualHostBase/http/localhost:80/VirtualHostRoot/ $1 [P] ====/ httpd.conf ==== -Dan Narkiewicz -----Original Message----- From: zope-admin@zope.org [mailto:zope-admin@zope.org] On Behalf Of Michael Sent: Sunday, April 07, 2002 12:52 PM To: zope@zope.org Subject: [Zope] VirtualHostMonster Question? I have installed Apache and configured it with mod_proxy, mod_rewrite, mod_alias, mod_Vhosts-alias. I installed VHM in my root directory and edited the Vhosts.conf file which is an include in httpd.conf If my path were: http://localhost:8080/adir/bdir/cdir/index_html , how would do the rewrite? <VirtualHost 127.0.0.1> ServerName www.mysite.com Setenv VLOG RewriteEngine On RewriteRule ^/(.*)http://127.0.0.1:8080/VirtualHostBase/ http/www.mysite.com:80/adir/bdir/cdir/VirtualHostRoot/index_html/$1 [P] </VirtualHost> This doesn't seem to work. I keep getting an error:index GET _______________________________________________ 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 )
Thanks for the help! Everything is up and running fine now. zopedan wrote:
I struggled with VHM for a while before getting it to work. Here is some advice. Search the Zope How-To's with apache for a better explination
1) typo? Should have a space here RewriteRule ^/(.*)http://127.0.0.1 ... RewriteRule ^/(.*) http://127.0.0.1 ...
2) Assuming you are trying to make your root apache look like your root zope you should have no need to specify index_html at the end of your RewriteRule, end it with /VirtualHostRoot/$1
3) If you are worried about apache index.html vs zope index_html, a good trick I saw in a howto is to make a index.html dtml-method in your zope root with only <dtml-var index_html>, so now zope will translate any index.html requests from apaceh to the zopish form
3) your setup specifies that you have placed your Virtual Host Monster in the root directory of your zope instillation... since your are getting that error message I assume that the host monster is there
basically in the request to apache http://localhost/A/B/C Apache will grab off the /A/B/C Apache will then send the request to :8080, the Virtual Host Monster will grab it and make sure to return what looks like an apache:80 location What zope gets: http://localhost:8080/A/B/C What user sees: http://localhost/A/B/C
If you specify index_html at the end of your rewrite statement I believe the request will be rewitting to something like What zope gets: http://localhost:8080/index_html/A/B/C/ What user sees: http://localhost/A/B/C/ which won't make a lot of sense
hope this helps
on my windows xp machine with apache 1.3 I use these statements
==== httpd.conf ==== LoadModule proxy_module modules/mod_proxy.so LoadModule rewrite_module modules/mod_rewrite.so
... ...
RewriteEngine On RewriteRule ^/local(.*) $1 [L] RewriteRule ^/(.*) http://localhost:8080/VirtualHostBase/http/localhost:80/VirtualHostRoot/ $1 [P] ====/ httpd.conf ====
-Dan Narkiewicz
-----Original Message----- From: zope-admin@zope.org [mailto:zope-admin@zope.org] On Behalf Of Michael Sent: Sunday, April 07, 2002 12:52 PM To: zope@zope.org Subject: [Zope] VirtualHostMonster Question?
I have installed Apache and configured it with mod_proxy, mod_rewrite, mod_alias, mod_Vhosts-alias. I installed VHM in my root directory and edited the Vhosts.conf file which is an include in httpd.conf
If my path were: http://localhost:8080/adir/bdir/cdir/index_html , how would do the rewrite?
<VirtualHost 127.0.0.1> ServerName www.mysite.com Setenv VLOG RewriteEngine On RewriteRule ^/(.*)http://127.0.0.1:8080/VirtualHostBase/ http/www.mysite.com:80/adir/bdir/cdir/VirtualHostRoot/index_html/$1 [P] </VirtualHost>
This doesn't seem to work. I keep getting an error:index GET
_______________________________________________ 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 )
participants (2)
-
Michael -
zopedan