[Setup] Problems with virtualhosts and Plone

Sergey V. sergey.volobuev at gmail.com
Fri Sep 5 01:48:27 UTC 2008




go_bucks wrote:
> 
> The VirtualHostMonster was already in existence on my plone/zope setup
> (I guess it comes preconfigured now?). I am not sure how to access the
> anything showing how it is set up. I looked but could not find it.
> 

You should configure Apache (i.e. your front-end webserver) to redirect not
just to your home server, but to a "magic URL" which format is described on
VHM's 'About' page (see below) So it's a matter of configuring things at
godaddy and not in your Zope.

Also it may be insightful for you to see what are the links generated by
Plone - i.e. where it tries to get its stylesheets/images from. VHM does
exactly this - it makes Zope generate links like
http://mydomain.com/mystyle.css instead of
http://localhost:8080/myplonesite/mystyle.css. 

======================================
You must add special names in the path

The VHM doesn't do anything unless it sees one of the following special path
elements in a URL: VirtualHostBase sets the protocol and host, while
VirtualHostRoot sets the path root.

If the URL path of a request begins with
"/VirtualHostBase/http/www.buystuff.com", for instance, then URLs generated
by Zope will start with http://www.buystuff.com. Since the port number was
not specified, it is left unchanged. If your Zope is running on port 8080,
and you want generated URLs not to include this port number, you must use
"/VirtualHostBase/http/www.buystuff.com:80".

If the URL contains VirtualHostRoot, then all path elements up to that point
are removed from generated URLs. For instance, a request with path
"/a/b/c/VirtualHostRoot/d" will traverse "a/b/c/d" and then generate a URL
with path /d.
You add these names by rewriting incoming URLs

Visitors to your site don't see these special names, of course. You insert
them into the path using either an external rewriter, such as an Apache
RewriteRule or ProxyPass directive, or by setting up a mapping on the
"Mappings" tab.

For example, suppose Zope is running on port 8080 behind an Apache running
on port 80. You place a Virtual Host Monster in the Zope root Folder, and
use Apache to rewrite "/(.*)" to
http://localhost:8080/VirtualHostBase/http/www.buystuff.com:80/buystuff.com/VirtualHostRoot/$1.

You could get the same effect in a standalone Zope by adding the line
www.buystuff.com/buystuff.com to the "Mappings" tab. In either case,
requests for http://www.buystuff.com/anything will look for Zope object
/buystuff.com/anything.

You should only use the "Mappings" tab for simple virtual hosting, in a Zope
that is serving requests directly. Each mapping line is a host name followed
by a path to a Folder. The VHM checks the host specified in each incoming
request to see if it is in the list. If it is, then the corresponding path
is inserted at the start of the path, followed by "VirtualHostRoot".

You can match multiple subdomains by putting "*." in front of the host name,
as in "*.buystuff.com". If an exact match exists, it is used instead of a
wildcard match. 
========================================

-- 
View this message in context: http://n2.nabble.com/Problems-with-virtualhosts-and-Plone-tp840223p840304.html
Sent from the Installation, Setup, Upgrades mailing list archive at Nabble.com.




More information about the Setup mailing list