Saturday, February 23, 2008

Running Plone behind an apache server

Alhamdullillah.. After a whole night of googling and hacking configurations I was finally able to configure Plone to run behind an apache server. I began my quest by googling and finding this page: . I don't need the ssl mentioned there but I did want to run Plone behind apache. But following the instructions didn't get me any result. So I tried to find out what on earth does the RewriteRule is actually about. After much googling again I found this: which also led me to an interesting albeit not really what I'm looking for now at Sooooo... the [P] actually stands for proxy.

Ok.. so now I'm getting somewhere. After much trial and error I finally figured out that I need to run:
sudo a2enmod proxy
sudo a2enmod proxy_http

To enable the proxy function in my apache server. Once that is done, it seems the rules given at the first website is not really correct. So in the end my .htaccess contains the following:
<IfModule mod_proxy.c>
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^(.*)$ http://localhost:8080/$1 [P]

But even though that is all fine and dandy, it didn't allow me to surf to more than the front page. All the subsequent links in the page was broken. And I experimented some more until finally I've got it at:

RewriteRule ^(.*) http://localhost:8080/VirtualHostBase/http/$1 [P]

Read the first article and it will mention about enabling Virtual Host Monster in the zope management page. But it did not mention about if you we're actually serving from a directory under your web root. Well, good thing the about page on the zope management page explained it all. So for the example above, my server was serving plone from the directory plone. The _vh_ tells the virtual host monster to append plone/ to every link it generates. Cool stuff..

So then I finally got it working. Alhamdullillah... Took a whole night. But seems to be very worth it.

Update (16 March 2008): Finally I've even got the layout working. After referring to and the Velo site it point to and also which explains what RewriteMap actually does. The RewriteMap part has to be part of the http.conf or if you are using Ubuntu in the sites configuration file. Then escape the request just like it says in the matthewwhitworth site and it all should work. Finally.


k4ml said...

what a coincidence, I'm having almost the same problem just by a day later ;)

Abdullah Zainul Abidin said...

I still haven't gotten it running fully actually. The default layout seems
to be broken. When I try installing NuPlone it works but I like the default
layout better. Hope to find a solution soon.

kedai said...

try rewrite witch at

Abdullah Zainul Abidin said...

Thank you kedai for the tip. But I still can't seem to get it working. I'm not sure where is the problem but the layout is still completely way off. Try to look at I t seems the css doesn't load at all. And even adding new content it doesn't show up which might point to some problem with apache caching the thing. But I've actually even tried keying in the generated url ( by hand but it still doesn't display properly although the content is the latest one which might point to the fact that it doesn't go through any apache caching. Have to try it out some more.

Haiya ala Solah