PGTS PGTS Pty. Ltd.   ACN: 007 008 568               Mobile Version Coming Soon

point Site Navigation







Valid HTML 4.01!






   Stop Spam! Stop Viruses!
   Secure And Reliable Ubuntu Desktop!

   Ubuntu

   If you own a netbook/laptop~
   Download Ubuntu Netbook!





Using iWeb To Publish Web Pages.

By Gerry Patterson

It has taken me quite a while to get around to exploring all the software that came with my Mac Pro. Eventually I thought I'd give iWeb a trial run.

Like most Mac software, iWeb is very easy to use. You just have to stay inside the clearly defined boundaries of what it will allow you to do.


Starting Up iWeb.

Creating pages with iWeb is effortless, provided you don't stray too far from the straight and narrow. From iPhoto, it was simply a matter of choosing the option to publish a selection and I was taken to a boiler-plate template. (Warning photos are added in the order that are selected, not in the order that they occur in the iPhoto Library). From there it was simply a matter of replacing the template text with my own and clicking on publish. If you have a Mac account your page is published.

iWeb seems happy to work with Firefox or Safari. It will choose whichever browser is currently selected. The pages are very slick and easy to put together. iWeb will publish to a folder or to .Mac, so the site does not necessarily have to be published using Apple's service. I would have liked to have edited a few things myself However, try as I might, I was not able to find the source code for the pages. When images are added or changed the files in ~/Library/Application Support/iWeb/Domain.sites get updated. Each time iWeb is started it brings the HTML pages up from a repository somewhere. I was not able to find where this repository is. And even if I succeed in finding it, I suspect that it would not be readily accessible.

iWeb will build the HTML pages and some Javascript when you choose publish to a folder. This could be used to publish the pages to a third party (rather than Apple's .Mac service).

In order to change things around on the page, and arrange objects and links etc, I had to use the iWeb tools. The first thing to get my head around was The Inspector tool. Forget about typing any HTML code! If you want to add links use the link inspector (choose View->Show Inspector or use the keyboard shortcut Option-Mac-I). If you want to link to one of the page already created use the "One Of My Pages" option.

The code makes use of Java Script and XML. However it validates as W3C. Congratulations Apple! You get a koala stamp! And if I could figure out how to do it, I'd put a W3C logo on the pages, for your efforts.

Changing things is easy ... as long as you do things the Mac way. Just drag and drop something onto your page and it will manifest where you dropped it. It seems that if you want to replace something already on the page you must drag something else on top of it and it will be replaced.

Captions can be added by clicking on the caption below each folder. Each photo gets given a default caption of the filename. I did not bother adding captions, since this was only a test.

If you are are programmer who is used to writing your own code, you just have to learn to relax and let the software do the work for you. I know it's hard to do. It must be how pilots feel when they sit in the left hand seat of one of these new planes that "fly themselves".

I was pleased to discover that the iWeb software is smart enough to publish only the differences when a change is made. So if you change only a few sentences on a single page, it won't slavishly copy all 25 MB of your photos back to the Mac location. My Mac came with a 30 day free trail subscription to the .Mac site which includes 50 MB of space on iDisk. I'm not sure if I will actually renew the subscription when it comes time to shell out the cash. After all I have my own site and Google will publish photos for free on Picasa.

Nevertheless, the whole publishing experience was smooth and well integrated. You don't have to know anything about HTML, CSS, Javascript etc. You can just click a few buttons and your photos are up on the Internet.


Using Third Party Web Hosts.

Next I tried publishing the Web Pages I had created on my own host. This was also easy. I chose Publish to a Folder and then copied the contents of the folder to the PGTS Web host.

However, after I examined the pages. I noticed that the slide show was not the fancy automated slide show that comes up on the .Mac site. When you run a slide show on the .Mac site it uses an in-house java engine of some sort for the slide show. When you publish to a folder on your own site, the slide show viewer is, to put it mildly, somewhat underwhelming. The application creates some Javascript for you in the folder SlideShow_assets in the top level of your Site folder.

A popular replacement seems to be the Couloir slideshow, which looks better, but not as slick as the viewer that Apple use on their .Mac site. (see the bibliography for details).

However I was not able to get the Couloir slideshow working until I had installed a Java servlet on my webhost. The Apache Foundation tomcat application server was the obvious choice. However, installation was difficult for me because the PGTS webhost is a custom built Linux machine. Although it began as a Mandrake server installation, over the years almost every component has been re-built from sources. The configuration is now non-standard and I cannot use a package management tool like aptitude to manage packages. Instead I must download each component and build it from sources.

If you find yourself in a similar situation, here is a quick checklist of problems

Even though I read the BUILDING.txt and RUNNING.txt twice, I still over-looked a small detail that caused me a considerable amount of grief. I carelessly set the CATALINA_HOME variable to the ${tomcat.source} folder rather than dist folder (as is recommended in the RUNNING.txt file). Setting it to the ${tomcat.source} makes tomcat operate very strangely (because there is a "bin" folder in the ${tomcat.source} folder). The dist folder, in the distribution I built, was ${tomcat.source}/output/dist. Using the correct value of $CATALINA_HOME I was able to start tomcat with the startup script $CATALINA_HOME/bin/startup.sh.

I have to admit that the tomcat installation was so laborious, that at one point I seriously considered installing the Ubuntu server distribution and copying across the files to a the newly configured server. Eventually I may have to do this. As each upgrade becomes more difficult, it makes the time spent on a complete system replacement seem less of a chore than the next upgrade of postgres, tomcat, apache etc.

Having persuaded my server to show a better slideshow, I looked at some mechanism to publish the photos, that would be as easy to use as the .Mac interface. It seemed the best way to do this would be with the publish to a folder option in the File menu. I created an NFS share on the webhost and wrote directly to it. I included a cron job on the webhost which would copy the folders to a public folder.

The script that I used was as follows:
#!/bin/bash

mac_src=/nfs/foo/macphoto
mac_tgt=/usr/apache/bar/macphoto
lockfile=$mac_src/mac.lock
if [ -e $mac_src/index.html ] ; then
        if [ -e $lockfile ] ; then
                perl -e "exit 1 if ((-M '$lockfile') > 0.02083)"
                if [ $? -eq 1 ] ; then
                        echo Stale lockfile: $lockfile
                        exit 1
                fi
                exit
        fi
        touch $lockfile
        # give iWeb time to finish writing ...
        sleep 120
        rm -Rf $mac_src/Site/SlideShow_assets
        cp -Rp $mac_tgt/Site/SlideShow_assets $mac_src/Site/
        rm -Rf $mac_tgt/*
        mv $mac_src/* $mac_tgt/
        chown -R apache:apache $mac_tgt
        echo $mac_src published
        rm -f $mac_tgt/mac.lock
fi

Essentially all this script does is look for the published files in the NFS share /nfs/foo/macphoto. If if finds anything there, it creates a lock file (so that another instance of the above script does not interfere with the process), and waits 2 minutes (in case iWeb is still writing data). Then it moves the existing SlideShow assets to the published pages and moves them into the public area. Generally the files are available on the Internet in less then five minutes.

Obviously you would choose better names then foo and bar. Still maybe you might like to keep those names.


Comparisons with iGoogle.

One of the things I have been experimenting with is iGoogle. This is still a beta release. But it looks very promising. The software that Google have put together in this package look like the first tentative steps for the future direction of computing. Most impressive is the fact that Google have so much computing power that they can give resources like this to the customers at zero cost.

There is no iWeb interface to the iGoogle photo sharing package. Google do offer a Picasa Web Albums Uploader for the Mac. I found the easiest way to use this was to select the photos in iPhoto, export them to a temporary folder (shrinking them by about 50%) and then send them up via the Picasa Uploader. After this, I logged in to my iGoogle Picasa account and organised the album online. The pages don't look as fancy as the iWeb photos, but they are very neat and utilitarian. There is an option to sort the albums by filename and by date. There are also tools to copy, move and delete pictures. You can also add captions. The online interface is a bit slow. But if you have a reasonable broadband connection it is not too bad.


BIBLIOGRAPHY:

The following are some links which might prove useful.

Couloir Slideshow

A better looking slideshow. This slideshow looks better, and has some fancy sound effects. It lacks the automated viewer that Apple has on their .Mac site (and the pop-up index at the top of the viewer). The author offers a download of the source code here, under a Creative Commons license.

Mac Site

My Trial Account. Apple offered me a 30 day trial account. This looked very good, but with free offerings from iGoogle and my own web site I didn't feel inclined to buy a subscription. The site has since been discontinued, so it is no longer possible to view the link.

PGTS Mac Site

PGTS Mirror of .Mac Site. This is the same site, published on www.pgts.com.au. It uses the Couloir slide show (because it lacks the Mac Java subroutines). You can get an idea of what the Mac site used to look like.

iGoogle Picasa

Picasa Test Page. Here is one of the pages from the iWeb test that I did earlier. This was organised with the online Picasa tools.