Skip to main content

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: http://plone.org/documentation/how-to/apache-ssl . 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: http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html which also led me to an interesting albeit not really what I'm looking for now at http://httpd.apache.org/docs/1.3/misc/rewriteguide.html. 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]
</IfModule>
</IfModule>

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/abdullahsolutions.com:80/VirtualHostRoot/_vh_plone/$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 http://matthewwhitworth.com/2008/02/06/escape-from-mod_rewrite/ and the Velo site it point to and also http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html#mapfunc 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.

Comments

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

http://www.k4ml.com/node/211
abdza 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.
Anonymous said…
try rewrite witch at http://betabug.ch/zope/witch
tk
abdza 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 http://abdullahsolutions.com/plone. 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 (http://192.168.0.123:8080/VirtualHostBase/http/192.168.0.123:80/abdsol/VirtualHostRoot/_vh_plone) 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.

Popular posts from this blog

haproxy on Centos 7 with SELinux

Setting up haproxy and varnish with reference to the configuration from these sites: http://sharadchhetri.com/2014/12/20/how-to-install-varnish-4-version-on-centos-7-rhel-7/ https://www.upcloud.com/support/haproxy-load-balancer-centos/ And finally can access plone on the server. But when I check the haproxy status, only client1 can be accessed. All other clients were down with general socket error, permission denied. Googling a bit I finally found out it was due to SELinux. Refer to this page: http://stackoverflow.com/questions/26420729/haproxy-health-check-permission-denied With the solution from that page, I installed policycoreutils-python and tried to run the command given: semanage port --add --type http_port_t --proto tcp 8081 But that command failed with the error that the port was already defined. When I looked it up using: semanage port -l | grep 8081 It belonged to some other type (transproxy_port_t). When I tried to delete the type using: semanage port -d -t transpro…

Installing Centos 7 on HP G7 Server

When I first initially tried it, the installer cannot detect any local hard disk to install to. After much googling found out that it was because a certain driver for the Smart Array Controller is no longer available on Centos 7. To allow for use of the new driver on old hardware, you need to enable the option. Once the DVD has booted and on the first menu screen, highlight the first option and then press tab which would bring you to a command line where you can add additional parameters to boot. Add the following parameters: hpsa.hpsa_allow_any=1 hpsa.hpsa_simple_mode=1 And then press enter to boot. You should now be able to install as you wish. After installation, on the first boot, make sure at the menu, press 'e' to edit the parameters and add them again. Then once booted, go to /boot/grub2/grub.cfg to permanently add the parameters to the menu. Refer to http://serverfault.com/questions/611182/centos-7-x64-and-hp-proliant-dl360-g5-scsi-controller-compatibility and it&#…

Dell Inspiron Mini 9

Yesterday went to Low Yat to buy my cousin a sub RM 1500 notebook. Of course with that kind of price tag it would have to be a netbook jelah. Anyhow, I was short on time so I didn't get to browse thoroughly. Just went for one quick round around level 2 and picked the one that I thought would fulfil his need. The thing is, as soon as I stepped out of the lift there was a shop that sold the new Dell Inspiron Mini 9 for only RM 1199. I was suprised. Just 1199. I couldn't believe my eyes. With original Windows XP and all. RM 1199. I thought there must be something wrong. Better survey first. So went around level 2. There was nothing that could match that price. Most of the other netbook from acer, asus and lenovo even was around RM 1600. So I decided I'll just go with the Dell lah. But to tell you the truth if I had money to buy for my own use, I'd go with the Lenovo Ideapad S10. Fuh.. she's one sweet mama... Smooth rounded curves, slim white profile. Pergh.. But anywa…