Personal tools
You are here: Home plone with eggs

plone with eggs

by JeP — last modified Dec 13, 2008 05:36 PM
Filed Under:

At my work (systems programmer at http://www.SARA.nl) I am part of the team to setup the new website for High Performance Computing and Visualisation. At my formerr job at Zest software I worked with Plone. During the discussions in the website team I got an itch to (re)setup this website. In this post I will comment on my experience on setting up a Plone 3 site from scratch with the Quills blog product.

 

Introduction

Lets start with a little history. Me and my brother were blogging on our old website in pure html. At that time the word blogging did not even exist. Later on we made some php forms in front of a database back-end to make it more easy to add a new post to our website.

Also we extended our site with a rudimentary chat page. Our latest invention on our own site was to let our viewers add their own items, we called it "make your own news".  All that was many years ago -- i start to feel old when i hear myself say that.

So lets talk about setting up Plone. There are somem misunderstandings about Plone, and one is that it is so hard to setup and difficult to understand in comparison to other Content Management Systems (CMS).

Maybe that is partly true, Plone is an Open Source Enterprise CMS, and has a different focus than many other Open Source CMS systems, like Joomla, Wordpress or Drupal.

Plone can compete with all of these and has o lot better track record when it comes to security issues.

Let me  explain what I did to set things up to get this site running.

My webserver

  • Apache server in front (need redirects in apache, outside of the scope of this post)
  • A Pentium III 800 MHz machine, with 512Mb of Ram (quite slow for a Plone site)
  • Debian Etch with the build tools (aptitude install build-essential) installed - not sure if that is enough I started from a running Debian.

My goals

  • website with blogging functionalities
  • test site  for testing before applying changes to the "production site"
  • keep it simple (also to manage, backup and maintain later on)

Installing Python, Zope and Plone

At my former job at http://www.zestsoftware.nl as time passed we ended up with different versions of Python, different versions of Zope, and different versions of Plone. All installed on different locations. Every site was setup in a different way and it was becoming a more difficult to maintain.

 Now Plone.org comes with the unified installer for Unix based Plone installations. And I wanted to try that.

  • as root
    • downloaded Plone Unified installer for Linux/BSD/Unix from http://plone.org/products/plone
    • unpacked to /opt/Plone-3.X.X-UnifiedInstaller/
    • chmod  /opt/Plone-3.X.X-UnifiedInstaller/  to +rwx for all
  • as normaluser
    • cd to /opt/Plone-3.XX-Unifiedinstaller and run ./install.sh --instance=test.site.com  standalone
    • everything you need will be build in /home/normaluser/Plone-3.X/

 The first time you run this can take some time. After the first time, building a new instance seemed to go faster.

 The build worked with no issues for me. The Zope/Plone instance is in the  sub folder /test.site.com/.

 The installer informed me nicely about the new admin user and (randomly generated) password. To start the new Plone instance I had to go into the instance folder and issue the command "bin/instance start". Out of the box the site will run on port 8080, so your newly created Zope instance can be managed at http://YourServersAddress:8080/manage/

The buildout command also generated a fresh Plone site in the Zope instance which can be reached at http://YourServersAddress:8080/plone.

 In my situation I wanted to run the site on another port. This is done in the file buildout.cfg, where i changed the variable http-address =  to the number i wanted. After changing the file I ran bin/buildout.

And automagically the new configuration was  put into the relevant zope config file(s). After starting te instance with bin/instance stop  ; bin/instance start the instance was running on my preferred port.

 Buildout is a wonderful thing, it makes handling Zope and Plone easy. Lets see how to use it to add an add-on product. 

Add-on Product with Python Eggs

To install an add-on product in Plone in the past you had to find it download it and unpack it inside your Zope instance Products folder. in the README..txt you would find the dependencies of the Product. That is becomming history, lets look at the future.

 As one of the early bloggers, I want to have a blog Product. So lets try Quills. Quills has a Python Egg of a beta version of Quills 1.7 something.

Modern Python products are more and more distributed in eggs.

 One of my goals is to setup a site easily, but also set it up in a way that is easy to maintain. So it would be nice if i can configure all needed add-ons and configuration settings in one configuration file. Thats where we have buildout.cfg.

 I added one line to buildout.cfg so the part from eggs now looks like this:

# Add additional eggs here
# elementtree is required by Plone
eggs =
    elementtree
    FeedParser
    Products.Quills

  The line  "Products.Quills" is all that was added to the buildout.cfg file. After that, just running bin/buildout is enough.

  Buildout will do the hard work. Finding the Quills product somewhere,  downloaded it, configured and installed the thing, complete with dependancies.

  After starting the instance again, with bin/instance start the site Quills was now available in Plone as an installable product.

  To tell the Plone site to install the Quills product I went to

http://yourServerAddress:8080/Plone/prefs_install_products_form where i choose all Quills related stuff and clicked the install button. After that in the Plone site the choice "weblog" was added to the "Add New..." menu.

  Another product that I installed was the easy-backup recipe for buildout. For more information about that, Reinouts post - see my references below.

  Building the second instance for testing purposes was easy. It was just a matter of copying the instance folder and everything in it with cp -a, editing the buildout.cfg to use another port, and running bin/buildout.

  In a few hours I managed to install a Plone site (and a test stie) with an add-on product for blogging functionality. After installing the easy backup recipe the site could also be backed up easily.

TIPS

  • try running bin/buildout again if something went wrong (downloads could have failed)
  • start in foreground mode bin/instance fg to see what is happening
  • go to http://myserveraddress:8080/manage to manage your site(s) from the Zope Management Interface (ZMI)
  • add an email server to the mail config in Site Setup
  • run in debug mode if you are busy changing thing on the instance filesystem - changed files will be reread on a reload of a page
  • if you try your mail server settings with the contact form (and still logged in as admin) you might get the following error:  "Please correct the indicated errors."  Don't worry, you filled in the two fields, subject and message in the right way. This error is related to the fact that user admin has no email address set, and a logged in user is expected to have an email address. 
  • you must go inside the installation dir and start the installer with ./install.sh, else the install will not work

Issues

During the installation there were a few issues, I will mention them to help myself and others to not get into the same situation as I did this time.

 The titles of blog entries are very small, they are on the site displayed in a small  letter (with H3). This is in my opinion related to the issue:

http://plone.org/products/quills/issues/151

  In the test instance I tried to change the some basic css from the standard NuPlone. The file I edited was [instancename]/parts/plone/NuPlone/skins/nuplone_styles/nuplone.css.

I expected that changing the blue color from the portlets and menu background, would be easy. But somehow in the little time i spend on it, I was not able to get the Quills portlet "Weblog Authors" to show up in the purple color I wanted. Other parts were changed though (after restarting the instance). Remember Quills was a beta version, and I did not put much time in finding a solution. To really make my own skin, I think I would better make my own skin product and set that up correctly in buildout.cfg to be installed  automatically.

   Another strange thing happened. To try to follow my own steps while I was writing this post I wanted to make a new instance. Somehow  this time I did not get a Plone site inside the new Zope instance.

When I tried running the new instance in the foreground with

newinstance/bin/instance fg, I saw the following errors:

zope.configuration.xmlconfig.ZopeXMLConfigurationError: File "/home/USERNAME/Plone-3.1/tijdelijktest/parts/instance/etc/site.zcml", line 15.2-15.23
    ZopeXMLConfigurationError: File "/home/USERNAME/Plone-3.1/Python-2.4/lib/python2.4/site-packages/Products.Quills-1.7.0b2-py2.4.egg/Products/Quills/configure.zcml", line 7.2-7.34
    ZopeXMLConfigurationError: File "/home/USERNAME/Plone-3.1/Python-2.4/lib/python2.4/site-packages/quills.app-1.7.0b1-py2.4.egg/quills/app/configure.zcml", line 7.2-7.34
    ZopeXMLConfigurationError: File "/home/USERNAME/Plone-3.1/Python-2.4/lib/python2.4/site-packages/quills.app-1.7.0b1-py2.4.egg/quills/app/security.zcml", line 5.4
    ImportError: No module named core.interfaces

   Guess something went wrong when Quills was installed (with the eggs method or while trying it in other ways). I have to get deeper understanding of zcml and eggs and configurations, but that is outside the scope of this project.

  It was still possible to setup a Plone site in the "broken" instance. All the needed products were still installed, so I had to log into the ZMI and select "Plone Site" from the drop-down menu, click the Add button, and wait.

   The biggest problems to get the site running were not Zope and Plone related. One of the problems was myself. Yesterday evening I was trying to finish things while I was sleepy... The other thing was that the firewall rules on my server did not let connect to my site. I kept on puzzling with my rewrite rules in Apache and my /etc/hosts file to try to see the website, but could not get it to work. After solving the first issue with a good night rest, the firewall issue was resolved quickly.

Conclusion

First of all I have to conclude that setting up Plone on a Linux based system is easy. A few simple steps and Zope and Plone are running. It took only a few hours, to compile, install, play and get things right to my liking.

  At the moment there are two issues. The first one, is I have to learn how to make my own skin product and configure that in buildout.cfg before I can start to change the look of the site, else my changes will get lost when running bin/buildout. The other issue is the error when trying to set up a new instance. These are minor issues, which was maybe caused while using a beta state version of an add-on product for Plone.

  If you read this post, you can see that the basic functions of Zope, Plone and the beta version of the add-on product Quills are working well.

References

http://plone.org/documentation/tutorial/installing-plone-3-with-the-unified-installer

http://reinout.vanrees.org/weblog/archive/2008/07/03/easy-backups-with-buildout

http://quills.sitefusion.co.uk/blog/archive/2008/06/04/weblog-products-quills-and-quillsenabled-beta-releases

Document Actions