Serving Web Pages

The Connection Manager can be used to serve your own web pages, in a similar manner to the Remote Administration pages. This is done by defining an <alias> in kconf.xml. The list of aliases can be viewed and edited by selecting the Display/Update web aliases link on the KCML System Configuration page.

An alias maps the URL that a browser will use to request the web page to a file or directory on the host's filesystem. An alias has the follow properties:

PropertyPurpose
Alias NameThe alias name is used in the URL to request the page
Real NameThe location of a file or directory on the host's filesystem
TypeControls how the requested URL is processed
Authentication requiredIf set yo Yes, the a valid username and password will be required to view the page.

Let's take an example of an alias called TestAlias. The Connection Manager will then use this alias when processing requests for a URL of the form http://hostname:790/TestAlias.

Alias Types

The behaviour of the web server, when processing a requested URL, depends on the Type of the alias.

Per-Service aliases

The Connection Manager also allows a service to define its own aliases. When requesting pages that are defined in a per-service alias, the service name is used in the URL. For Example:

http://hostname:790/serviceName/TestAlias

The Connection Manager will expand any environment variables that are used in the Real Name value. Scripts that are executed using a CGIScript and CGIDirectory alias type will also inherit the service's environment variables.

Include files

It may be more convenient to define a list of aliases outside of kconf.xml. This can be achvied, in KCML 6.20 onwards, by storing the aliases in an included XML file. This include file is then referenced by adding an alias, in kconf.xml, with a Alias Name of 'include' and a Real Name which is the location of the the XML file.

Caching

From KCML 6.20 onwards, the Connection Manager supports HTTP Caching. When a web page is downloaded to a browser, the datestamp of the file is also sent. The web browser now 'knows' how old the file is. If the browser then requests the web page again, it sends this datestamp to the Connection Manager. The Connection Manager then compares this datestamp to the modification time of the file on host's filesystem. If the file has not changed, a tiny HTTP packet is sent back to the browser. This instructs the browser that its cached copy is up to date. If the file has been modified since, then the Connection Manager will resend the new page to the browser. The use of caching can greatly reduce the amount of network traffic for frequently requested web pages.

File Types

When a file is downloaded to a browser, the browser is told what type of data it is receiving. The browser can then decide how to process the data. This file type information called the MIME type and is deduced from the dot extension of the file's pathname. If the file has no dot extension, the contents of the file are scanned. However, this can be inefficient on large files. The list of MIME types and filename extensions that the Connection Manager recognized are as follows

MIME typeFile extensionsDesciption
application/msworddocMicrosoft Word document
application/octet-streambin dms lha lzh exe class dll ocx drv com so sl Binary files, e.g. executable programs, shared libraries
application/pdfpdfAdobe Acrobat document
application/vnd.ms-excelxlsMicorsoft Excel spreadsheet
application/vnd.ms-powerpointpptMicrosoft Point Point presentation
application/x-cpiocpioUnix CPIO archive
application/x-gtargtarGnu TAR archive
application/x-gzipgz gzipGZIP archive
application/x-javascriptjsJava script
application/x-tartarUnix TAR archive
application/zipzipZIP archive
image/bmpbmpWindows BitMap image
image/gifgifGraphics Interchange Format (GIF) image
image/jpegjpeg jpg jpeJoint Photographics Expert Group (JPEG) image
image/pngpngPortable Network Graphics (PNG) image
image/tifftiff tifTagged Image File Format (TIFF) image
text/csscssCascading Style Sheet
text/htmlhtml htmHyperText Markup Language (web page) document
text/plainasc txt ksh sh cmd batText files, command scripts etc
text/richtextrtxText with formatting data
text/rtfrtfMicrosoft Rich Text Format
text/sgmlsgml sgmStandard Generalized Markup Language document
text/tab-separated-valuestsvTab Separated Values data
text/xmlxml dtdeXtened Mark Langauage (XML) document
application/xmlxsleXtensible Stylesheet Language transform script
encoding/x-compressZFile compressed with the Unix compress command