As I start working on my 3’rd plone based site I realize how hard everything was at the beginning and for this reason I will try here to put together some small pointers and links to resources in the order I would have needed them at the beginning thus avoiding the first days of confusion. The sites I have worked on are small sites and maybe plone is not the best solution yet I came to like this handy tool enough to use it even for my personal site.

1. Zope (2.8.8) – I just started with a basic Zope installation which came with my gentoo distribution. There are plenty of links on how to create your Zope instance.

2. Plone – the plone package did not seemed to work from start using gentoo way so I just downloaded the plone package (.tar.gz) and unpacked it in the zope products directory (/var/lib/zope/zope-devel/Products/ in my case).

3. The Zope port – if you are running something else on 8080 then it might be a good idea to change the port in zope.conf (/var/lib/zope/zope-devel/etc/zope.conf)

<http-server><br></br> # valid keys are "address" and "force-connection-close"<br></br>  address 8000<br></br>  # force-connection-close on<br></br></http-server><br></br>

4. Zope debug – since you are not in production it might be also a good idea to enable Zope debug. This will allow you to configure your site easy without the need for restart of zope. Edit the same zope.conf:

debug-mode on<br></br>

Note: for new products such a new theme you still need to restart however you do not need to restart when changing files on disk belonging to that theme.

5. Start Zope – /etc/init.d/zope-devel start (Note: I am using a instance of zope named “devel”. It might be different in your case).

6. Your plone instance – login into zope: http://localhost:8000/manage using the user and password you used to create your zope instance and from the top-right combo box just add: “Plone site”. Fill the data and complete the process and you now have your own plone based site which you can access at: http://localhost:8000/{site id}. I’ll assume I created a site called “len” so I can access it at: http://localhost:10000/len

7. Where to start – as I did, you probably now expect to be able to change the look of your site according to your desire or the desire of the final beneficiary of the site. In my first attempt to do that I started reading the plone book. While this is a very good which I often refer to for various problems I would not recommend it as a first read for someone in a hurry. Instead this other page gave me a much more practical approach.

One observation however is that it is a good thing to start with photo mockup of the site (as in the guide) and not an html mockup since the last would be useless. In my case, when developing a custom web application from scratch, a html mockup was always required. I started like that with Plone and thrown most of the designer work to trash.

You can start directly from here. Once you have your own theme generated you somehow feel lost and do not know from where to start but you can just copy some of the plone files (from CMFPlone/skins/*) to your theme and start by modifying them thus having a better starting point for your modifications.

This is where the work begin, and depending on your CSS skils this might take from a few hours to a few days. One last advice before getting to that: don’t forget to test in IE, as I work in linux this can be an easy thing to forget but I always regret it at the end. Better test every modification in both browser otherwise plan to add 25% of time at the end fixing paddings and margins for this browser incompatibilities.

… some time later

8. Closing access – If your site is not intended for public joining then the next step is reading this how-to to avoid unexpected content.

9. Production – You are now ready to put everything in production but you will soon realize that leaving Zope to answer your requests is a bit slow. For instance when working on this site the initial ab2 tests showed something like:

Server Software:        Zope/(Zope<br></br>Server Hostname:        192.168.1.1<br></br>Server Port:            8000<br></br><br></br>Document Path:          /len/<br></br>Document Length:        18412 bytes<br></br><br></br>Concurrency Level:      1<br></br>Time taken for tests:   87.339312 seconds<br></br>Complete requests:      100<br></br>Failed requests:        0<br></br>Write errors:           0<br></br>Total transferred:      1869200 bytes<br></br>HTML transferred:       1841200 bytes<br></br>Requests per second:    1.14 [#/sec] (mean)<br></br>Time per request:       873.393 [ms] (mean)<br></br>Time per request:       873.393 [ms] (mean, across all concurrent requests)<br></br>Transfer rate:          20.90 [Kbytes/sec] received<br></br><br></br>Connection Times (ms)<br></br>              min  mean[+/-sd] median   max<br></br>Connect:        0    0   1.4      0      11<br></br>Processing:   819  872 185.0    827    2212<br></br>Waiting:      813  867 185.0    821    2207<br></br>Total:        819  872 185.0    827    2212<br></br><br></br>Percentage of the requests served within a certain time (ms)<br></br>  50%    827<br></br>  66%    831<br></br>  75%    835<br></br>  80%    841<br></br>  90%    919<br></br>  95%   1221<br></br>  98%   1579<br></br>  99%   2212<br></br> 100%   2212 (longest request)<br></br>

which of course is not ok for most sites.

The solution is rather simple however: put an apache with mod_cache in front of your site and let it cache most of your content. You should start here.

One very important think when reading this document is that you should not expect the “X-Cache: HIT from yoursite.com” if you are using apache2. I lost a lot of time with different configurations trying to get this header until I finally realized everything was working ok from the beginning but this header was not returned in my version. The best is to check with ab2 or to look into the Z2.log if the request is here. If it is then caching does not work.

Here is my working apache2 config:

<IfModule mod_proxy.c><br></br>	ProxyRequests Off<br></br><br></br>	ProxyPass /photo !<br></br>	ProxyPassReverse /photo !<br></br><br></br>	ProxyPass / http://localhost:8000/VirtualHostBase/http/mysite.org:80/mysite/VirtualHostRoot/<br></br>	ProxyPassReverse / http://localhost:8000/VirtualHostBase/http/mysite.org:80/mysite/VirtualHostRoot/<br></br><br></br>  	CacheRoot "/var/cache/mysite"<br></br>	CacheSize 10000<br></br>	#comment here to disable cache<br></br>	CacheEnable disk /<br></br>	CacheGcInterval 2<br></br>	CacheLastModifiedFactor 0.1<br></br>	CacheMaxExpire 24<br></br>	CacheDefaultExpire 1<br></br>	CacheDirLength 2<br></br>	CacheForceCompletion 100<br></br></IfModule><br></br>

Notice the

ProxyPass /photo !<br></br>ProxyPassReverse /photo !<br></br>

These lines are useful if you want to serve statically the content of the photo directory without passing these requests to zope.

All done? Well almost.

10. Caching issues, different address for editing – you will start to notice that once pages are cached the dynamic part behaves strangely and you have to force refresh sometimes. I think this can be configured within Plone by deciding what parts to cache, however on my site it was desired to have a separate interface for editing the content. Thus editing is done via admin.mysite.org and normal browsing via mysite.org. In this case just add another virtual host with no caching configured and you are all set. If you also want to have different skins for the 2 sites then you have to add an access_rule in zope (check this how-to).

The sites I was talking about: