iTools - A Beginners guide - Installing An Event Calendar
by Terry Allen
One of the great things about running a server package such as iTools under Mac OSX is that with the underpinnings of a *nix operating system, a world of open source software such as Apache, PHP & the like can be relatively easily built & maintained using a web-based interface.
In this latest guide, I had a request from a client to add a calendar for their users to collaborate & organise meetings, so I went looking for a variety of options. I took a good hard look for something that didn't have a massive set of requirements & after a few trial installations, I came across Event Calendar, which is a freely downloadable & easily configurable Perl script from Nermware. Unlike a lot of the other calendar scripts out there, Event Calendar has a requirement only for Perl & a CGI-enabled webserver, so for those running iTools, or for that matter, anyone running Apache on a *nix based system, you're set. A lot of the alternatives require a multitude of things such as MySQL, so for a first time try, simple is best.
First off, you'll be needing the script itself, which you can find here, so go download it, because you'll be needing it before going any further, as there's a little bit of script editing to do.
Now you've got the script sitting on your hard drive, we need to open the script itself up. You can do this with your favourite text editor, or if you're editing this on a remote server, you can open it up in the terminal with something like pico. So, in the terminal, you'll need to navigate to the directory the script is in, like so:
# cd eventcalendar/cgi-bin # pico eventcalendar.pl
Our first piece of business is the very first line of the script, as it tells us the location of Perl on our system, so you need to change the first line which looks like this:
#! /usr/local/bin/perl -w
#! /usr/bin/perl -w
If you don't change this, you can pretty much kiss your chances of getting the script up & running goodbye before you've even started.
Now you need to have a read through the script, as you'll learn some things about how the calendar interacts with the database, where stuff is stored & the like. There are some defaults which need to be looked at for your system, as you may well have differing fie structures than the normal setup, or you may prefer to install stuff into different locations. Whatever the case, the best way is to read through both the script & it's accompanying ReadMe file.
Next down the list is to set the correct email - the default is the address for the website you downloaded it from, so you'll want to change these lines:
# Where you want people to email to $myemail = 'firstname.lastname@example.org';
to read something more like this:
# Where you want people to email to $myemail = 'email@example.com';
Just below this, there's a section which says:
$usemyemail = 1;
If you change the 1 to a 0, then the email address won't be listed anyway, but it's a good idea to edit this to include your email, as any errors which may be generated should direct a user to your email address, not the author.
A little further down & we're getting to where things are actually stored, such as the actual calendar database & the images which are used. For the time being, there's no need to change these, as the defaults work fine on our iTools system. Now, you can leave the script alone until such time as you wish to attempt some modifications on it, but we're not quite done yet.
Our next step is to upload the images to our web directory, so the location of this must be accessible by the webserver to generate them to public viewing. The best idea is to upload them into the top level of the web directory in a folder called eventcalimages, for example, if you upload them to the correct place, you should be able to call them up by loading a URL in your browser similar to the following: http://www.yoursite.com/eventcalimages.
You'll also want to now install the script into your CGI directory. On a default iTools installation, you'd put it in the following location:
You'll also need to edit the permissions for the script, so, from the terminal, you'd enter the following:
# chmod 755 eventcalendar.pl
The 755 is pretty much the default permissions level for allowing CGI execution for Apache, so stick with it. If you have trouble, you may need to ensure that something else isn't happening. One thing to make sure is that your script has been uploaded as a text file - in the past, under Mac OS 9 etc..., I was caught out a lot after uploading text files as raw data, which ruins the returns at the end of lines, so the scripts do not execute correctly.
Next up, we need to add our directory for the calendar database. This is set by default in the CGI directory, so until you're sure everything is working properly, install a directory here like so in the Terminal once again, from within the CGI directory:
# mkdir caldb
Now this directory by default will need default permissions of 777, so have an experiment with permission levels after you have things working, but set the permissions as follows:
# chmod 777 caldb
Now, you're ready to try out your calendar for the first time, so head off into your web browser & enter the URL for your script:
All being well, you should see a blank calendar, but if not, you may have one more step to perform - creating a blank database file, if the script does not create it's own. It's easy enough, just upload a blank text file called:
You may need to set the permissions to 777 for that file as well, but see if it works before making any changes to the file first.
Well, that was pretty easy wasn't it? If you want to see a test calendar in action, there's one at the Nermware site, here: http://www.nermware.com/cgi-bin/eventcalendar.pl
There are a number of additions available at little cost, but the basic calendar itself is a free script. I hope this gets you started on a calendar of your own & has you up & running.
Terry Allen runs the current version of Tenon's iTools along with a variety of different software & scripts. He has been using Tenon's products since the days of Mac OS9 & WebTen. You can visit some of his sites at http://heard.com.au or http://itavservices.com