NCCI Web Site Developers' Guide
This page provides information for the developers and webmasters who work on the NCCI Web site.
Directory Structure

On the web server, these are the subdirectories of the NCCI Web site. Note that not all the directories contain material for display on a web browser.

History and Deployment

A prototype web site for the NCCI was developed in March 2001 and deployed at goss.rho.net/ncci. It was intended to be a working model of a fully featured Chamber of Commerce web site, and a starting point for future development.

Any questions about this site, and in particular items that this document does not address, can be addressed to Clint Goss at clint@goss.com. You can also visit the goss.com web site.

Web Server Requirements

In order to run this web site, these components need to be loaded/available:

How the Scripts Work

This site makes heavy use of "generation" techniques to produce the HTML web pages.

The scripts in the /src subdirectory do all the work. They all have the name gen_XXX.pl. Typically on a Windows box with ActiveState perl installed, you will have to run each of them with the command:

perl gen_XXX.pl

They can be run in any order. They typically combine information from the subdirectories /dat an /cfg, together with the .pag page files and the .htt template files, to produce pages in the /htm, /htms, /events, and /members subdirectories.

On an MS-Windows box, you can run the script gen.bat which will run all the gen_XXX.pl scripts.

How the Rebuild the Entire Web Site from Scratch

Here's an outline of how to generate the entire web site from scratch. This assumes that the key components - Apache, Perl, and SMTP mail - have been set up as described above.

  1. Establish a symbolic link from /sys/perl to the executable for Perl on your system.

  2. Ensure that the executable /usr/sbin/sendmail is present. If it is installed somewhere else, you will need to change the hard-coded reference in the file /src/genlib.pl.

  3. Edit the file /cfg/config.tlh and set all the relevant parameters - the date and correct version of the site.

  4. Edit the files /cfg/feedback.mailto, /cfg/membership.mailto, and /cfg/survey.mailto to specify the appropriate mail recipient(s) for each function.

  5. Set up the correct access files for your web server so that the web server will execute all .cgi scripts in the /cgi directory.

  6. Set up the correct access files for your web server so that the web server will authenticate access to any .htm files in the /htms directory. On an Apache web server with basic authentication, you will need to set a .passwd file in this directory.

  7. Update up the source .xls files, Membership.xls, BusinessOpportunities.xls, and StandingCommittes.xls with current information.

  8. Bring up each of the source .xls files in turn, and export them as .csv files with a .csv extension into the /dat directory. Use extreme caution not to overwrite the source .xls file with the CSV version.

  9. Create empty files in the /log directory feedback.log, membership.log, and vatSurvey.log, and make sure they are writable by all.

  10. Make sure the directories /log and /tmp are writable by all.

  11. Run the script /src/gen.bat. If you are not on a Windows system, then execute each of the commands in that script by hand (there are only a few).
The site should now be fully functional. Test it.

If you have any issues that you can't unravel yourself, contact Clint Goss at clint@goss.com.

Perl Module Man Pages

On-line man pages are available for the Perl Modules used for this site:

How the Clean up the Site

This section describes how to "clean up" the site. You might need to do this to minimize space before making a copy over a slow link, or before a backup.

All files in the /pag and /tmp subdirectories can be removed at any time with no effect on the site.

The log files in /log can be removed at any time, but you will lose the history of logged feedback items, submitted membership applications, etc.

In addition, all files in the following subdirectories can be removed. Removing these files will render the web site unusable, but these files can be regenerated (on a system with Perl installed).

Format for Source Spreadsheets

Most of the "source" information for this web site is containined in a set of Excel (.xls) spreadsheets. These are exported to .csv files, which are read by the perl scripts to produce the .htm web pages.

In order for the perl scripts to work correctly, specific things in the spreadsheets must be maintained.

TBD

Secure User Management

Access to the secure documents in the /htms directory is via Apache basic authentication. The user-password database is contained in the file /htms/.passwd. This file uses the standard Unix username:encrypted-password format.

Management of this user password file is currently extremely rudimentary. The script /bin/addPassword opens a password file and appends a new entry on the end. It uses the CryptPasswordFile.pm Perl module.

If you want to modify a password entry, you would need to

How the Mail-based Features Work

Many of the interactive features of the web site operate via Email. For example, feedback, on-line application for membership, and registration to receive email distributions all end up by sending an email message back to NCCI with the approriate information as entered on an HTML form by the person browsing the web site.

These emails are sent to one or more email addresses as specified in the file /cfg/XXX.mailto where XXX is particular to the feature. (eg. /cfg/feedback.mailto holds the recipient email addresses for the site feedback feature).

These .mailto files contain one or more email addresses, one email address per line. Make sure that there are no extra spaces on the line with the email address. Comments are NOT allowed in these files.

If You Have Problems

This section lists some things to check if you experience problems with this site.

To Do

This section is a roster of items which remain to be done.

Issues

This section lists some known problems and issues with the site. In particular, these are items which do not necessary belong in the "To Do" list above.


Copyright © 1998-2001 Namibia Chamber of Commerce and Industry. All Rights Reserved.
Site Version 1.04 - Last updated November 6, 2001.