Personal tools
You are here: Home How To Plone 3 Virtual Hosting
Document Actions

Virtual Hosting

by James Stroud last modified 2007-09-30 19:57

Apache2

I like to set up sites such that the plone site takes over the toplevel (i.e. "/") but gets redirected to a subfolder (i.e. "/Home/"). This way, my virtual host is essentially a plone site. But, at the same time, I can have other toplevel directories that can be accessed directly but do not interfere with plone (e.g. "your.site.com/some-utility/"). I also like to run ubuntu when I run Linux, which uses apache2. Setting up virtual hosting according to several different pages resulted in "403 Forbidden. You don't have permission to access /whatever/file on this server." After some experimentation I have found that the minimal virtual hosting configuration for a successful setup with Apache 2 goes a little something like this:

<VirtualHost *>

DocumentRoot "/var/www/your.site.com"
ServerName your.site.com
ServerAlias your.site.com
ServerAdmin you@site.com

# override apache2 global defaults
<Proxy *>
Order Deny,Allow
Allow from all
</Proxy>

# disallow use of your.site.com as open proxy
<LocationMatch "^[^/]">
Deny from all
</LocationMatch>

RewriteEngine On

# Plone in a sub-folder of an apache site
RedirectMatch ^/$ /Home
RewriteRule ^/Home(.*) http://localhost:8080/VirtualHostBase/http/your.site.com:80/Plone/VirtualHostRoot/_vh_Home/$1 [P,L]

</VirtualHost>

In the above case, my VHM is named "VirtualHostMonster" and is configured as described at the plone site.

The above example gets around the server's default to disable proxies, but denies open proxy requests. Some might subbornly attempt to use your apache2 as a proxy, but the resulting proxy will be completely useless. I have stumbled across discussions wherein people claim that explicitly allowing the proxy is not required. However, the discussants never describe an alternative configuration. Also, the above "LocationMatch" directive appears in some long standing web pages as a viable prevention to a potential open proxy.

« January 2009 »
Su Mo Tu We Th Fr Sa
123
45678910
11121314151617
18192021222324
25262728293031
 

Powered by Plone CMS, the Open Source Content Management System

This site conforms to the following standards: