Plone/Zope

Doing away with the Plone site ID in the URL

February 2nd, 2005

OK, so I'm part of the way there. I had a static home page URL of http://www.itauthor.com/index.html I have a Plone site whose site ID is "plone". You can access my Plone site using the URL http://www.itauthor.com/plone and once in there, anything within the Plone site has the URL http://www.itauthor.com/plone/something I have a MovableType blog with the URL http://www.itauthor.com/notes What I wanted was to replace the static home page with the Plone site - doing away with the "/plone" bit in the URL, but still be able to access my MovableType blog with the same URLs as before. I have achieved this much by adding the following bits in bold to my Apache httpd.conf file:     RewriteEngine On     RewriteCond %{REQUEST_URI} !^/notes.*     RewriteCond /var/www/%{REQUEST_FILENAME} !-f     RewriteRule ^(.*) http://localhost:8080/VirtualHostBase/http/www.itauthor.com:80/VirtualHostRoot/plone$1 [L,P] Read the rest of this entry »

Leave a comment

 

Speeding up Plone

January 4th, 2005

http://poked.org/entries/needforspeed has some well written instructions for setting up caching of Plone objects. The idea is that you can speed up your Plone site by getting Apache to cache pages that are normally dynamically generated by the Zope server. When someone requests a page that has recently been accessed, they get the copy that was placed in the cache, rather than having to wait slightly longer for Zope to build the page again.

Leave a comment



Getting Apache virtual hosting working with Plone

December 9th, 2004

I've just spent the last couple of hours faffing around trying to get virtual hosting working for my Plone site (which will eventually replace the current incarnation of www.itauthor.com). www.zopewiki.org/ZopeAndApache gives the best explanation I could find of how to set things up, using a RewriteRule in Apache's httpd.conf file. However, neither the instructions there, nor in Andy McKay's Definitive Guide to Plone (which I recently bought, and which seems to be a bit of a curate's egg) gave the instructions I needed to get things working. Both sources say to use something along the lines of: (Note: RewriteRule is split between 3 lines here, for readability. In reality it's one very long line.) <VirtualHost *>     ServerName www.itauthor.com     RewriteEngine On     RewriteRule ^/(.*)         http://localhost:8080/VirtualHostBase/http/www.         itauthor.com:80/plone/VirtualHostRoot/$1 [L,P] </VirtualHost> When what I really needed was: <VirtualHost *>     ServerName www.itauthor.com     RewriteEngine On     RewriteRule ^/plone(.*)         http://localhost:8080/VirtualHostBase/http/www.         itauthor.com:80/VirtualHostRoot/plone/$1 [L,P] </VirtualHost> Note the subtle differences with "plone" in the RewriteRule. After lots of trial and error and Holmesian deduction of how RewriteRule worked, I finally figured out the solution and it now works fine - so I can go to bed! One point worth noting, however - something that isn't spelled out in the McKay book or anywhere else I looked - is that the VirtualHost element, i.e.   <VirtualHost *>       ...   </VirtualHost> may already have other stuff in it (it will if, like me, you've just installed Fedora Core 3). Rather than writing a new VirtualHost element, you just add the ServerName, RewriteEngine and RewriteRule attributes to the existing element. My VirtualHost element already had ServerSignature, DirectoryIndex, LogLevel and HostNameLookups attributes. Once I'd figured out that you didn't need a new VirtualHost element, I just added the rewrite attributes underneath the existing attributes. Read the rest of this entry »

Leave a comment



Getting Plone to work on Fedora Core 3

December 5th, 2004

When I tried to install Plone 2.0.3 I got an error message error: Failed dependencies: python2.3 >= 2.3.3 is needed by Plone2-2.0.3-2.i386 even though Fedora Core 3 comes with Python 2.3.4 A comment on this site: http://longsleep.org/howto/rh9-python233/talkback/1101860526 suggests that it's a common-or-garden bug in the RPM file. So (rather than wait for the next Plone RPM) I thought I'd try and use Python 2.3.3, rather than 2.3.4 http://longsleep.org/howto/rh9-python233 gives excellent installation instructions for Python 2.3.3. However, the first time I tried this process I got an error message about more failed dependencies: libstdc++.so.5 libstdc++.so.5(CXXABI_1.2) libstdc++.so.5(GLIBCPP_3.2) So I then tried getting and installing these, using the RPM: libstdc++-3.2-1.i386.rpm To do this I used the commands: # wget ftp://ftp.pbone.net/mirror/www.haoli.org/pub/redhat-7.x/RPMS/i386/libstdc++-3.2-1.i386.rpm # rpm -ivh libstdc++-3.2-1.i386.rpm But, no luck here either, 2.3.3 won't install if you already have 2.3.4 installed, all you get are lots of messages like: file /usr/lib/python2.3/idlelib/textView.pyo from install of python2.3-tools-2.3.3-2pydotorg conflicts with file from package python-2.3.4-11 So I tried using -U for update rather than -i for install: rpm -Uvh db4-4.1.25-14.i386.rpm python2.3-* But this generated, wait for it ... failed dependency error messages: error: Failed dependencies:       libdb-4.2.so is needed by (installed) perl-5.8.5-9.i386       libdb-4.2.so is needed by (installed) python-2.3.4-11.i386       libdb-4.2.so is needed by (installed) pam_ccreds-1-3.i386       ... and so on ...       db4 = 4.2.52 is needed by (installed) pam-0.77-65.i386       db4 = 4.2.52-6 is needed by (installed) db4-devel-4.2.52-6.i386       db4 = 4.2.52-6 is needed by (installed) db4-utils-4.2.52-6.i386 So I tried installing the db4 RPM, using: # wget ftp://ftp.pbone.net/mirror/download.fedora.redhat.com/pub/fedora/linux/core/3/i386/os/Fedora/RPMS/db4-4.2.52-6.i386.rpm # rpm -ivh db4-4.2.52-6.i386.rpm To which I got: Preparing... ########################################### [100%]       package db4-4.2.52-6 is already installed Which is weird, because why was the previous error message complaining about something that was already installed? I then searched for installed packages mentioning "python": # rpm -qa|grep -i python python-2.3.4-11 libxml2-python-2.6.14-2 gnome-python2-canvas-2.6.0-3 dbus-python-0.22-10 rpm-python-4.3.2-21 gnome-python2-2.6.0-3 python-devel-2.3.4-11 python-ldap-2.0.1-2 mod_python-3.1.3-5 gnome-python2-bonobo-2.6.0-3 gnome-python2-gtkhtml2-2.6.0-3 MySQL-python-0.9.2-4 and I tried to delete python-2.3.4-11: # rpm -e python-2.3.4-11 but this just - yep, you've guessed it: error: Failed dependencies: followed by lots of lines like:       /usr/bin/python2 is needed by (installed) system-config-rootpassword-1.1.6-1.noarch       /usr/bin/python2 is needed by (installed) system-config-soundcard-1.2.10-1.noarch       /usr/bin/python2 is needed by (installed) system-config-users-1.2.25-1.noarch       /usr/bin/python2 is needed by (installed) system-config-display-1.0.23-1.noarch At which point I decided it was time to give up on RPMs and try another way - namely installing from source files. To do this, first get the tar files for Zope and Plone: # wget http://zope.org/Products/Zope/2.7.3/Zope-2.7.3-0.tgz # wget http://heanet.dl.sourceforge.net/sourceforge/plone/Plone-2.0.5.tar.gz Then unpack them: # gunzip Zope-2.7.3-0.tgz # tar -xvf Zope-2.7.3-0.tar # gunzip Plone-2.0.5.tar.gz # tar -xvf Plone-2.0.5.tar I then installed Zope (following the INSTALL.txt instructions). [I also read WEBSERVER.txt, with a view to integrating Zone with Apache at a later date] # ./configure --prefix=/opt/zope # make # make install # /opt/zope/bin/mkzopeinstance.py Please choose a directory in which you'd like to install Zope "instance home" files such as database files, configuration files, etc. /home/ac/zope Please choose a username and password for the initial user. These will be the credentials you use to initially manage your new Zope instance. <name> Password: <password> # cd /home/ac/zope # ./runzope At this point I realised that Zope won't run as root and I should have installed it as a non-root user (as the instructions said!). So: # cd /home/ac # chown -R ac:ac zope # cd /home/ac/zope # su ac % ./runzope & Then Ctrl-Z out of there. Then browse to: http://<IP address of host machine>/manage and log in using the login details I'd specified earlier. Next, I moved everything in the /home/ac/zope/Products directory. I then restarted Zope as follows: # ps -ef | grep zope ac 13694 1 7 17:29 ? 00:01:27 /usr/bin/python /opt/zope/lib/python/Zope/Startup/run.py -C /home/ac/zope/etc/zope.conf root 13701 13608 0 17:48 pts/1 00:00:00 grep zope # kill -15 13694 # su ac % /home/ac/zope/runzope & Then refresh the browser at http://<IP address of host machine>/manage and the new products appear in the left pane of the browser: Root Folder > Control Panel > Products Click on Root Folder. In the Add drop-down list, select Plone Site. Click Add. Complete the "Add Plone Site" form that is displayed, and click Add Plone Site. After a couple of minutes, the Welcome page of the new Plone site was displayed. Success!

Leave a comment



^ back to top ^

Page 3 of 3123