25.01.2015 Views

Installing and Configuring the CSP Gateway - InterSystems ...

Installing and Configuring the CSP Gateway - InterSystems ...

Installing and Configuring the CSP Gateway - InterSystems ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Installing</strong> <strong>and</strong> <strong>Configuring</strong><br />

<strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong><br />

Version 5.2<br />

01 September 2006<br />

<strong>InterSystems</strong> Corporation 1 Memorial Drive Cambridge MA 02142 www.intersystems.com


<strong>Installing</strong> <strong>and</strong> <strong>Configuring</strong> <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong><br />

Caché Version 5.2 01 September 2006<br />

Copyright © 2006 <strong>InterSystems</strong> Corporation.<br />

All rights reserved.<br />

This book was assembled <strong>and</strong> formatted in Adobe Page Description Format (PDF) using tools <strong>and</strong> information from<br />

<strong>the</strong> following sources: Sun Microsystems, RenderX, Inc., Adobe Systems, <strong>and</strong> <strong>the</strong> World Wide Web Consortium at<br />

www.w3c.org. The primary document development tools were special-purpose XML-processing applications built<br />

by <strong>InterSystems</strong> using Caché <strong>and</strong> Java.<br />

The Caché product <strong>and</strong> its logos are registered trademarks of <strong>InterSystems</strong> Corporation.<br />

The Ensemble product <strong>and</strong> its logos are registered trademarks of <strong>InterSystems</strong> Corporation.<br />

The <strong>InterSystems</strong> name <strong>and</strong> logo are trademarks of <strong>InterSystems</strong> Corporation.<br />

This document contains trade secret <strong>and</strong> confidential information which is <strong>the</strong> property of <strong>InterSystems</strong> Corporation,<br />

One Memorial Drive, Cambridge, MA 02142, or its affiliates, <strong>and</strong> is furnished for <strong>the</strong> sole purpose of <strong>the</strong> operation<br />

<strong>and</strong> maintenance of <strong>the</strong> products of <strong>InterSystems</strong> Corporation. No part of this publication is to be used for any o<strong>the</strong>r<br />

purpose, <strong>and</strong> this publication is not to be reproduced, copied, disclosed, transmitted, stored in a retrieval system or<br />

translated into any human or computer language, in any form, by any means, in whole or in part, without <strong>the</strong> express<br />

prior written consent of <strong>InterSystems</strong> Corporation.<br />

The copying, use <strong>and</strong> disposition of this document <strong>and</strong> <strong>the</strong> software programs described herein is prohibited except<br />

to <strong>the</strong> limited extent set forth in <strong>the</strong> st<strong>and</strong>ard software license agreement(s) of <strong>InterSystems</strong> Corporation covering<br />

such programs <strong>and</strong> related documentation. <strong>InterSystems</strong> Corporation makes no representations <strong>and</strong> warranties<br />

concerning such software programs o<strong>the</strong>r than those set forth in such st<strong>and</strong>ard software license agreement(s). In<br />

addition, <strong>the</strong> liability of <strong>InterSystems</strong> Corporation for any losses or damages relating to or arising out of <strong>the</strong> use of<br />

such software programs is limited in <strong>the</strong> manner set forth in such st<strong>and</strong>ard software license agreement(s).<br />

THE FOREGOING IS A GENERAL SUMMARY OF THE RESTRICTIONS AND LIMITATIONS IMPOSED BY<br />

INTERSYSTEMS CORPORATION ON THE USE OF, AND LIABILITY ARISING FROM, ITS COMPUTER<br />

SOFTWARE. FOR COMPLETE INFORMATION REFERENCE SHOULD BE MADE TO THE STANDARD SOFTWARE<br />

LICENSE AGREEMENT(S) OF INTERSYSTEMS CORPORATION, COPIES OF WHICH WILL BE MADE AVAILABLE<br />

UPON REQUEST.<br />

<strong>InterSystems</strong> Corporation disclaims responsibility for errors which may appear in this document, <strong>and</strong> it reserves <strong>the</strong><br />

right, in its sole discretion <strong>and</strong> without notice, to make substitutions <strong>and</strong> modifications in <strong>the</strong> products <strong>and</strong> practices<br />

described in this document.<br />

Caché, <strong>InterSystems</strong> Caché, Caché SQL, Caché ObjectScript, Caché Object, Ensemble, <strong>InterSystems</strong> Ensemble,<br />

Ensemble Object, <strong>and</strong> Ensemble Production are trademarks of <strong>InterSystems</strong> Corporation. All o<strong>the</strong>r br<strong>and</strong> or product<br />

names used herein are trademarks or registered trademarks of <strong>the</strong>ir respective companies or organizations.<br />

For Support questions about any <strong>InterSystems</strong> products, contact:<br />

<strong>InterSystems</strong> Worldwide Customer Support<br />

Tel: +1 617 621-0700<br />

Fax: +1 617 374-9391<br />

Email: support@<strong>InterSystems</strong>.com


Table of Contents<br />

1 Introduction ..................................................................................................................... 1<br />

2 Web Servers for Microsoft Windows ............................................................................. 5<br />

2.1 Microsoft Peer Web Server (PWS) <strong>and</strong> Internet Information Services (IIS) ........... 6<br />

2.1.1 Installation ...................................................................................................... 6<br />

2.1.2 Option 1: Using <strong>the</strong> ISAPI Modules (<strong>CSP</strong>ms*.dll) ........................................ 7<br />

2.1.3 Option 2: Using an ISAPI Module with <strong>the</strong> NSD (<strong>CSP</strong>cms.dll) .................. 12<br />

2.1.4 Option 3: Using <strong>the</strong> CGI Modules with <strong>the</strong> NSD (nph-<strong>CSP</strong>cgi*.exe) ......... 15<br />

2.2 Netscape, iPlanet, <strong>and</strong> Sun Web Servers ................................................................ 17<br />

2.2.1 Installation .................................................................................................... 18<br />

2.2.2 Option 1: Using <strong>the</strong> NSAPI Modules (<strong>CSP</strong>n3*.dll) ..................................... 19<br />

2.2.3 Option 2: Using an ISAPI Module with <strong>the</strong> NSD (<strong>CSP</strong>cn3.dll) .................. 21<br />

2.3 Apache Servers ....................................................................................................... 23<br />

2.3.1 Installation (All Connectivity Options) ........................................................ 23<br />

2.3.2 Option 1: Using <strong>the</strong> Apache API Modules (<strong>CSP</strong>a*.dll) ............................... 25<br />

2.3.3 Option 2: Using <strong>the</strong> CGI Modules with <strong>the</strong> NSD (nph-<strong>CSP</strong>cgi*.exe) ......... 26<br />

2.3.4 Option 3: Using an Apache API Module with <strong>the</strong> NSD (mod_csp*.dll) ..... 29<br />

2.3.5 Option 4: Using <strong>the</strong> ISAPI Modules (<strong>CSP</strong>ms*.dll) ...................................... 31<br />

2.4 Operating <strong>the</strong> Network Service Daemon (NSD) .................................................... 33<br />

3 Web Servers for UNIX, LINUX, <strong>and</strong> Mac OS X ........................................................ 35<br />

3.1 Netscape, iPlanet, <strong>and</strong> Sun Web Servers ................................................................ 35<br />

3.1.1 Installation .................................................................................................... 36<br />

3.1.2 Option 1: Using <strong>the</strong> NSAPI Modules (<strong>CSP</strong>n3*.so) ..................................... 38<br />

3.1.3 Option 2: Using a NSAPI Module with <strong>the</strong> NSD (<strong>CSP</strong>cn3.so) ................... 40<br />

3.2 Apache Servers ....................................................................................................... 41<br />

3.2.1 Installation (All Connectivity Options) ........................................................ 42<br />

3.2.2 Option 1: Using a Dynamic Apache API Module with <strong>the</strong> NSD (mod_csp*.so)<br />

................................................................................................................................ 43<br />

3.2.3 Option 2: Using <strong>the</strong> CGI Modules with <strong>the</strong> NSD (nph-<strong>CSP</strong>cgi*) ............... 47<br />

3.2.4 Option 3: Using a Built-in Apache API Module with <strong>the</strong> NSD (mod_csp.c) ....<br />

5 0<br />

3.3 Operating <strong>the</strong> Network Service Daemon (NSD) .................................................... 55<br />

4 General Web Server Configuration Issues .................................................................. 57<br />

<strong>Installing</strong> <strong>and</strong> <strong>Configuring</strong> <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong><br />

iii


4.1 A Note on <strong>the</strong> CGI Modules Supplied ................................................................... 57<br />

4.2 Security Issues in Accessing <strong>the</strong> <strong>Gateway</strong>’s Systems Management ..................... 58<br />

4.3 Making a <strong>CSP</strong> Page <strong>the</strong> Default Page (or ‘Homepage’) for <strong>the</strong> Web Server ......... 59<br />

4.3.1 Peer Web Server ........................................................................................... 60<br />

4.3.2 Internet Information Services ....................................................................... 60<br />

4.3.3 Netscape, iPlanet, <strong>and</strong> Sun Web Servers ...................................................... 61<br />

4.4 Apache Servers ....................................................................................................... 62<br />

iv<br />

<strong>Installing</strong> <strong>and</strong> <strong>Configuring</strong> <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong>


1<br />

Introduction<br />

This document describes <strong>the</strong> procedures for configuring <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong> to work with all<br />

<strong>the</strong> Web servers that Caché supports. The <strong>CSP</strong> <strong>Gateway</strong> is responsible for providing <strong>the</strong><br />

communications layer between <strong>the</strong> hosting Web server <strong>and</strong> Caché.<br />

In most cases, <strong>the</strong> automatic installation procedures supplied with <strong>the</strong> Caché distributions<br />

provide a working system without <strong>the</strong> need to manually follow <strong>the</strong> instructions in this document.<br />

However, for cases where atypical Web server architectures are encountered or for<br />

advanced users who wish to get <strong>the</strong> best out of <strong>the</strong>ir environments, this document contains<br />

all <strong>the</strong> necessary installation <strong>and</strong> configuration information:<br />

Operating System<br />

Microsoft Windows<br />

Web Servers<br />

Microsoft — Internet Information Services (IIS), including Peer<br />

Web Server<br />

Sun — Netscape, iPlanet, Sun ONE, <strong>and</strong> Sun Java System<br />

Apache<br />

UNIX<br />

Sun — Netscape, iPlanet, Sun ONE, <strong>and</strong> Sun Java System<br />

Apache<br />

High performance connectivity solutions are supplied with <strong>CSP</strong> for Microsoft,<br />

Netscape/iPlanet/Sun <strong>and</strong> <strong>the</strong> Apache Web servers. Connectivity to Caché through <strong>the</strong><br />

Common <strong>Gateway</strong> Interface (CGI) is available for all supported Operating Systems <strong>and</strong>, as<br />

such, can potentially offer support for Web servers not explicitly mentioned in this guide.<br />

The Microsoft <strong>and</strong> Netscape/iPlanet/Sun line of Web servers both support a multithreaded<br />

API which allows extensions, in <strong>the</strong> form of dynamically bound libraries, to be made to <strong>the</strong><br />

<strong>Installing</strong> <strong>and</strong> <strong>Configuring</strong> <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong> 1


Introduction<br />

Web server’s core functionality. Current versions of <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong> make full use of <strong>the</strong>se<br />

APIs in order to bring high-performance Web connectivity to <strong>the</strong> Caché system. The Windows<br />

version of Apache also operates in an exclusively multithreaded mode <strong>and</strong>, as such, can also<br />

take advantage of <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong> implemented as a dynamically bound library.<br />

The UNIX version of Apache are architecturally different from <strong>the</strong> Microsoft <strong>and</strong><br />

Netscape/iPlanet/Sun Web servers in that <strong>the</strong>y are not inherently multithreaded servers <strong>and</strong>,<br />

as such, do not support <strong>the</strong> multithreaded style of API. In order to support <strong>the</strong>se versions of<br />

Apache (<strong>and</strong> similarly designed Web servers) <strong>the</strong> multithreaded <strong>CSP</strong> <strong>Gateway</strong> is implemented<br />

as a st<strong>and</strong>-alone executable that runs independently of <strong>the</strong> Web server as a daemon process.<br />

This st<strong>and</strong>-alone implementation of <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong> is known as <strong>the</strong> Network Service<br />

Damon (NSD). The Web server communicates with <strong>the</strong> NSD through small dedicated modules<br />

that work to <strong>the</strong> hosting Web server’s proprietary API or through <strong>the</strong> st<strong>and</strong>ard Common<br />

<strong>Gateway</strong> Interface (CGI). The Apache Web server does publish a proprietary API in addition<br />

to supporting extensions implemented as CGI modules.<br />

You can add extra functionality to Apache by means of user-defined modules (compiled C<br />

programs). In fact, a large part of Apache's core functionality is implemented as a set of<br />

modules. You can add modules to Apache by one of two methods. First, <strong>the</strong> source to <strong>the</strong><br />

module can be compiled directly into <strong>the</strong> Apache core. This option arguably offers <strong>the</strong> best<br />

performance but, unfortunately, involves reconfiguring <strong>and</strong> rebuilding <strong>the</strong> Web server. The<br />

source code to a ‘<strong>CSP</strong> module’ is provided for this purpose. As an alternative to building <strong>the</strong><br />

module source directly into <strong>the</strong> Apache core, later versions of Apache (1.3 onwards) support<br />

extensions implemented as dynamically linked libraries. This facility allows you to take<br />

advantage of <strong>the</strong> high performance of Apache modules without <strong>the</strong> need to physically build<br />

<strong>the</strong> module into <strong>the</strong> core of Apache. The <strong>CSP</strong> module can be built as a Windows ‘Dynamic<br />

Link Library’ (DLL) <strong>and</strong> as a UNIX ‘Dynamic Shared Object’ (DSO). UNIX Shared Objects<br />

are conceptually similar to a Windows Dynamic Link Library (DLL) <strong>and</strong> are linked at run<br />

time. The overhead involved in linking to a library at run time is very low on modern operating<br />

systems <strong>and</strong> it is recommended that this option be chosen over <strong>the</strong> built-in approach. Prebuilt<br />

versions of <strong>the</strong> <strong>CSP</strong> module are available for most supported Operating Systems.<br />

In addition to <strong>the</strong> connectivity options described above, <strong>the</strong>re is also a high-performance CGIbased<br />

solution. This is for Apache installations for which a pre-built module is not available<br />

<strong>and</strong> users do not wish to ei<strong>the</strong>r build <strong>the</strong> module <strong>the</strong>mselves from source or build it directly<br />

into <strong>the</strong> Apache core.<br />

Both <strong>the</strong> <strong>CSP</strong> module <strong>and</strong> <strong>the</strong> CGI executables are small functional blocks designed to communicate<br />

exclusively with <strong>the</strong> NSD. In this context, <strong>the</strong> NSD is responsible for providing <strong>the</strong><br />

<strong>CSP</strong> <strong>Gateway</strong>’s core functionality <strong>and</strong> persistent connections to Caché. The <strong>CSP</strong> module<br />

offers better performance than <strong>the</strong> CGI-based equivalent. The <strong>CSP</strong> module is attached directly<br />

2 <strong>Installing</strong> <strong>and</strong> <strong>Configuring</strong> <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong>


Introduction<br />

to <strong>the</strong> hosting Apache processes whereas <strong>the</strong> CGI module must be started in its own process.<br />

For small systems, <strong>the</strong> performance difference between <strong>the</strong> <strong>CSP</strong> module <strong>and</strong> CGI executable<br />

may not be that noticeable. However, <strong>the</strong> difference becomes more marked as <strong>the</strong> load on<br />

<strong>the</strong> system increases <strong>and</strong> <strong>the</strong> overhead of starting <strong>and</strong> managing <strong>the</strong> extra number of processes<br />

that are required by <strong>the</strong> CGI-based connectivity model becomes apparent.<br />

<strong>Installing</strong> <strong>and</strong> <strong>Configuring</strong> <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong> 3


2<br />

Web Servers for Microsoft<br />

Windows<br />

This section describes Web Servers from Microsoft, Sun <strong>and</strong> Apache. The original Netscape<br />

Web servers (Enterprise <strong>and</strong> FastTrack), which were, until fairly recently, marketed under<br />

<strong>the</strong> name of ‘iPlanet’, are now developed <strong>and</strong> marketed by Sun as <strong>the</strong> ‘Sun ONE’ suite of<br />

servers. At <strong>the</strong> time of writing, Sun had renamed <strong>the</strong>se servers again <strong>and</strong> <strong>the</strong> Sun ONE Web<br />

server is now known as <strong>the</strong> “Sun Java System Web Server.”<br />

All Microsoft Web servers can be extended by means of a high-performance API. The<br />

Internet Server Application Programming Interface (ISAPI) allows us to extend <strong>the</strong> Web<br />

server through ‘ISAPI extensions’ implemented as Windows DLLs.<br />

Netscape/iPlanet/Sun Web servers can also be extended by means of a high-performance<br />

API. The Netscape Application Programming Interface (NSAPI) allows us to extend <strong>the</strong> Web<br />

server through modules implemented as Windows DLLs.<br />

Several connectivity options are available for Apache. The CGI-based solution is arguably<br />

<strong>the</strong> easiest option to install <strong>and</strong> configure. The Apache Group also provides support for<br />

extensions implemented as dynamically linked modules (DLLs) <strong>and</strong> a means through which<br />

ISAPI extensions, developed for Microsoft’s Web servers, can be utilized.<br />

<strong>Installing</strong> <strong>and</strong> <strong>Configuring</strong> <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong> 5


Web Servers for Microsoft Windows<br />

2.1 Microsoft Peer Web Server (PWS) <strong>and</strong><br />

Internet Information Services (IIS)<br />

PWS is essentially a lightweight version of IIS. As a general rule, PWS is supplied with<br />

Microsoft’s client-oriented Operating Systems (such as Windows 95/98/NT WorkStation/Me)<br />

<strong>and</strong> IIS is supplied with <strong>the</strong> server-oriented Operating Systems (such as Windows NT<br />

Server/2000/2003). Windows XP, though predominantly a client-oriented Operating System,<br />

includes <strong>the</strong> IIS server.<br />

This guide is based on <strong>the</strong> various <strong>CSP</strong>/<strong>Gateway</strong> Web server components being installed in<br />

<strong>the</strong> following file system:<br />

C:\cachesys\csp\<br />

If <strong>the</strong> layout is different on your system, be sure to amend <strong>the</strong> various configuration directives<br />

described in <strong>the</strong> following sections, as appropriate.<br />

2.1.1 Installation<br />

The <strong>CSP</strong> <strong>Gateway</strong> components <strong>and</strong> <strong>the</strong> <strong>CSP</strong> static files should be installed as follows:<br />

1. NSD Module (if required)<br />

• <strong>CSP</strong>nsd.exe<br />

• <strong>CSP</strong>nsdSv.exe<br />

The default location for <strong>the</strong>se modules is C:\cachesys\csp.<br />

The NSD should be run from within its home directory (above). The configuration file<br />

(<strong>CSP</strong>.INI) <strong>and</strong> Event Log (<strong>CSP</strong>.LOG) are written in this directory for NSD-based connectivity<br />

options.<br />

2. ISAPI <strong>and</strong> CGI Modules<br />

• <strong>CSP</strong>ms.dll (Run-time module)<br />

• <strong>CSP</strong>msSys.dll (Systems-management module)<br />

• <strong>CSP</strong>cms.dll (ISAPI client to <strong>the</strong> NSD – if supplied)<br />

• <strong>CSP</strong>cgi.exe (Run-time module)<br />

• nph-<strong>CSP</strong>cgi.exe (A copy of <strong>CSP</strong>cgi)<br />

6 <strong>Installing</strong> <strong>and</strong> <strong>Configuring</strong> <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong>


• <strong>CSP</strong>cgiSys.exe (Systems-Management module)<br />

• nph-<strong>CSP</strong>cgiSys.exe (A copy of <strong>CSP</strong>cgiSys)<br />

Note that not all of <strong>the</strong> modules listed above are required for all connectivity options.<br />

Refer to <strong>the</strong> sections describing each option to see which are actually required.<br />

The default location for <strong>the</strong>se modules is C:\cachesys\csp\bin.<br />

The configuration file (<strong>CSP</strong>.INI) <strong>and</strong> Event Log (<strong>CSP</strong>.LOG) are written in this directory<br />

for non NSD-based connectivity options.<br />

3. HyperEvents Components<br />

• <strong>CSP</strong>Broker.js<br />

• <strong>CSP</strong>BBroker.class<br />

• <strong>CSP</strong>Broker.jar<br />

• <strong>CSP</strong>xmlhttp.js<br />

Microsoft Peer Web Server (PWS) <strong>and</strong> Internet Information Services (IIS)<br />

The default location for <strong>the</strong>se files is C:\cachesys\csp\broker.<br />

4. Miscellaneous static resources used by <strong>the</strong> <strong>CSP</strong> Samples<br />

A number of static Web resources (such as image files) are required by <strong>the</strong> <strong>CSP</strong> Samples.<br />

The default location for <strong>the</strong>se files is C:\cachesys\csp\samples.<br />

2.1.2 Option 1: Using <strong>the</strong> ISAPI Modules (<strong>CSP</strong>ms*.dll)<br />

The Web server should be configured such that it recognizes <strong>CSP</strong> requests (files of type .csp<br />

<strong>and</strong> .cls) <strong>and</strong> passes <strong>the</strong>m to <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong> for processing.<br />

2.1.2.1 Peer Web Server<br />

1. Add <strong>the</strong> following two key values to <strong>the</strong> Windows registry, in <strong>the</strong> HKEY_LOCAL_MACHINE<br />

(HKLM) set of keys. These keys instruct PWS to pass requests for <strong>CSP</strong> files to <strong>the</strong> <strong>CSP</strong><br />

<strong>Gateway</strong> for processing.<br />

REGEDIT4<br />

[HKLM\SYSTEM\CurrentControlSet\Services\W3SVC\Parameters\Script Map]<br />

".csp"="C:\\cachesys\\csp\\bin\\<strong>CSP</strong>ms.dll"<br />

REGEDIT4<br />

[HKLM\SYSTEM\CurrentControlSet\Services\W3SVC\Parameters\Script Map]<br />

".cls"="C:\\cachesys\\csp\\bin\\<strong>CSP</strong>ms.dll"<br />

<strong>Installing</strong> <strong>and</strong> <strong>Configuring</strong> <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong> 7


Web Servers for Microsoft Windows<br />

2. Open <strong>the</strong> Internet Service Manager window.<br />

3. Double-click on <strong>the</strong> WWW Service to bring up <strong>the</strong> WWW Service Properties window.<br />

4. Click on <strong>the</strong> Directories tab.<br />

5. Click <strong>the</strong> Add button <strong>and</strong> enter <strong>the</strong> following Virtual Directory.<br />

• Directory: c:\cachesys\csp<br />

• Virtual Directory: Check<br />

• Alias: /csp<br />

• Access: Check Read <strong>and</strong> Execute<br />

6. Save <strong>and</strong> Apply all changes <strong>and</strong> restart <strong>the</strong> computer.<br />

2.1.2.2 Internet Information Services<br />

1. Open <strong>the</strong> Internet Services Manager window.<br />

2. In <strong>the</strong> left-h<strong>and</strong> window, navigate to <strong>the</strong> Default Web Site.<br />

3. Right-click on <strong>the</strong> Default Web Site. Select Properties from <strong>the</strong> menu to bring up <strong>the</strong><br />

Default Web Site Properties window.<br />

4. Click on <strong>the</strong> Home Directory tab.<br />

5. Click <strong>the</strong> Configuration button to bring up <strong>the</strong> Application Configuration window.<br />

6. Click on <strong>the</strong> App Mappings tab.<br />

7. Click <strong>the</strong> Add button to bring up <strong>the</strong> Add/Edit Application Extension window <strong>and</strong> add <strong>the</strong><br />

following record:<br />

• Executable: c:\cachesys\csp\bin\<strong>CSP</strong>ms.dll<br />

• Extension: csp<br />

• All Verbs: Check<br />

• Script engine: Check<br />

• Check that file exists: UnCheck<br />

8. Repeat <strong>the</strong> above process to add <strong>the</strong> following record:<br />

• Executable: c:\cachesys\csp\bin\<strong>CSP</strong>ms.dll<br />

• Extension: cls<br />

8 <strong>Installing</strong> <strong>and</strong> <strong>Configuring</strong> <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong>


• All Verbs: Check<br />

• Script engine: Check<br />

• Check that file exists: UnCheck<br />

9. Return to <strong>the</strong> Internet Information Services window <strong>and</strong> navigate to <strong>the</strong> Default Web Site.<br />

10. Right-click on <strong>the</strong> Default Web Site <strong>and</strong> select New -> Virtual Directory from <strong>the</strong> menus<br />

to bring up <strong>the</strong> Virtual Directory Creation window. Add <strong>the</strong> following record:<br />

• Alias: csp<br />

• Directory: c:\cachesys\csp<br />

• Execute Permissions: Check<br />

11. Save <strong>and</strong> Apply all changes <strong>and</strong> restart <strong>the</strong> computer.<br />

Refer to <strong>the</strong> following section for fur<strong>the</strong>r information relating to version 6 of IIS (shipped<br />

with Windows 2003).<br />

2.1.2.3 Internet Information Services Version 6<br />

This version of IIS is <strong>the</strong> Web server shipped with Windows Server 2003 (Formerly known<br />

as Windows .net Server 2003). In configuring <strong>CSP</strong> to work with this server, <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong><br />

ISAPI DLLs (<strong>CSP</strong>ms.dll <strong>and</strong> <strong>CSP</strong>msSys.dll) must be registered as ‘allowed’ Web service<br />

extensions.<br />

1. Open <strong>the</strong> Internet Services Manager window.<br />

Microsoft Peer Web Server (PWS) <strong>and</strong> Internet Information Services (IIS)<br />

2. In <strong>the</strong> left-h<strong>and</strong> window, navigate to <strong>the</strong> Web Service Extensions. This displays a list of<br />

currently configured extensions (or applications) in <strong>the</strong> right-h<strong>and</strong> panel.<br />

3. Right-click on <strong>the</strong> Web Services Extensions. Select Add a new Web service extension<br />

from <strong>the</strong> menu to bring up <strong>the</strong> New Web Service Extension window.<br />

4. Type in <strong>CSP</strong> <strong>Gateway</strong> for <strong>the</strong> Extension name field.<br />

5. Click <strong>the</strong> Add button to bring up <strong>the</strong> Add File dialog. Add <strong>CSP</strong>ms.dll (including <strong>the</strong> full<br />

physical path to this DLL. Repeat <strong>the</strong> process for <strong>CSP</strong>msSys.dll.<br />

6. Select <strong>the</strong> Set extension status to Allowed check box.<br />

7. Finally click <strong>the</strong> OK button to file <strong>the</strong> Web Service Extension.<br />

<strong>Installing</strong> <strong>and</strong> <strong>Configuring</strong> <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong> 9


Web Servers for Microsoft Windows<br />

Note that <strong>the</strong>re is an option to allow users access to all ISAPI extensions: Allow All unknown<br />

ISAPI extensions. Enabling this option automatically enable access to <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong>’s<br />

ISAPI modules. However, in <strong>the</strong> interests of security it recommended that <strong>the</strong> procedures<br />

outlined above are followed <strong>and</strong> that additional access is only granted to <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong><br />

modules.<br />

It is a common mistake to register <strong>the</strong> <strong>Gateway</strong>’s modules, which are ISAPI extensions, as<br />

ISAPI filters. This error should be avoided as it totally prohibit <strong>the</strong> use of <strong>CSP</strong>.<br />

The following additional operations can be later performed on registered Web Service<br />

Extensions.<br />

To Prohibit Access to <strong>CSP</strong><br />

Use this procedure to temporarily disable access to <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong> <strong>and</strong>, by implication,<br />

all <strong>CSP</strong>-based resources.<br />

1. Open <strong>the</strong> Internet Services Manager window.<br />

2. In <strong>the</strong> left-h<strong>and</strong> window, navigate to <strong>the</strong> Web Service Extensions. You will see a list of<br />

currently configured extensions (or applications) in <strong>the</strong> right-h<strong>and</strong> panel.<br />

3. In <strong>the</strong> right-h<strong>and</strong> window right-click on <strong>CSP</strong> <strong>Gateway</strong> <strong>and</strong> select Prohibit. Access to <strong>the</strong><br />

<strong>CSP</strong> <strong>Gateway</strong> is now prohibited.<br />

Reactivating <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong> is <strong>the</strong> reverse procedure to that shown above – in <strong>the</strong> last step,<br />

select Allow.<br />

To Prohibit Access to <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong>’s Systems Management Module<br />

Use this procedure to disable access to <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong>’s Systems Management suite. Doing<br />

this will prevent <strong>the</strong> possibility of unauthorized users gaining access <strong>the</strong> Systems Management<br />

Suite for an operational system. It is a quick <strong>and</strong> straightforward procedure for system<br />

administrators to re-enable access for a future period of time in order for configuration changes<br />

to be made to <strong>the</strong> <strong>Gateway</strong>.<br />

1. Open <strong>the</strong> Internet Services Manager window.<br />

2. In <strong>the</strong> left-h<strong>and</strong> window, navigate to <strong>the</strong> Web Service Extensions. You will see a list of<br />

currently configured extensions (or applications) in <strong>the</strong> right-h<strong>and</strong> panel.<br />

3. In <strong>the</strong> right-h<strong>and</strong> window double-click on <strong>CSP</strong> <strong>Gateway</strong> to bring up <strong>the</strong> Web Service<br />

Extension Properties window.<br />

4. Click on <strong>the</strong> Required Files tab.<br />

5. Click on <strong>CSP</strong>msSys.dll to highlight (or select) this file.<br />

10 <strong>Installing</strong> <strong>and</strong> <strong>Configuring</strong> <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong>


6. Click on <strong>the</strong> Prohibit button to <strong>the</strong> right followed by <strong>the</strong> Apply button <strong>and</strong> finally <strong>the</strong> OK<br />

button located at <strong>the</strong> bottom of <strong>the</strong> dialog.<br />

Reactivating <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong> Systems Management module is <strong>the</strong> reverse procedure to that<br />

shown above – at this last stage click on <strong>the</strong> Allow button.<br />

Of course, <strong>the</strong> above procedure can also be used to prevent end-users from gaining access to<br />

<strong>CSP</strong> resources while significant changes are being made to <strong>the</strong> <strong>Gateway</strong>’s configuration. In<br />

this case, <strong>the</strong> <strong>Gateway</strong>’s run-time module (<strong>CSP</strong>ms.dll) should be marked as Prohibited instead<br />

of <strong>the</strong> Systems Management module (<strong>CSP</strong>msSys.dll).<br />

2.1.2.4 Security Settings<br />

For many Windows installations (particularly Windows 2000 <strong>and</strong> later), <strong>the</strong> default privileges<br />

assigned to <strong>the</strong> Web server (PWS or IIS) are not sufficient to allow <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong> to read<br />

from <strong>and</strong>/or write to its configuration <strong>and</strong> log files (<strong>CSP</strong>.ini <strong>and</strong> <strong>CSP</strong>.log respectively).<br />

You must, <strong>the</strong>refore, assign <strong>the</strong> Web server read/write privileges to <strong>the</strong> <strong>Gateway</strong>’s files, or<br />

grant <strong>the</strong> Web server 'Administrator' privileges.<br />

File-access privileges can be modified through Windows Explorer. Alternatively, you can<br />

use <strong>the</strong> following two comm<strong>and</strong>s:<br />

cacls c:\cachesys\csp\bin\<strong>CSP</strong>.ini /E /G IUSR_xxx:F<br />

cacls c:\cachesys\csp\bin\<strong>CSP</strong>.log /E /G IUSR_xxx:F<br />

Where 'IUSR_xxx' is <strong>the</strong> Web server’s user authority. The 'xxx' component is usually <strong>the</strong><br />

computer name. You can find <strong>the</strong> specific name in <strong>the</strong> Internet Service Manager by navigating<br />

to <strong>the</strong> Au<strong>the</strong>ntication methods dialog as follows:<br />

1. Open <strong>the</strong> Internet Services Manager window.<br />

2. In <strong>the</strong> left-h<strong>and</strong> window, navigate to <strong>the</strong> Default Web Site.<br />

3. Right-click on <strong>the</strong> Default Web Site<br />

. Select Properties from <strong>the</strong> menu to bring up <strong>the</strong> Default Web Site Properties window.<br />

4. Click on <strong>the</strong> Directory Security tab.<br />

Microsoft Peer Web Server (PWS) <strong>and</strong> Internet Information Services (IIS)<br />

5. Click on <strong>the</strong> Edit button under <strong>the</strong> Anonymous access <strong>and</strong> au<strong>the</strong>ntication control panel.<br />

This displays <strong>the</strong> User Name in <strong>the</strong> Au<strong>the</strong>ntication methods dialog.<br />

Before invoking <strong>the</strong> ‘cacls’ comm<strong>and</strong>, it is necessary to create <strong>the</strong> files that you are applying<br />

it to, if <strong>the</strong>y don’t already exist. Use <strong>the</strong> ‘copy con’ comm<strong>and</strong> (in a Windows Comm<strong>and</strong><br />

Prompt window or ‘DOS box’) to create empty files:<br />

<strong>Installing</strong> <strong>and</strong> <strong>Configuring</strong> <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong> 11


Web Servers for Microsoft Windows<br />

Copy con c:\cachesys\csp\bin\<strong>CSP</strong>.ini<br />

^Z<br />

Copy con c:\cachesys\csp\bin\<strong>CSP</strong>.log<br />

^Z<br />

Each individual comm<strong>and</strong> line is terminated with ‘carriage return’. ‘^Z’ refers to ‘Control-<br />

Z’.<br />

Example:<br />

Use <strong>the</strong> following comm<strong>and</strong>s to adjust <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong>’s configuration <strong>and</strong> log file access<br />

rights for a computer named BOSTON:<br />

cacls c:\cachesys\csp\bin\<strong>CSP</strong>.ini /E /G IUSR_BOSTON:F<br />

cacls c:\cachesys\csp\bin\<strong>CSP</strong>.log /E /G IUSR_BOSTON:F<br />

2.1.2.5 Operating <strong>and</strong> Managing <strong>the</strong> <strong>Gateway</strong><br />

To access <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong>’s systems management suite, point your browser at<br />

http:///csp/bin/<strong>CSP</strong>msSys.dll.<br />

If you see an unauthorized user error message, refer to <strong>the</strong> security notes.<br />

The <strong>CSP</strong> engine is automatically invoked for requested files containing <strong>the</strong> .csp <strong>and</strong> .cls<br />

extension. For example:<br />

http:///csp/samples/menu.csp<br />

2.1.3 Option 2: Using an ISAPI Module with <strong>the</strong> NSD (<strong>CSP</strong>cms.dll)<br />

In most cases, <strong>the</strong> all-inclusive ISAPI-based solution (Option 1) is <strong>the</strong> option of choice, <strong>and</strong><br />

is <strong>the</strong> implementation that gives <strong>the</strong> best performance. The ISAPI/NSD hybrid is useful for<br />

cases where it is necessary, for operational reasons, to manage <strong>the</strong> <strong>Gateway</strong> independently<br />

of <strong>the</strong> hosting Web server. For example, if multiple instances of <strong>the</strong> Web server are to share<br />

<strong>the</strong> same <strong>Gateway</strong> installation. In option 1 each instance of <strong>the</strong> core Web server process binds<br />

to its own instance of <strong>the</strong> <strong>Gateway</strong>.<br />

This option provides better performance than <strong>the</strong> CGI/NSD hybrid described in Option 3.<br />

The higher latency that results from <strong>the</strong> need to start new processes to serve each <strong>and</strong> every<br />

request is avoided in this implementation.<br />

2.1.3.1 Peer Web Server<br />

Follow <strong>the</strong> instructions for Option 1 with <strong>the</strong> exception that <strong>the</strong> registry settings should<br />

associate <strong>CSP</strong> files with <strong>CSP</strong>cms.dll instead of <strong>CSP</strong>ms.dll.<br />

12 <strong>Installing</strong> <strong>and</strong> <strong>Configuring</strong> <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong>


Microsoft Peer Web Server (PWS) <strong>and</strong> Internet Information Services (IIS)<br />

REGEDIT4<br />

[HKLM\SYSTEM\CurrentControlSet\Services\W3SVC\Parameters\Script Map]<br />

".csp"="C:\\cachesys\\csp\\bin\\<strong>CSP</strong>cms.dll"<br />

REGEDIT4<br />

[HKLM\SYSTEM\CurrentControlSet\Services\W3SVC\Parameters\Script Map]<br />

".cls"="C:\\cachesys\\csp\\bin\\<strong>CSP</strong>cms.dll"<br />

2.1.3.2 Internet Information Services<br />

Follow <strong>the</strong> instructions for Option 1 with <strong>the</strong> exception that <strong>CSP</strong> files should be associated<br />

with <strong>CSP</strong>cms.dll instead of <strong>CSP</strong>ms.dll (steps 7 <strong>and</strong> 8).<br />

• Executable: c:\cachesys\csp\bin\<strong>CSP</strong>cms.dll<br />

• Extension: csp<br />

• All Verbs: Check<br />

• Script engine: Check<br />

• Check that file exists: UnCheck<br />

• Executable: c:\cachesys\csp\bin\<strong>CSP</strong>cms.dll<br />

• Extension: cls<br />

• All Verbs: Check<br />

• Script engine: Check<br />

• Check that file exists: UnCheck<br />

Refer to <strong>the</strong> following section for fur<strong>the</strong>r information relating to version 6 of IIS (shipped<br />

with Windows 2003).<br />

2.1.3.3 Internet Information Services Version 6<br />

Follow <strong>the</strong> instructions for Option 1 with <strong>the</strong> exception that <strong>the</strong> following executables should<br />

be registered as allowed for <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong> instead of <strong>CSP</strong>ms.dll <strong>and</strong> <strong>CSP</strong>msSys.dll.<br />

• <strong>CSP</strong>cms.dll<br />

• nph-<strong>CSP</strong>cgi.exe<br />

• nph-<strong>CSP</strong>cgiSys.exe<br />

<strong>Installing</strong> <strong>and</strong> <strong>Configuring</strong> <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong> 13


Web Servers for Microsoft Windows<br />

To Prohibit Access to <strong>CSP</strong><br />

Mark <strong>the</strong> following executables as prohibited:<br />

• <strong>CSP</strong>cms.dll<br />

• nph-<strong>CSP</strong>cgi.exe<br />

• nph-<strong>CSP</strong>cgiSys.exe<br />

To Prohibit Access to <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong>’s Systems Management Module<br />

Mark <strong>the</strong> following executables as prohibited:<br />

• nph-<strong>CSP</strong>cgi.exe<br />

• nph-<strong>CSP</strong>cgiSys.exe<br />

To Prohibit Access to <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong>’s Run-Time Module<br />

Mark <strong>the</strong> following executable as prohibited: <strong>CSP</strong>cms.dll<br />

2.1.3.4 Operating <strong>and</strong> Managing <strong>the</strong> <strong>Gateway</strong><br />

This connectivity option depends on <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong>’s Network Service Daemon (NSD).<br />

• Start <strong>the</strong> <strong>CSP</strong> NSD as described in <strong>the</strong> section dedicated to this service.<br />

• Apache must be (re)started after making changes to its configuration (httpd.conf).<br />

The order in which Apache <strong>and</strong> <strong>the</strong> NSD are started is unimportant.<br />

Although <strong>CSP</strong> pages are served through <strong>the</strong> higher-performing module (mod_csp.so), <strong>the</strong><br />

<strong>Gateway</strong>’s management suite is accessed through <strong>the</strong> CGI module dedicated to this purpose<br />

(nph-<strong>CSP</strong>cgiSys).<br />

To access <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong>’s Systems Management suite, point your browser at:<br />

http:///csp-bin/nph-<strong>CSP</strong>cgiSys<br />

If you see an unauthorized user error message, refer to <strong>the</strong> security notes.<br />

The <strong>CSP</strong> engine is automatically invoked for requested files containing <strong>the</strong> .csp <strong>and</strong> .cls<br />

extension. For example:<br />

http:///csp/samples/menu.csp<br />

14 <strong>Installing</strong> <strong>and</strong> <strong>Configuring</strong> <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong>


2.1.4 Option 3: Using <strong>the</strong> CGI Modules with <strong>the</strong> NSD<br />

(nph-<strong>CSP</strong>cgi*.exe)<br />

In most cases, <strong>the</strong> all-inclusive ISAPI-based solution (Option 1) is <strong>the</strong> option of choice, <strong>and</strong><br />

is <strong>the</strong> implementation that gives <strong>the</strong> best performance. The CGI/NSD hybrid is useful for<br />

cases where it is necessary, for operational reasons, to manage <strong>the</strong> <strong>Gateway</strong> independently<br />

of <strong>the</strong> hosting Web server. For example, if multiple instances of <strong>the</strong> Web server are to share<br />

<strong>the</strong> same <strong>Gateway</strong> installation. In option 1 each instance of <strong>the</strong> core Web server process binds<br />

to its own instance of <strong>the</strong> <strong>Gateway</strong>.<br />

Ano<strong>the</strong>r factor in choosing this approach might be that <strong>the</strong> in-house requirements of your<br />

Web master (or ISP) dictate that all Web server extensions are implemented using <strong>the</strong> CGI<br />

protocol.<br />

2.1.4.1 Peer Web Server<br />

Follow <strong>the</strong> instructions for Option 1 with <strong>the</strong> exception that <strong>the</strong> registry settings should<br />

associate <strong>CSP</strong> files with nph-<strong>CSP</strong>cgi.exe instead of <strong>CSP</strong>ms.dll.<br />

REGEDIT4<br />

Microsoft Peer Web Server (PWS) <strong>and</strong> Internet Information Services (IIS)<br />

[HKLM\SYSTEM\CurrentControlSet\Services\W3SVC\Parameters\Script Map]<br />

".csp"="C:\\cachesys\\csp\\bin\\nph-<strong>CSP</strong>cgi.exe"<br />

REGEDIT4<br />

[HKLM\SYSTEM\CurrentControlSet\Services\W3SVC\Parameters\Script Map]<br />

".cls"="C:\\cachesys\\csp\\bin\\nph-<strong>CSP</strong>cgi.exe"<br />

2.1.4.2 Internet Information Services<br />

Follow <strong>the</strong> instructions for Option 1 with <strong>the</strong> exception that <strong>CSP</strong> files should be associated<br />

with nph-<strong>CSP</strong>cgi.exe instead of <strong>CSP</strong>ms.dll (steps 7 <strong>and</strong> 8).<br />

• Executable: c:\cachesys\csp\bin\nph-<strong>CSP</strong>cgi.exe<br />

• Extension: csp<br />

• All Verbs: Check<br />

• Script engine: Check<br />

• Check that file exists: UnCheck<br />

• Executable: c:\cachesys\csp\bin\nph-<strong>CSP</strong>cgi.exe<br />

<strong>Installing</strong> <strong>and</strong> <strong>Configuring</strong> <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong> 15


Web Servers for Microsoft Windows<br />

• Extension: cls<br />

• All Verbs: Check<br />

• Script engine: Check<br />

• Check that file exists: UnCheck<br />

Refer to <strong>the</strong> following section for fur<strong>the</strong>r information relating to version 6 of IIS (shipped<br />

with Windows 2003).<br />

2.1.4.3 Internet Information Services Version 6<br />

Follow <strong>the</strong> instructions for Option 1 with <strong>the</strong> exception that <strong>the</strong> following executables should<br />

be registered as allowed for <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong> instead of <strong>CSP</strong>ms.dll <strong>and</strong> <strong>CSP</strong>msSys.dll:<br />

• nph-<strong>CSP</strong>cgi.exe<br />

• nph-<strong>CSP</strong>cgiSys.exe<br />

To Prohibit Access to <strong>CSP</strong><br />

Mark <strong>the</strong> following executables as prohibited:<br />

• nph-<strong>CSP</strong>cgi.exe<br />

• nph-<strong>CSP</strong>cgiSys.exe<br />

To Prohibit Access to <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong>’s Systems Management Module<br />

Mark <strong>the</strong> following executable as prohibited: nph-<strong>CSP</strong>cgiSys.exe.<br />

To Prohibit Access to <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong>’s Runtime Module<br />

Mark <strong>the</strong> following executable as prohibited: nph-<strong>CSP</strong>cgi.exe.<br />

2.1.4.4 Operating <strong>and</strong> Managing <strong>the</strong> <strong>Gateway</strong><br />

This connectivity option depends on <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong>’s Network Service Daemon (NSD).<br />

• Start <strong>the</strong> <strong>CSP</strong> NSD as described in <strong>the</strong> section dedicated to this service.<br />

• Apache must be (re)started after making changes to its configuration (httpd.conf).<br />

The order in which Apache <strong>and</strong> <strong>the</strong> NSD are started is unimportant.<br />

Although <strong>CSP</strong> pages are served through <strong>the</strong> higher-performing module (mod_csp.so), <strong>the</strong><br />

<strong>Gateway</strong>’s management suite is accessed through <strong>the</strong> CGI module dedicated to this purpose<br />

(nph-<strong>CSP</strong>cgiSys).<br />

16 <strong>Installing</strong> <strong>and</strong> <strong>Configuring</strong> <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong>


To access <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong>’s Systems Management suite, point your browser at:<br />

http:///csp-bin/nph-<strong>CSP</strong>cgiSys<br />

If you see an unauthorized user error message, refer to <strong>the</strong> security notes.<br />

The <strong>CSP</strong> engine is automatically invoked for requested files containing <strong>the</strong> .csp <strong>and</strong> .cls<br />

extension. For example:<br />

http:///csp/samples/menu.csp<br />

Netscape, iPlanet, <strong>and</strong> Sun Web Servers<br />

2.2 Netscape, iPlanet, <strong>and</strong> Sun Web Servers<br />

This section covers <strong>the</strong> configuration <strong>and</strong> operational procedures for running <strong>CSP</strong> through<br />

<strong>the</strong> original Netscape Web servers (Enterprise <strong>and</strong> FastTrack). The modern versions of <strong>the</strong>se<br />

servers were, until fairly recently, marketed under <strong>the</strong> name of iPlanet, but are now developed<br />

<strong>and</strong> marketed by Sun as <strong>the</strong> Sun ONE suite of servers. At <strong>the</strong> time of writing, Sun had fur<strong>the</strong>r<br />

renamed <strong>the</strong>se servers <strong>and</strong> <strong>the</strong> Sun ONE Web server is now known as <strong>the</strong> Sun Java System<br />

Web Server.<br />

Traditionally, <strong>the</strong>se Netscape-based servers are produced in two forms: FastTrack <strong>and</strong><br />

Enterprise. The FastTrack server is a lightweight version of <strong>the</strong> Enterprise-grade server with<br />

limited functionality <strong>and</strong> is usually supplied free of charge. The installation <strong>and</strong> configuration<br />

procedure (with respect to <strong>CSP</strong>) is <strong>the</strong> same for both grades of server.<br />

This guide is based on <strong>the</strong> various <strong>CSP</strong>/<strong>Gateway</strong> Web server components being installed in<br />

<strong>the</strong> following file system:<br />

C:\cachesys\csp\<br />

It is assumed that <strong>the</strong> Web server is installed under:<br />

C:\Netscape\SuiteSpot\<br />

For <strong>the</strong> sake of brevity, <strong>the</strong> ‘Netscape’ product name is used throughout in <strong>the</strong> following<br />

discussion. However, be aware of <strong>the</strong> various name changes that have occurred in this product<br />

line. For example, <strong>the</strong> iPlanet server, though essentially <strong>the</strong> same product as Netscape<br />

Enterprise, is installed under:<br />

C:\iPlanet\SuiteSpot\<br />

The later versions supplied by Sun are installed under:<br />

C:\Sun\WebServer\<br />

<strong>Installing</strong> <strong>and</strong> <strong>Configuring</strong> <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong> 17


Web Servers for Microsoft Windows<br />

Individual instances of <strong>the</strong> Netscape server are installed under directories of <strong>the</strong> form:<br />

C:\Netscape\SuiteSpot\https-\<br />

or<br />

C:\Netscape\SuiteSpot\httpd-\<br />

Where server_name is <strong>the</strong> logical name assigned to <strong>the</strong> hosting computer.<br />

If <strong>the</strong> layout is different on your system, be sure to amend <strong>the</strong> various configuration directives<br />

described in <strong>the</strong> following sections, as appropriate.<br />

The documentation root directory for <strong>the</strong>se servers is usually:<br />

C:\Netscape\SuiteSpot\docs\<br />

2.2.1 Installation<br />

The <strong>CSP</strong> <strong>Gateway</strong> components <strong>and</strong> <strong>the</strong> <strong>CSP</strong> static files should be installed as follows:<br />

1. NSD Module (if required)<br />

• <strong>CSP</strong>nsd.exe<br />

• <strong>CSP</strong>nsdSv.exe<br />

The default location for <strong>the</strong>se modules is:<br />

C:\cachesys\csp<br />

The NSD should be run from within its home directory (above). The configuration file<br />

(<strong>CSP</strong>.INI) <strong>and</strong> Event Log (<strong>CSP</strong>.LOG) are written in this directory for NSD-based connectivity<br />

options.<br />

2. NSAPI <strong>and</strong> CGI Modules<br />

• <strong>CSP</strong>n3.dll (Run-time module)<br />

• <strong>CSP</strong>n3Sys.dll (Systems-management module)<br />

• <strong>CSP</strong>cn3.dll (NSAPI client to <strong>the</strong> NSD – if supplied)<br />

• <strong>CSP</strong>cgi.exe (Run-time module)<br />

• nph-<strong>CSP</strong>cgi.exe (A copy of <strong>CSP</strong>cgi)<br />

• <strong>CSP</strong>cgiSys.exe (Systems-Management module)<br />

• nph-<strong>CSP</strong>cgiSys.exe (A copy of <strong>CSP</strong>cgiSys)<br />

18 <strong>Installing</strong> <strong>and</strong> <strong>Configuring</strong> <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong>


Note that not all of <strong>the</strong> modules listed above are required for all connectivity options.<br />

Refer to <strong>the</strong> sections describing each option to see which are actually required.<br />

The default location for <strong>the</strong>se modules is:<br />

C:\cachesys\csp\bin<br />

The configuration file (<strong>CSP</strong>.INI) <strong>and</strong> Event Log (<strong>CSP</strong>.LOG) are written in this directory<br />

for non NSD-based connectivity options.<br />

3. HyperEvents Components<br />

• <strong>CSP</strong>Broker.js<br />

• <strong>CSP</strong>BBroker.class<br />

• <strong>CSP</strong>Broker.jar<br />

• <strong>CSP</strong>xmlhttp.js<br />

The default location for <strong>the</strong>se files is:<br />

C:\cachesys\csp\broker<br />

4. Miscellaneous static resources used by <strong>the</strong> <strong>CSP</strong> Samples<br />

A number of static Web resources (such as image files) are required by <strong>the</strong> <strong>CSP</strong> Samples.<br />

The default location for <strong>the</strong>se files is:<br />

C:\cachesys\csp\samples<br />

Netscape, iPlanet, <strong>and</strong> Sun Web Servers<br />

2.2.2 Option 1: Using <strong>the</strong> NSAPI Modules (<strong>CSP</strong>n3*.dll)<br />

The Web server should be configured such that it recognizes <strong>CSP</strong> requests (files of type .csp<br />

<strong>and</strong> .cls) <strong>and</strong> passes <strong>the</strong>m to <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong> for processing.<br />

The Web server configuration files (magnus.conf <strong>and</strong> obj.conf) are in <strong>the</strong> following directory:<br />

C:\Netscape\SuiteSpot\https-\config\<br />

Directives to load <strong>the</strong> NSAPI modules <strong>and</strong> instructions for recognizing <strong>and</strong> processing <strong>CSP</strong><br />

files must be added to <strong>the</strong> Web server configuration.<br />

<strong>Installing</strong> <strong>and</strong> <strong>Configuring</strong> <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong> 19


Web Servers for Microsoft Windows<br />

2.2.2.1 The Directives<br />

Directives for Loading <strong>the</strong> NSAPI Modules<br />

The ‘Init’ directive instructs <strong>the</strong> Web server to load NSAPI modules. Depending on which<br />

version of <strong>the</strong> Web server you have, <strong>the</strong>se directives should be added to ei<strong>the</strong>r <strong>the</strong> core<br />

magnus.conf file or <strong>the</strong> objects obj.conf configuration file. The Netscape Web servers <strong>and</strong><br />

early iPlanet servers use <strong>the</strong> obj.conf for holding ‘Init’ directives, whereas later iPlanet <strong>and</strong><br />

Sun servers use <strong>the</strong> magnus.conf file. In order to determine which of <strong>the</strong>se two configuration<br />

files you should use, examine both to see where <strong>the</strong> Web server’s core ‘Init’ directives are<br />

held. These core configuration directives are always present, an example of which is as follows:<br />

Init fn=load-types mime-types=mime.types<br />

Having located <strong>the</strong> block of core ‘Init’ directives, add <strong>the</strong> following section before this block:<br />

Init fn=load-modules shlib=C:/cachesys/csp/bin/<strong>CSP</strong>n3.dll \<br />

funcs=csp_term,csp_init,csp_req<br />

Init fn=csp_init shlib="C:/cachesys/csp/bin/<strong>CSP</strong>n3.dll"<br />

Init fn=load-modules shlib= C:/cachesys/csp/bin/<strong>CSP</strong>n3Sys.dll \<br />

funcs=csp_term_sys,csp_init_sys,csp_req_sys<br />

Init fn=csp_init_sys shlib="C:/cachesys/csp/bin/<strong>CSP</strong>n3Sys.dll"<br />

Note that ‘Init’ directives are made up of a single line. Due to <strong>the</strong> limitations of space, <strong>the</strong><br />

lines shown above are wrapped before <strong>the</strong> function declarations (funcs).<br />

Directives for Locating Static Components<br />

<strong>CSP</strong> includes a number of ‘static’ files that are served by <strong>the</strong> Web server. For example, <strong>the</strong><br />

Java/JavaScript files used to implement hyperevents <strong>and</strong> <strong>the</strong> image used in <strong>the</strong> <strong>CSP</strong> samples.<br />

These files are detailed in sections 3 <strong>and</strong> 4 of <strong>the</strong> installation section respectively.<br />

The Web server needs to know <strong>the</strong> location of <strong>the</strong>se files relative to <strong>the</strong> virtual <strong>CSP</strong> documentation<br />

root directory.<br />

Find <strong>the</strong> ‘default’ directives section of obj.conf:<br />

<br />

Add <strong>the</strong> following two lines in <strong>the</strong> ‘default’ section – that is, after <strong>the</strong> line shown above.<br />

NameTrans fn="pfx2dir" from="/csp/samples" dir="c:/cachesys/csp/samples"<br />

NameTrans fn="pfx2dir" from="/csp/broker" dir="c:/cachesys/csp/broker"<br />

Directives for Recognizing <strong>and</strong> Processing <strong>CSP</strong> Requests<br />

Add <strong>the</strong> following section to <strong>the</strong> end of obj.conf:<br />

20 <strong>Installing</strong> <strong>and</strong> <strong>Configuring</strong> <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong>


Netscape, iPlanet, <strong>and</strong> Sun Web Servers<br />

<br />

Service method=(GET|HEAD|POST) fn=csp_req<br />

<br />

<br />

Service method=(GET|HEAD|POST) fn=csp_req<br />

<br />

<br />

Service method=(GET|HEAD|POST) fn=csp_req_sys<br />

<br />

<br />

Service method=(GET|HEAD|POST) fn=csp_req<br />

<br />

2.2.2.2 Operating <strong>and</strong> Managing <strong>the</strong> <strong>Gateway</strong><br />

The Web server must be restarted after making changes to its configuration files (magnus.conf<br />

<strong>and</strong> obj.conf).<br />

To access <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong>’s systems management suite, point your browser at:<br />

http:///csp/bin/<strong>CSP</strong>n3Sys.dll<br />

If you see an unauthorized user error message, refer to <strong>the</strong> security notes.<br />

The <strong>CSP</strong> engine is automatically invoked for requested files containing <strong>the</strong> .csp <strong>and</strong> .cls<br />

extension. For example:<br />

http:///csp/samples/menu.csp<br />

2.2.3 Option 2: Using an ISAPI Module with <strong>the</strong> NSD (<strong>CSP</strong>cn3.dll)<br />

In most cases, <strong>the</strong> all-inclusive NSAPI-based solution (Option 1) is <strong>the</strong> option of choice, <strong>and</strong><br />

is <strong>the</strong> implementation that gives <strong>the</strong> best performance. The NSAPI/NSD hybrid is useful for<br />

cases where it is necessary, for operational reasons, to manage <strong>the</strong> <strong>Gateway</strong> independently<br />

of <strong>the</strong> hosting Web server. For example, if multiple instances of <strong>the</strong> Web server are to share<br />

<strong>the</strong> same <strong>Gateway</strong> installation. In option 1 each instance of <strong>the</strong> core Web server process binds<br />

to its own instance of <strong>the</strong> <strong>Gateway</strong>.<br />

The configuration procedure is very similar to that described for Option 1. The essential differences<br />

are highlighted below.<br />

Locate <strong>the</strong> block of core ‘Init’ directives for your Web server as described for Option 1. These<br />

are in ei<strong>the</strong>r magnus.conf or obj.conf. Add <strong>the</strong> following section before <strong>the</strong> core ‘Init’ block:<br />

Init fn=load-modules shlib=C:/cachesys/csp/bin/<strong>CSP</strong>cn3.dll \<br />

funcs=cspc_term,cspc_init,cspc_req<br />

Init fn=cspc_init shlib="C:/cachesys/csp/bin/<strong>CSP</strong>cn3.dll"<br />

Note that ‘Init’ directives are made up of a single line. Due to <strong>the</strong> limitations of space, <strong>the</strong><br />

lines shown above are wrapped before <strong>the</strong> function declarations (funcs).<br />

<strong>Installing</strong> <strong>and</strong> <strong>Configuring</strong> <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong> 21


Web Servers for Microsoft Windows<br />

2.2.3.1 Directives<br />

Directives for Locating Static Components <strong>and</strong> <strong>the</strong> CGI Modules<br />

Find <strong>the</strong> ‘default’ directives section of obj.conf:<br />

<br />

Add <strong>the</strong> following lines in <strong>the</strong> ‘default’ section – that is, after <strong>the</strong> line shown above.<br />

NameTrans fn="pfx2dir" from="/csp/samples" dir="c:/cachesys/csp/samples"<br />

NameTrans fn="pfx2dir" from="/csp/broker" dir="c:/cachesys/csp/broker"<br />

NameTrans fn="pfx2dir" from="/csp-bin" \<br />

dir="c:/cachesys/csp/bin" name="cgi"<br />

Directives for Recognizing <strong>and</strong> Processing <strong>CSP</strong> Requests<br />

Add <strong>the</strong> following section to <strong>the</strong> end of obj.conf:<br />

Service method=(GET|HEAD|POST) fn=csp_req<br />

<br />

<br />

Service method=(GET|HEAD|POST) fn=csp_req<br />

<br />

2.2.3.2 Operating <strong>and</strong> Managing <strong>the</strong> <strong>Gateway</strong><br />

This connectivity option depends on <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong>’s Network Service Daemon (NSD).<br />

• Start <strong>the</strong> <strong>CSP</strong> NSD as described in <strong>the</strong> section dedicated to this service.<br />

• Apache must be (re)started after making changes to its configuration (httpd.conf).<br />

The order in which Apache <strong>and</strong> <strong>the</strong> NSD are started is unimportant.<br />

Although <strong>CSP</strong> pages are served through <strong>the</strong> higher-performing module (mod_csp.so), <strong>the</strong><br />

<strong>Gateway</strong>’s management suite is accessed through <strong>the</strong> CGI module dedicated to this purpose<br />

(nph-<strong>CSP</strong>cgiSys).<br />

To access <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong>’s Systems Management suite, point your browser at:<br />

http:///csp-bin/nph-<strong>CSP</strong>cgiSys<br />

If you see an unauthorized user error message, refer to <strong>the</strong> security notes.<br />

The <strong>CSP</strong> engine is automatically invoked for requested files containing <strong>the</strong> .csp <strong>and</strong> .cls<br />

extension. For example:<br />

http:///csp/samples/menu.csp<br />

22 <strong>Installing</strong> <strong>and</strong> <strong>Configuring</strong> <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong>


Apache Servers<br />

2.3 Apache Servers<br />

Apache is supplied by <strong>the</strong> Apache Group <strong>and</strong> can be downloaded free of charge from:<br />

http://www.apache.org.<br />

Pre-built kits are available for Windows which are, generally, a few builds behind <strong>the</strong> latest<br />

Apache build. The complete source code to Apache is available for download toge<strong>the</strong>r with<br />

clear instructions for building <strong>the</strong> server. To build Apache under Windows, you must have<br />

<strong>the</strong> Microsoft C compiler (Visual C++) version 5.0 (or later).<br />

This guide is based on <strong>the</strong> various <strong>CSP</strong>/<strong>Gateway</strong> Web server components being installed in<br />

<strong>the</strong> following file system:<br />

C:\cachesys\csp\<br />

It is assumed that <strong>the</strong> Web server is installed under:<br />

C:\Program Files\Apache Group\Apache\<br />

If <strong>the</strong> layout is different on your system, be sure to amend <strong>the</strong> various configuration directives<br />

described in <strong>the</strong> following sections, as appropriate.<br />

Choose one connectivity method from <strong>the</strong> following sections. The CGI-based approach is<br />

<strong>the</strong> easiest to get started with. On <strong>the</strong> o<strong>the</strong>r h<strong>and</strong>, <strong>the</strong> solutions based on dynamically linked<br />

modules perform better. It should be noted that <strong>the</strong> ISAPI-based solution requires <strong>the</strong> Apache<br />

server to be rebuilt with a modified version of <strong>the</strong> ISAPI module (mod_isapi.c).<br />

2.3.1 Installation (All Connectivity Options)<br />

The <strong>CSP</strong> <strong>Gateway</strong> components <strong>and</strong> <strong>the</strong> <strong>CSP</strong> static files should be installed as follows:<br />

1. NSD Module (if required)<br />

• <strong>CSP</strong>nsd.exe<br />

• <strong>CSP</strong>nsdSv.exe<br />

The default location for <strong>the</strong>se modules is:<br />

C:\cachesys\csp<br />

The NSD should be run from within its home directory (above). The configuration file<br />

(<strong>CSP</strong>.INI) <strong>and</strong> Event Log (<strong>CSP</strong>.LOG) are written in this directory for NSD-based connectivity<br />

options.<br />

<strong>Installing</strong> <strong>and</strong> <strong>Configuring</strong> <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong> 23


Web Servers for Microsoft Windows<br />

2. CGI <strong>and</strong> o<strong>the</strong>r dynamically linked Modules<br />

Note:<br />

The Apache Server API changed significantly between versions 1.3.x <strong>and</strong> 2.x.<br />

Consequently <strong>the</strong>re are separate binaries for each server as shown below.<br />

Common files:<br />

• <strong>CSP</strong>cgi.exe (Run-time module)<br />

• nph-<strong>CSP</strong>cgi.exe (A copy of <strong>CSP</strong>cgi)<br />

• <strong>CSP</strong>cgiSys.exe (Systems-Management module)<br />

• nph-<strong>CSP</strong>cgiSys.exe (A copy of <strong>CSP</strong>cgiSys)<br />

Apache Version 1.3.x:<br />

• mod_csp.dll (Apache ‘built-in’ module as a DLL – if supplied)<br />

• <strong>CSP</strong>ap.dll (Run-time module – if supplied)<br />

• <strong>CSP</strong>apSys.dll (<strong>Gateway</strong> Systems Management module – if supplied)<br />

Apache Version 2.x:<br />

• mod_csp2.dll (Apache ‘built-in’ module as a DLL – if supplied)<br />

• <strong>CSP</strong>a2.dll (Run-time module – if supplied)<br />

• <strong>CSP</strong>a2Sys.dll (<strong>Gateway</strong> Systems Management module – if supplied)<br />

The default location for <strong>the</strong>se binaries is:<br />

C:\cachesys\csp\bin<br />

The configuration file (<strong>CSP</strong>.INI) <strong>and</strong> Event Log (<strong>CSP</strong>.LOG) are written in this directory<br />

for non NSD-based connectivity options.<br />

The modules with ‘Sys’ appended are special modules for accessing <strong>the</strong> <strong>CSP</strong> systems<br />

management suite. The run-time modules (that is, those without ‘Sys’) have no access<br />

to <strong>the</strong> systems management forms.<br />

3. HyperEvents Components<br />

• <strong>CSP</strong>Broker.js<br />

• <strong>CSP</strong>BBroker.class<br />

• <strong>CSP</strong>Broker.jar<br />

24 <strong>Installing</strong> <strong>and</strong> <strong>Configuring</strong> <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong>


Apache Servers<br />

• <strong>CSP</strong>xmlhttp.js<br />

The default location for <strong>the</strong>se files is:<br />

C:\cachesys\csp\broker<br />

4. Miscellaneous static resources used by <strong>the</strong> <strong>CSP</strong> Samples<br />

A number of static Web resources (such as image files) are required by <strong>the</strong> <strong>CSP</strong> Samples.<br />

The default location for <strong>the</strong>se files is:<br />

C:\cachesys\csp\samples<br />

2.3.2 Option 1: Using <strong>the</strong> Apache API Modules (<strong>CSP</strong>a*.dll)<br />

This connectivity option is relatively new <strong>and</strong> offers <strong>the</strong> best performance as well as being<br />

<strong>the</strong> easiest to configure. It is not necessary to start <strong>the</strong> NSD in order to use this option. Apache<br />

under Windows is entirely multithreaded <strong>and</strong> its modules persist in memory from <strong>the</strong> time<br />

Apache is started. These two essential characteristics make it possible to implement <strong>the</strong><br />

<strong>Gateway</strong>’s functionality as a set of st<strong>and</strong>-alone modules.<br />

The modules <strong>CSP</strong>ap.dll (Run-time) <strong>and</strong> <strong>CSP</strong>apSys.dll (<strong>Gateway</strong> systems management) are<br />

dynamically linked modules that are designed to work <strong>the</strong> same way as <strong>the</strong> corresponding<br />

Microsoft ISAPI DLLs. Use modules <strong>CSP</strong>a2.dll (Run-time) <strong>and</strong> <strong>CSP</strong>a2Sys.dll for Apache<br />

Version 2.x.<br />

The Web server should be configured such that it recognizes <strong>CSP</strong> requests (files of type .csp<br />

<strong>and</strong> .cls) <strong>and</strong> passes <strong>the</strong>m to <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong> module for processing.<br />

The Web server configuration file (httpd.conf) are in <strong>the</strong> following directory:<br />

C:\Program Files\Apache Group\Apache\conf<br />

Add <strong>the</strong> following section to <strong>the</strong> end of httpd.conf:<br />

<strong>Installing</strong> <strong>and</strong> <strong>Configuring</strong> <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong> 25


Web Servers for Microsoft Windows<br />

LoadModule cspsys_module_sa c:/cachesys/csp/bin/<strong>CSP</strong>apSys.dll<br />

LoadModule csp_module_sa c:/cachesys/csp/bin/<strong>CSP</strong>ap.dll<br />

<br />

SetH<strong>and</strong>ler cspsys-h<strong>and</strong>ler-sa<br />

<br />

<br />

SetH<strong>and</strong>ler csp-h<strong>and</strong>ler-sa<br />

<br />

AddH<strong>and</strong>ler csp-h<strong>and</strong>ler-sa csp cls<br />

Alias /csp/ c:/cachesys/csp/<br />

<br />

AllowOverride None<br />

Options MultiViews FollowSymLinks ExecCGI<br />

Order allow,deny<br />

Allow from all<br />

<br />

Deny from all<br />

<br />

<br />

If you are using Apache Version 2.x <strong>the</strong>n you should specify <strong>CSP</strong>a2.dll (instead of <strong>CSP</strong>ap.dll)<br />

<strong>and</strong> <strong>CSP</strong>a2Sys.dll (instead of <strong>CSP</strong>apSys.dll) in <strong>the</strong> configuration block shown above.<br />

2.3.2.1 Operating <strong>and</strong> Managing <strong>the</strong> <strong>Gateway</strong><br />

To access <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong>’s systems management suite, point your browser at:<br />

http:///csp/bin/Systems/Module.cxw<br />

Notice <strong>the</strong> use of <strong>the</strong> 'cxw' file extension. This extension prevents Apache attempting to load<br />

<strong>and</strong> run <strong>the</strong>se DLLs through <strong>the</strong> Apache Group's ISAPI interface. Also, remember that URL<br />

paths <strong>and</strong> files names are case-sensitive under Apache.<br />

If you see an unauthorized user error message, refer to <strong>the</strong> security notes.<br />

The <strong>CSP</strong> engine is automatically invoked for requested files containing <strong>the</strong> .csp <strong>and</strong> .cls<br />

extension. For example:<br />

http:///csp/samples/menu.csp<br />

2.3.3 Option 2: Using <strong>the</strong> CGI Modules with <strong>the</strong> NSD<br />

(nph-<strong>CSP</strong>cgi*.exe)<br />

You should configure <strong>the</strong> Web server such that it recognizes <strong>CSP</strong> requests (files of type .csp<br />

<strong>and</strong> .cls) <strong>and</strong> passes <strong>the</strong>m to <strong>the</strong> <strong>CSP</strong> gateway for processing.<br />

The Web server configuration file (httpd.conf) are in <strong>the</strong> following directory:<br />

C:\Program Files\Apache Group\Apache\conf<br />

Add <strong>the</strong> following section to <strong>the</strong> end of httpd.conf:<br />

26 <strong>Installing</strong> <strong>and</strong> <strong>Configuring</strong> <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong>


Apache Servers<br />

<br />

AllowOverride None<br />

Options FollowSymLinks ExecCGI<br />

Order allow,deny<br />

Allow from all<br />

<br />

ScriptAliasMatch /*\.([Cc][Ss][Pp]|[Cc][Ll][Ss])$ \<br />

"c:/cachesys/csp/bin/nph-<strong>CSP</strong>cgi.exe"<br />

Alias /csp/ c:/cachesys/csp/<br />

<br />

AllowOverride None<br />

Options MultiViews FollowSymLinks ExecCGI<br />

Order allow,deny<br />

Allow from all<br />

<br />

Deny from all<br />

<br />

<br />

ScriptAlias /csp-bin/ "c:/cachesys/csp/bin/"<br />

<br />

AllowOverride None<br />

Options None<br />

Order allow,deny<br />

Allow from all<br />

<br />

Allow from all<br />

<br />

<br />

The above configuration block relies on <strong>the</strong> Regular Expressions (regex) processor being<br />

available to <strong>the</strong> Apache environment. Sometimes this is not <strong>the</strong> case (particularly with Windows<br />

2000 systems) <strong>and</strong> <strong>CSP</strong> files are consequently not served (‘File not found’ errors will<br />

be returned). To remedy this situation, you can associate <strong>the</strong> (virtual) root location of your<br />

<strong>CSP</strong> applications with <strong>the</strong> CGI module instead of making <strong>the</strong> association through <strong>the</strong> <strong>CSP</strong><br />

file extensions. For example, let’s say your <strong>CSP</strong> applications are contained under location<br />

‘/csp’. To associate <strong>the</strong> <strong>CSP</strong> CGI module with files under ‘/csp’, replace <strong>the</strong> following configuration<br />

blocks:<br />

<br />

AllowOverride None<br />

Options FollowSymLinks ExecCGI<br />

Order allow,deny<br />

Allow from all<br />

<br />

ScriptAliasMatch /*\.([Cc][Ss][Pp]|[Cc][Ll][Ss])$<br />

"c:/cachesys/csp/bin/nph-<strong>CSP</strong>cgi.exe"<br />

with<br />

<br />

AllowOverride None<br />

Options FollowSymLinks ExecCGI<br />

Order allow,deny<br />

Allow from all<br />

<br />

ScriptAlias /csp "c:/cachesys/csp/bin/nph-<strong>CSP</strong>cgi.exe"<br />

These directives work for URLs of <strong>the</strong> form:<br />

<strong>Installing</strong> <strong>and</strong> <strong>Configuring</strong> <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong> 27


Web Servers for Microsoft Windows<br />

http:///csp/*.csp<br />

Duplicate this configuration block for o<strong>the</strong>r root locations. For example, repeat <strong>the</strong> process<br />

for ‘/myapps’ for URLs of <strong>the</strong> form:<br />

http:///myapps/*.csp<br />

Ano<strong>the</strong>r approach to avoiding <strong>the</strong> ‘regex’ issue is to use an ‘Action’ directive in conjunction<br />

with a <strong>CSP</strong> MIME type. However, it should be noted that ‘Action’ is essentially a content<br />

filtering technique <strong>and</strong>, as such, requires that your <strong>CSP</strong> files are physically present on <strong>the</strong><br />

Web server host even if <strong>the</strong> Caché server is installed on a separate computer. If you wish to<br />

use this approach, first add a new MIME type to <strong>the</strong> end of <strong>the</strong> Apache mime.types file <strong>and</strong><br />

associate it with file types representing <strong>CSP</strong> content. The mime.types file are in <strong>the</strong> same<br />

directory as <strong>the</strong> httpd.conf file.<br />

text/csp<br />

csp cls<br />

Now, add <strong>the</strong> ‘Action’ directive to <strong>the</strong> end of <strong>the</strong> CGI configuration block in httpd.conf such<br />

that it reads:<br />

Alias /csp/ c:/cachesys/csp/<br />

<br />

AllowOverride None<br />

Options MultiViews FollowSymLinks ExecCGI<br />

Order allow,deny<br />

Allow from all<br />

<br />

Deny from all<br />

<br />

<br />

Deny from all<br />

<br />

<br />

Deny from all<br />

<br />

<br />

Deny from all<br />

<br />

<br />

Deny from all<br />

<br />

<br />

Deny from all<br />

<br />

<br />

ScriptAlias /csp-bin/ "c:/cachesys/csp/bin/"<br />

<br />

AllowOverride None<br />

Options None<br />

Order allow,deny<br />

Allow from all<br />

<br />

Action text/csp “/csp-bin/nph-<strong>CSP</strong>cgi.exe”<br />

Finally, note that because CGI is an open st<strong>and</strong>ard, <strong>the</strong> <strong>CSP</strong> CGI modules work with any<br />

Web server.<br />

28 <strong>Installing</strong> <strong>and</strong> <strong>Configuring</strong> <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong>


Apache Servers<br />

2.3.3.1 Operating <strong>and</strong> Managing <strong>the</strong> <strong>Gateway</strong><br />

This connectivity option depends on <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong>’s Network Service Daemon (NSD).<br />

• Start <strong>the</strong> <strong>CSP</strong> NSD as described in <strong>the</strong> section dedicated to this service.<br />

• Apache must be (re)started after making changes to its configuration (httpd.conf).<br />

The order in which Apache <strong>and</strong> <strong>the</strong> NSD are started is unimportant.<br />

To access <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong>’s Systems Management suite, point your browser at:<br />

http:///csp-bin/nph-<strong>CSP</strong>cgiSys<br />

If you see an unauthorized user error message, refer to <strong>the</strong> security notes.<br />

The <strong>CSP</strong> engine is automatically invoked for requested files containing <strong>the</strong> .csp <strong>and</strong> .cls<br />

extension. For example:<br />

http:///csp/samples/menu.csp<br />

2.3.4 Option 3: Using an Apache API Module with <strong>the</strong> NSD<br />

(mod_csp*.dll)<br />

Note:<br />

This connectivity option is largely superseded by <strong>the</strong> st<strong>and</strong>-alone API modules<br />

described in Option 1.<br />

If <strong>the</strong> <strong>CSP</strong> module is supplied with your distribution as a DLL (mod_csp.dll), this provides a<br />

better-performing solution than <strong>the</strong> CGI-based solution previously described. Use module<br />

mod_csp2.dll for Apache Version 2.x.<br />

Edit <strong>the</strong> Apache configuration file ‘httpd.conf’. For <strong>the</strong> st<strong>and</strong>ard Apache distribution this file<br />

is in:<br />

C:\Program Files\Apache Group\Apache\conf<br />

Assuming that you wish to invoke <strong>the</strong> <strong>CSP</strong> engine for requested files containing <strong>the</strong> extension<br />

.csp <strong>and</strong> .cls, add <strong>the</strong> following section to <strong>the</strong> end of ‘httpd.conf’:<br />

<strong>Installing</strong> <strong>and</strong> <strong>Configuring</strong> <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong> 29


Web Servers for Microsoft Windows<br />

LoadModule csp_module c:/cachesys/csp/bin/mod_csp.dll<br />

<br />

SetH<strong>and</strong>ler csp-h<strong>and</strong>ler<br />

<br />

Alias /csp/ /cachesys/csp/<br />

<br />

AllowOverride None<br />

Options MultiViews FollowSymLinks ExecCGI<br />

Order allow,deny<br />

Allow from all<br />

<br />

Deny from all<br />

<br />

<br />

Deny from all<br />

<br />

<br />

ScriptAlias /csp-bin/ "c:/cachesys/csp/bin/"<br />

<br />

AllowOverride None<br />

Options None<br />

Order allow,deny<br />

Allow from all<br />

<br />

Of course, if you are using Apache Version 2.x <strong>the</strong>n you should specify mod_csp2.dll (instead<br />

of mod_csp.dll) in <strong>the</strong> configuration block shown above.<br />

The above configuration block relies on <strong>the</strong> Regular Expressions (regex) processor being<br />

available to <strong>the</strong> Apache environment. Sometimes this is not <strong>the</strong> case (particularly with Windows<br />

2000 systems) <strong>and</strong> <strong>CSP</strong> files are consequently not served (‘File not found’ errors are<br />

returned). To remedy this situation, replace <strong>the</strong> following configuration block:<br />

<br />

SetH<strong>and</strong>ler csp-h<strong>and</strong>ler<br />

<br />

with:<br />

AddH<strong>and</strong>ler csp-h<strong>and</strong>ler csp cls<br />

2.3.4.1 Operating <strong>and</strong> Managing <strong>the</strong> <strong>Gateway</strong><br />

This connectivity option depends on <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong>’s Network Service Daemon (NSD).<br />

• Start <strong>the</strong> <strong>CSP</strong> NSD as described in <strong>the</strong> section dedicated to this service.<br />

• Apache must be (re)started after making changes to its configuration (httpd.conf).<br />

The order in which Apache <strong>and</strong> <strong>the</strong> NSD are started is unimportant.<br />

Although <strong>CSP</strong> pages are served through <strong>the</strong> higher-performing module (mod_csp.dll), <strong>the</strong><br />

<strong>Gateway</strong>’s management suite is accessed through <strong>the</strong> CGI module dedicated to this purpose<br />

(nph-<strong>CSP</strong>cgiSys.exe).<br />

30 <strong>Installing</strong> <strong>and</strong> <strong>Configuring</strong> <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong>


To access <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong>’s Systems Management suite, point your browser at:<br />

http:///csp-bin/nph-<strong>CSP</strong>cgiSys.exe<br />

If you see an unauthorized user error message, refer to <strong>the</strong> security notes.<br />

The <strong>CSP</strong> engine is automatically invoked for requested files containing <strong>the</strong> .csp <strong>and</strong> .cls<br />

extension. For example:<br />

http:///csp/samples/menu.csp<br />

Apache Servers<br />

2.3.5 Option 4: Using <strong>the</strong> ISAPI Modules (<strong>CSP</strong>ms*.dll)<br />

This connectivity option is superseded by <strong>the</strong> st<strong>and</strong>-alone API modules described in Option<br />

1 <strong>and</strong> should not be used. It is documented here as a reference for legacy systems that have<br />

used it in <strong>the</strong> past.<br />

The Apache Group provide a module that attempts to emulate Microsoft’s ISAPI interface.<br />

If Apache is configured to use this module <strong>the</strong>n ISAPI extensions may be run. However, <strong>the</strong>re<br />

are significant differences between <strong>the</strong> Apache Group’s ISAPI interface <strong>and</strong> Microsoft’s<br />

original. The most troublesome feature of <strong>the</strong> Apache ISAPI module is that it unloads its<br />

ISAPI extensions (DLLs) after servicing each <strong>and</strong> every request. This behavior is unacceptable<br />

for <strong>CSP</strong> because <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong> relies on its ISAPI DLLs remaining in memory in order<br />

for it to manage a persistent pool of connections to Caché.<br />

The modified ISAPI module supplied with <strong>CSP</strong> allows <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong>’s ISAPI extensions<br />

to remain loaded between requests. The modifications only affect <strong>the</strong> <strong>Gateway</strong>’s ISAPI DLLs;<br />

all o<strong>the</strong>r ISAPI DLLs are subject to <strong>the</strong> original Apache Group’s functionality.<br />

2.3.5.1 Rebuilding <strong>the</strong> Apache Executable<br />

1. Upgrade <strong>the</strong> Apache ISAPI module (mod_isapi.c)<br />

Overwrite <strong>the</strong> Apache Group’s ISAPI module with <strong>the</strong> version contained in <strong>the</strong> <strong>CSP</strong><br />

distribution:<br />

C:\Program Files\Apache Group\Apache\src\os\win32\mod_isapi.c<br />

2. Rebuild <strong>the</strong> Apache executable<br />

In order to perform this step you need version 5.0 (or later) of <strong>the</strong> Microsoft C Compiler<br />

(Microsoft Visual C++).<br />

Change to <strong>the</strong> following directory:<br />

C:\Program Files\Apache Group\Apache\src\os\win32\mod_isapi.c<br />

<strong>Installing</strong> <strong>and</strong> <strong>Configuring</strong> <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong> 31


Web Servers for Microsoft Windows<br />

Build Apache:<br />

nmake /f Makefile.nt installr INSTDIR=d:\progra~1\apache~1\apache<br />

You can safely ignore <strong>the</strong> many innocuous warning messages that <strong>the</strong> build process displays.<br />

3. Run-time configuration<br />

Edit <strong>the</strong> Apache configuration file ‘httpd.conf’. For <strong>the</strong> st<strong>and</strong>ard Apache distribution this<br />

file is in:<br />

C:\Program Files\Apache Group\Apache\conf<br />

Assuming that you wish to invoke <strong>the</strong> <strong>CSP</strong> engine for requested files containing <strong>the</strong><br />

extension .csp <strong>and</strong> .cls, add <strong>the</strong> following section to <strong>the</strong> end of ‘httpd.conf’:<br />

AddH<strong>and</strong>ler isapi-isa dll<br />

AddH<strong>and</strong>ler isapi-isa csp<br />

AddH<strong>and</strong>ler isapi-isa cls<br />

Alias /csp/ /cachesys/csp/<br />

<br />

AllowOverride None<br />

Options MultiViews FollowSymLinks ExecCGI<br />

Order allow,deny<br />

Allow from all<br />

<br />

Deny from all<br />

<br />

<br />

2.3.5.2 Operating <strong>and</strong> Managing <strong>the</strong> <strong>Gateway</strong><br />

To access <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong>’s Systems Management suite, point your browser at:<br />

http:///csp/bin/<strong>CSP</strong>msSys.dll<br />

If you see an unauthorized user error message, refer to <strong>the</strong> security notes.<br />

The <strong>CSP</strong> engine is automatically invoked for requested files containing <strong>the</strong> .csp <strong>and</strong> .cls<br />

extension. For example:<br />

http:///csp/samples/menu.csp<br />

32 <strong>Installing</strong> <strong>and</strong> <strong>Configuring</strong> <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong>


2.4 Operating <strong>the</strong> Network Service Daemon<br />

(NSD)<br />

Use <strong>the</strong> following procedure to start <strong>the</strong> NSD:<br />

1. Change to <strong>the</strong> NSD's home directory:<br />

C:\cachesys\csp<br />

2. Start <strong>the</strong> NSD:<br />

<strong>CSP</strong>nsd<br />

Under Windows 95, this service runs interactively in <strong>the</strong> comm<strong>and</strong> window. For o<strong>the</strong>r<br />

versions of Windows <strong>the</strong> NSD starts as a Windows service (<strong>CSP</strong>nsd.Sv.exe). Once registered<br />

as a service, you can manage <strong>the</strong> NSD entirely through <strong>the</strong> Windows Service<br />

Manager.<br />

3. Close down <strong>the</strong> NSD, by issuing <strong>the</strong> following comm<strong>and</strong>:<br />

• Windows 95:<br />

Type Control-C in <strong>the</strong> NSD’s comm<strong>and</strong> Window.<br />

• O<strong>the</strong>r Windows Systems:<br />

<strong>CSP</strong>nsd -stop<br />

Operating <strong>the</strong> Network Service Daemon (NSD)<br />

Alternatively, you can enter:<br />

<strong>CSP</strong>nsd<br />

This shows <strong>the</strong> status of <strong>the</strong> NSD’s Windows Service <strong>and</strong> allows you to perform one of <strong>the</strong><br />

following actions:<br />

• Stop <strong>the</strong> NSD service if it is running.<br />

• Continue <strong>the</strong> NSD service if it is paused.<br />

• Remove <strong>the</strong> NSD service from <strong>the</strong> services database.<br />

Alternatively, you can use <strong>the</strong> Windows Service Manager to manage <strong>the</strong> NSD. The NSD can<br />

be identified in <strong>the</strong> Service Manager by <strong>the</strong> description:<br />

Cache Server Pages – Network Service Daemon<br />

<strong>Installing</strong> <strong>and</strong> <strong>Configuring</strong> <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong> 33


Web Servers for Microsoft Windows<br />

All errors are reported in <strong>the</strong> <strong>CSP</strong> event log (that is, ‘<strong>CSP</strong>.log’). This file is created <strong>and</strong><br />

maintained in <strong>the</strong> ‘C:\cachesys\csp’ directory. The <strong>CSP</strong> configuration file ‘<strong>CSP</strong>.ini’ also<br />

resides in this directory.<br />

The NSD also creates <strong>the</strong> following file:<br />

C:\cachesys\csp\<strong>CSP</strong>nsd.ini<br />

This file is extremely important because it tells <strong>the</strong> ‘clients’ how to communicate with <strong>the</strong><br />

NSD. In this context, <strong>the</strong> ‘clients’ are <strong>the</strong> <strong>CSP</strong> module linked to Apache <strong>and</strong> <strong>the</strong> <strong>CSP</strong> CGI<br />

modules invoked by Apache. It is, <strong>the</strong>refore, essential that this file is not deleted or moved.<br />

It is also important that <strong>the</strong> Apache processes can read this file. Set <strong>the</strong> privileges accordingly,<br />

bearing in mind <strong>the</strong> Windows user under which your Apache server is operating.<br />

34 <strong>Installing</strong> <strong>and</strong> <strong>Configuring</strong> <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong>


3<br />

Web Servers for UNIX, LINUX, <strong>and</strong><br />

Mac OS X<br />

Web Servers from Sun <strong>and</strong> Apache are described in this section. The original Netscape Web<br />

servers (Enterprise <strong>and</strong> FastTrack), which were, until fairly recently, marketed under <strong>the</strong><br />

name of ‘iPlanet’, are now developed <strong>and</strong> marketed by Sun.<br />

Netscape/iPlanet/Sun Web servers can also be extended by means of a high-performance<br />

API. The Netscape Application Programming Interface (NSAPI) allows us to extend <strong>the</strong> Web<br />

server through modules implemented as UNIX Shared Objects (or Shared Libraries).<br />

Several connectivity options are available for Apache. The CGI-based solution is arguably<br />

<strong>the</strong> easiest option to install <strong>and</strong> configure. The Apache Group also provide support for<br />

extensions implemented as dynamically linked modules (DSOs). Extensions, written as<br />

Apache modules, can be built directly into <strong>the</strong> Apache core. However, this latter option<br />

requires that Apache be rebuilt.<br />

3.1 Netscape, iPlanet, <strong>and</strong> Sun Web Servers<br />

This section covers <strong>the</strong> configuration <strong>and</strong> operational procedures for running <strong>CSP</strong> through<br />

<strong>the</strong> original Netscape Web servers (Enterprise <strong>and</strong> FastTrack). The modern versions of <strong>the</strong>se<br />

servers were, until fairly recently, marketed under <strong>the</strong> name of iPlanet, but are now developed<br />

<strong>and</strong> marketed by Sun as <strong>the</strong> Sun ONE suite of servers. At <strong>the</strong> time of writing, Sun had fur<strong>the</strong>r<br />

renamed <strong>the</strong>se servers <strong>and</strong> <strong>the</strong> Sun ONE Web server is now known as <strong>the</strong> Sun Java System<br />

Web Server.<br />

<strong>Installing</strong> <strong>and</strong> <strong>Configuring</strong> <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong> 35


Web Servers for UNIX, LINUX, <strong>and</strong> Mac OS X<br />

Traditionally, <strong>the</strong>se Netscape-based servers are produced in two forms: FastTrack <strong>and</strong><br />

Enterprise. The FastTrack server is a lightweight version of <strong>the</strong> Enterprise-grade server with<br />

limited functionality <strong>and</strong> is usually supplied free of charge. The installation <strong>and</strong> configuration<br />

procedure (with respect to <strong>CSP</strong>) is <strong>the</strong> same for both grades of server.<br />

This guide is based on <strong>the</strong> various <strong>CSP</strong> Web server components being installed in <strong>the</strong> following<br />

file system:<br />

/usr/cachesys/csp/<br />

It is assumed that <strong>the</strong> Web server is installed under:<br />

/usr/netscape/suitespot/<br />

(or /opt/netscape/suitespot/)<br />

For <strong>the</strong> sake of brevity, <strong>the</strong> ‘Netscape’ product name is used throughout in <strong>the</strong> following<br />

discussion. However, be aware of <strong>the</strong> various name changes that have occurred in this product<br />

line. For example, <strong>the</strong> iPlanet server, though essentially <strong>the</strong> same product as Netscape<br />

Enterprise, is usually installed under:<br />

/usr/iplanet/<br />

(or /opt/iplanet/)<br />

The later versions supplied by Sun are installed under:<br />

/usr/SUNWwbsvr/<br />

(or /opt/SUNWwbsvr/)<br />

Individual instances of <strong>the</strong> Netscape server are installed under directories of <strong>the</strong> form:<br />

/usr/netscape/suitespot/https-/<br />

or<br />

/usr/netscape/suitespot/httpd-/<br />

Where ‘server_name’ is <strong>the</strong> logical name assigned to <strong>the</strong> hosting computer.<br />

If <strong>the</strong> layout is different on your system, be sure to amend <strong>the</strong> various configuration directives<br />

described in <strong>the</strong> following sections, as appropriate.<br />

The documentation root directory for <strong>the</strong>se servers is usually:<br />

/usr/netscape/suitespot/docs/<br />

3.1.1 Installation<br />

The <strong>CSP</strong> <strong>Gateway</strong> components <strong>and</strong> <strong>the</strong> <strong>CSP</strong> static files should be installed as follows:<br />

1. NSD Module (if required)<br />

36 <strong>Installing</strong> <strong>and</strong> <strong>Configuring</strong> <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong>


Netscape, iPlanet, <strong>and</strong> Sun Web Servers<br />

<strong>CSP</strong>nsd<br />

The default location for this module is:<br />

/usr/cachesys/csp<br />

The NSD should be run from within its home directory (above). The configuration file<br />

(<strong>CSP</strong>.INI) <strong>and</strong> Event Log (<strong>CSP</strong>.LOG) are written in this directory for NSD-based connectivity<br />

options.<br />

2. NSAPI <strong>and</strong> CGI Modules<br />

• <strong>CSP</strong>n3.so (Run-time module)<br />

• <strong>CSP</strong>n3Sys.so (Systems-management module)<br />

• <strong>CSP</strong>cn3.so (NSAPI client to <strong>the</strong> NSD – if supplied)<br />

• <strong>CSP</strong>cgi.exe (Run-time module)<br />

• nph-<strong>CSP</strong>cgi.exe (A copy of <strong>CSP</strong>cgi)<br />

• <strong>CSP</strong>cgiSys.exe (Systems-Management module)<br />

• nph-<strong>CSP</strong>cgiSys.exe (A copy of <strong>CSP</strong>cgiSys)<br />

Note that not all of <strong>the</strong> modules listed above are required for all connectivity options.<br />

Refer to <strong>the</strong> sections describing each option to see which are actually required.<br />

The default location for <strong>the</strong>se modules is:<br />

/usr/cachesys/csp/bin<br />

The configuration file (<strong>CSP</strong>.INI) <strong>and</strong> Event Log (<strong>CSP</strong>.LOG) are written in this directory<br />

for non-NSD based connectivity options.<br />

3. HyperEvents Components<br />

• <strong>CSP</strong>Broker.js<br />

• <strong>CSP</strong>BBroker.class<br />

• <strong>CSP</strong>Broker.jar<br />

• <strong>CSP</strong>xmlhttp.js<br />

The default location for <strong>the</strong>se files is:<br />

/usr/cachesys/csp/broker<br />

4. Miscellaneous static resources used by <strong>the</strong> <strong>CSP</strong> Samples<br />

<strong>Installing</strong> <strong>and</strong> <strong>Configuring</strong> <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong> 37


Web Servers for UNIX, LINUX, <strong>and</strong> Mac OS X<br />

A number of static Web resources (such as image files) are required by <strong>the</strong> <strong>CSP</strong> Samples.<br />

The default location for <strong>the</strong>se files is:<br />

/usr/cachesys/csp/samples<br />

3.1.2 Option 1: Using <strong>the</strong> NSAPI Modules (<strong>CSP</strong>n3*.so)<br />

You should configure <strong>the</strong> Web server such that it recognizes <strong>CSP</strong> requests (files of type .csp<br />

<strong>and</strong> .cls) <strong>and</strong> pass <strong>the</strong>m to <strong>the</strong> <strong>CSP</strong> gateway for processing.<br />

The Web server configuration files (magnus.conf <strong>and</strong> obj.conf) are in <strong>the</strong> following directory:<br />

/usr/netscape/suitespot/https-/config/<br />

You need to add directives to load <strong>the</strong> NSAPI modules <strong>and</strong> instructions for recognizing <strong>and</strong><br />

processing <strong>CSP</strong> files to <strong>the</strong> Web server configuration.<br />

3.1.2.1 Directives<br />

Directives for Loading <strong>the</strong> NSAPI Modules<br />

The ‘Init’ directive instructs <strong>the</strong> Web server to load NSAPI modules. Depending on which<br />

version of <strong>the</strong> Web server you have, <strong>the</strong>se directives should be added to ei<strong>the</strong>r <strong>the</strong> core<br />

magnus.conf file or <strong>the</strong> objects obj.conf configuration file. The Netscape Web servers <strong>and</strong><br />

early iPlanet servers use <strong>the</strong> obj.conf for holding ‘Init’ directives, whereas later iPlanet <strong>and</strong><br />

Sun servers use <strong>the</strong> magnus.conf file. In order to determine which of <strong>the</strong>se two configuration<br />

files you should use, examine both to see where <strong>the</strong> Web server’s core ‘Init’ directives are<br />

held. These core configuration directives are always present, an example of which is as follows:<br />

Init fn=load-types mime-types=mime.types<br />

Having located <strong>the</strong> block of core ‘Init’ directives, add <strong>the</strong> following section before this block:<br />

Init fn=load-modules shlib=/usr/cachesys/csp/bin/<strong>CSP</strong>n3.so \<br />

funcs=csp_term,csp_init,csp_req<br />

Init fn=csp_init shlib=”/usr/cachesys/csp/bin/<strong>CSP</strong>n3.so”<br />

Init fn=load-modules shlib=/usr/cachesys/csp/bin/<strong>CSP</strong>n3Sys.so \<br />

funcs=csp_term_sys,csp_init_sys,csp_req_sys<br />

Init fn=csp_init_sys “shlib=/usr/cachesys/csp/bin/<strong>CSP</strong>n3Sys.so”<br />

Note that ‘Init’ directives are made up of a single line. Due to <strong>the</strong> limitations of space, <strong>the</strong><br />

lines shown above are wrapped before <strong>the</strong> function declarations (funcs).<br />

38 <strong>Installing</strong> <strong>and</strong> <strong>Configuring</strong> <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong>


Directives for Locating Static Components<br />

<strong>CSP</strong> includes a number of ‘static’ files that are served by <strong>the</strong> Web server. For example, <strong>the</strong><br />

Java/JavaScript files used to implement hyperevents <strong>and</strong> <strong>the</strong> image used in <strong>the</strong> <strong>CSP</strong> samples.<br />

These files are detailed in sections 2 <strong>and</strong> 3 of <strong>the</strong> installation section respectively.<br />

The Web server needs to know <strong>the</strong> location of <strong>the</strong>se files relative to <strong>the</strong> virtual <strong>CSP</strong> documentation<br />

root directory.<br />

Find <strong>the</strong> ‘default’ directives section of obj.conf:<br />

<br />

Add <strong>the</strong> following two lines in <strong>the</strong> ‘default’ section – that is, after <strong>the</strong> line shown above.<br />

NameTrans fn="pfx2dir" from="/csp/samples" \<br />

dir="/usr/cachesys/csp/samples"<br />

NameTrans fn="pfx2dir" from="/csp/broker" \<br />

dir="/usr/cachesys/csp/broker"<br />

Directives for Recognizing <strong>and</strong> Processing <strong>CSP</strong> Requests<br />

Add <strong>the</strong> following section to <strong>the</strong> end of obj.conf:<br />

<br />

Service method=(GET|HEAD|POST) fn=csp_req<br />

<br />

<br />

Service method=(GET|HEAD|POST) fn=csp_req<br />

<br />

<br />

Service method=(GET|HEAD|POST) fn=csp_req_sys<br />

<br />

<br />

Service method=(GET|HEAD|POST) fn=csp_req<br />

<br />

3.1.2.2 Operating <strong>and</strong> Managing <strong>the</strong> <strong>Gateway</strong><br />

The Web server must be restarted after making changes to its configuration files (magnus.conf<br />

<strong>and</strong> obj.conf).<br />

To access <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong>’s systems management suite, point your browser at:<br />

http:///csp/bin/<strong>CSP</strong>n3Sys.so<br />

If you see an unauthorized user error message, refer to <strong>the</strong> security notes.<br />

The <strong>CSP</strong> engine is automatically invoked for requested files containing <strong>the</strong> .csp <strong>and</strong> .cls<br />

extension. For example:<br />

http:///csp/samples/menu.csp<br />

Netscape, iPlanet, <strong>and</strong> Sun Web Servers<br />

<strong>Installing</strong> <strong>and</strong> <strong>Configuring</strong> <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong> 39


Web Servers for UNIX, LINUX, <strong>and</strong> Mac OS X<br />

3.1.3 Option 2: Using a NSAPI Module with <strong>the</strong> NSD (<strong>CSP</strong>cn3.so)<br />

In most cases, <strong>the</strong> all-inclusive NSAPI-based solution (Option 1) is <strong>the</strong> option of choice, <strong>and</strong><br />

is <strong>the</strong> implementation that gives <strong>the</strong> best performance. The NSAPI/NSD hybrid is useful for<br />

cases where it is necessary, for operational reasons, to manage <strong>the</strong> <strong>Gateway</strong> independently<br />

of <strong>the</strong> hosting Web server. For example, if multiple instances of <strong>the</strong> Web server are to share<br />

<strong>the</strong> same <strong>Gateway</strong> installation. In option 1, each instance of <strong>the</strong> core Web server process<br />

binds to its own instance of <strong>the</strong> <strong>Gateway</strong>.<br />

The configuration procedure is very similar to that described for Option 1. The essential differences<br />

are highlighted below.<br />

Locate <strong>the</strong> block of core ‘Init’ directives for your Web server as described for Option 1. These<br />

are found in ei<strong>the</strong>r magnus.conf or obj.conf. Add <strong>the</strong> following section before <strong>the</strong> core ‘Init’<br />

block:<br />

Init fn=load-modules shlib=/usr/cachesys/csp/bin/<strong>CSP</strong>cn3.so \<br />

funcs=cspc_term,cspc_init,cspc_req<br />

Init fn=cspc_init shlib="/usr/cachesys/csp/bin/<strong>CSP</strong>cn3.so"<br />

Note that ‘Init’ directives are made up of a single line. Due to <strong>the</strong> limitations of space, <strong>the</strong><br />

lines shown above are wrapped before <strong>the</strong> function declarations (funcs).<br />

3.1.3.1 Directives<br />

Directives for Locating Static Components <strong>and</strong> <strong>the</strong> CGI Modules<br />

Find <strong>the</strong> ‘default’ directives section of obj.conf:<br />

<br />

Add <strong>the</strong> following lines in <strong>the</strong> ‘default’ section – that is, after <strong>the</strong> line shown above.<br />

NameTrans fn="pfx2dir" from="/csp/samples" \<br />

dir="/usr/cachesys/csp/samples"<br />

NameTrans fn="pfx2dir" from="/csp/broker" \<br />

dir="/usr/cachesys/csp/broker"<br />

NameTrans fn="pfx2dir" from="/csp-bin" \<br />

dir="/usr/cachesys/csp/bin" name="cgi"<br />

Directives for Recognizing <strong>and</strong> Processing <strong>CSP</strong> Requests<br />

Add <strong>the</strong> following section to <strong>the</strong> end of obj.conf:<br />

<br />

Service method=(GET|HEAD|POST) fn=csp_req<br />

<br />

<br />

Service method=(GET|HEAD|POST) fn=csp_req<br />

<br />

40 <strong>Installing</strong> <strong>and</strong> <strong>Configuring</strong> <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong>


Apache Servers<br />

3.1.3.2 Operating <strong>and</strong> Managing <strong>the</strong> <strong>Gateway</strong><br />

This connectivity option depends on <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong>’s Network Service Daemon (NSD).<br />

• Start <strong>the</strong> <strong>CSP</strong> NSD as described in <strong>the</strong> section dedicated to this service.<br />

• Apache must be (re)started after making changes to its configuration (httpd.conf).<br />

The order in which Apache <strong>and</strong> <strong>the</strong> NSD are started is unimportant.<br />

Although <strong>CSP</strong> pages are served through <strong>the</strong> higher-performing module (mod_csp.so), <strong>the</strong><br />

<strong>Gateway</strong>’s management suite is accessed through <strong>the</strong> CGI module dedicated to this purpose<br />

(nph-<strong>CSP</strong>cgiSys).<br />

To access <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong>’s Systems Management suite, point your browser at:<br />

http:///csp-bin/nph-<strong>CSP</strong>cgiSys<br />

If you see an unauthorized user error message, refer to <strong>the</strong> security notes.<br />

The <strong>CSP</strong> engine is automatically invoked for requested files containing <strong>the</strong> .csp <strong>and</strong> .cls<br />

extension. For example:<br />

http:///csp/samples/menu.csp<br />

3.2 Apache Servers<br />

Apache is supplied by <strong>the</strong> Apache Group <strong>and</strong> can be downloaded free of charge from<br />

http://www.apache.org.<br />

Pre-built kits are available for some UNIX systems which are, generally, a few builds behind<br />

<strong>the</strong> latest version. The complete source code to Apache is available for download toge<strong>the</strong>r<br />

with clear instructions for building <strong>the</strong> Apache server. The freely available GNU C compiler<br />

(gcc) can be obtained for this purpose, though <strong>the</strong> Apache build procedure attempts to use<br />

<strong>the</strong> indigenous C compiler.<br />

Many systems are shipped with Apache pre-installed, configured <strong>and</strong> ready to go. Most distributions<br />

of Linux include Apache. IBM distribute Apache with <strong>the</strong>ir UNIX offering — AIX.<br />

This guide is based on <strong>the</strong> various <strong>CSP</strong> Web server components being installed in <strong>the</strong> following<br />

file system:<br />

/usr/cachesys/csp/<br />

It is assumed that <strong>the</strong> Web server is installed under:<br />

<strong>Installing</strong> <strong>and</strong> <strong>Configuring</strong> <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong> 41


Web Servers for UNIX, LINUX, <strong>and</strong> Mac OS X<br />

/usr/apache/<br />

If <strong>the</strong> layout is different on your system, be sure to amend <strong>the</strong> various configuration directives<br />

described in <strong>the</strong> following sections, as appropriate.<br />

Choose one connectivity method from <strong>the</strong> following sections. The CGI-based approach is<br />

<strong>the</strong> easiest to get started with. On <strong>the</strong> o<strong>the</strong>r h<strong>and</strong>, <strong>the</strong> solutions based on dynamically linked<br />

or built-in modules perform better.<br />

3.2.1 Installation (All Connectivity Options)<br />

The <strong>CSP</strong> <strong>Gateway</strong> components <strong>and</strong> <strong>the</strong> <strong>CSP</strong> static files should be installed as follows:<br />

1. NSD Module<br />

<strong>CSP</strong>nsd<br />

The default location for this module is:<br />

/usr/cachesys/csp<br />

The NSD should be run from within its home directory (above). The configuration file<br />

(<strong>CSP</strong>.INI) <strong>and</strong> Event Log (<strong>CSP</strong>.LOG) are written in this directory.<br />

2. CGI <strong>and</strong> o<strong>the</strong>r dynamically-linked Modules<br />

• <strong>CSP</strong>cgi (Run-time module)<br />

• nph-<strong>CSP</strong>cgi (A copy of <strong>CSP</strong>cgi)<br />

• <strong>CSP</strong>cgiSys (Systems-Management module)<br />

• nph-<strong>CSP</strong>cgiSys (A copy of <strong>CSP</strong>cgiSys)<br />

• mod_csp.so (Apache Version 1.3.x — Apache module as a DSO, if supplied)<br />

• mod_csp2.so (Apache Version 2.x, Apache module as a DSO, if supplied)<br />

The default location for <strong>the</strong>se binaries is:<br />

/usr/cachesys/csp/bin<br />

The modules with ‘Sys’ appended are special modules for accessing <strong>the</strong> <strong>CSP</strong> systems<br />

management suite. The run-time modules (that is, those without ‘Sys’) have no access<br />

to <strong>the</strong> systems management forms.<br />

3. HyperEvents Components<br />

• <strong>CSP</strong>Broker.js<br />

42 <strong>Installing</strong> <strong>and</strong> <strong>Configuring</strong> <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong>


Apache Servers<br />

• <strong>CSP</strong>BBroker.class<br />

• <strong>CSP</strong>Broker.jar<br />

• <strong>CSP</strong>xmlhttp.js<br />

The default location for <strong>the</strong>se files is:<br />

/usr/cachesys/csp/broker<br />

4. Miscellaneous static resources used by <strong>the</strong> <strong>CSP</strong> Samples<br />

A number of static Web resources (such as image files) are required by <strong>the</strong> <strong>CSP</strong> Samples.<br />

The default location for <strong>the</strong>se files is:<br />

/usr/cachesys/csp/samples<br />

3.2.2 Option 1: Using a Dynamic Apache API Module with <strong>the</strong> NSD<br />

(mod_csp*.so)<br />

If <strong>the</strong> <strong>CSP</strong> module is supplied with your distribution as a pre-built shared object (mod_csp.so<br />

or mod_csp2.so), <strong>the</strong>n proceed to <strong>the</strong> section on configuration. To build <strong>the</strong> shared object<br />

from <strong>the</strong> supplied source file ‘mod_csp.c’ choose Method 1 or Method 2 below. Method 1 is<br />

preferred.<br />

Use module mod_csp2.so for Apache Version 2.x.<br />

Before embarking on this configuration process, be sure to check that your build of Apache<br />

includes <strong>the</strong> built-in module for managing shared objects (mod_so). To perform this check,<br />

run <strong>the</strong> following comm<strong>and</strong> (this list <strong>the</strong> modules currently available within Apache):<br />

httpd -l<br />

The Shared Object module (mod_so) should appear in <strong>the</strong> list of modules displayed.<br />

A typical module listing (with mod_so included) is shown below:<br />

<strong>Installing</strong> <strong>and</strong> <strong>Configuring</strong> <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong> 43


Web Servers for UNIX, LINUX, <strong>and</strong> Mac OS X<br />

Compiled in modules:<br />

core.c<br />

mod_access.c<br />

mod_auth.c<br />

mod_include.c<br />

mod_log_config.c<br />

mod_env.c<br />

mod_setenvif.c<br />

prefork.c<br />

http_core.c<br />

mod_mime.c<br />

mod_status.c<br />

mod_autoindex.c<br />

mod_asis.c<br />

mod_cgi.c<br />

mod_negotiation.c<br />

mod_dir.c<br />

mod_imap.c<br />

mod_actions.c<br />

mod_userdir.c<br />

mod_alias.c<br />

mod_so.c<br />

If mod_so is not included in <strong>the</strong> list for your Apache installation, refer to your Apache documentation<br />

<strong>and</strong> follow <strong>the</strong> procedure for rebuilding Apache to include this module.<br />

Be sure to read <strong>the</strong> following instructions regarding <strong>the</strong> creation of shared objects in conjunction<br />

with <strong>the</strong> specific documentation contained within your Apache distribution. Note that<br />

<strong>the</strong> instructions given here assume that <strong>the</strong> root directory for <strong>the</strong> Apache installation is<br />

‘apache’. In practice, this directory name usually has <strong>the</strong> Apache version number appended<br />

to it.<br />

The module source file supplied (mod_csp.c) is fully compliant with both Apache v1.3.x <strong>and</strong><br />

Apache v2.x.<br />

3.2.2.1 Method 1: Building <strong>the</strong> <strong>CSP</strong> Module as a Shared Object Using <strong>the</strong> ‘apxs’<br />

(APache eXtenSion) Tool<br />

apxs –c mod_csp.c<br />

All being well, this builds <strong>the</strong> shared library ‘mod_csp.so’.<br />

In order to be consistent with <strong>the</strong> instructions in this document you may want to rename this<br />

module as mod_csp2.so for Apache Version 2.x. Alternatively, mod_csp2.so may be built<br />

directly as follows:<br />

apxs –c –o mod_csp2.so mod_csp.c<br />

Install <strong>the</strong> shared-object produced binary in <strong>the</strong> following directory:<br />

/usr/cachesys/csp/bin<br />

44 <strong>Installing</strong> <strong>and</strong> <strong>Configuring</strong> <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong>


3.2.2.2 Method 2: Building <strong>the</strong> <strong>CSP</strong> Module as a Shared Object Manually<br />

Install <strong>the</strong> module source file ‘mod_csp.c’ in <strong>the</strong> following directory:<br />

/usr/apache/src/modules/extra<br />

Return to <strong>the</strong> ‘src’ directory:<br />

/usr/apache/src<br />

Edit <strong>the</strong> file: ‘Configuration’.<br />

Near <strong>the</strong> end of this file you should find <strong>the</strong> line:<br />

# AddModule modules/example/mod_example.o<br />

After this line, add <strong>the</strong> following line:<br />

ShareModule modules/extra/mod_csp.so<br />

Configure <strong>the</strong> build process using <strong>the</strong> following comm<strong>and</strong>:<br />

./Configure<br />

Build <strong>the</strong> shared object using <strong>the</strong> following comm<strong>and</strong>:<br />

make<br />

This should produce <strong>the</strong> shared object ‘mod_csp.so’ in directory:<br />

/usr/apache/src/modules/extra<br />

In order to be consistent with <strong>the</strong> instructions in this document you may want to rename this<br />

module as mod_csp2.so for Apache Version 2.x.<br />

Copy mod_csp.so (or mod_csp2.so) to:<br />

/usr/cachesys/csp/bin<br />

3.2.2.3 Run-time Configuration<br />

Edit <strong>the</strong> Apache configuration file httpd.conf. For <strong>the</strong> st<strong>and</strong>ard Apache distribution, this file<br />

is in:<br />

/usr/apache/conf<br />

For Red Hat Linux, <strong>the</strong> run-time version of httpd.conf is in:<br />

/etc/httpd/conf<br />

Apache Servers<br />

<strong>Installing</strong> <strong>and</strong> <strong>Configuring</strong> <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong> 45


Web Servers for UNIX, LINUX, <strong>and</strong> Mac OS X<br />

Assuming that you wish to invoke <strong>the</strong> <strong>CSP</strong> engine for requested files containing <strong>the</strong> extension<br />

.csp <strong>and</strong> .cls, add <strong>the</strong> following section to <strong>the</strong> end of ‘httpd.conf’:<br />

LoadModule csp_module /usr/cachesys/csp/bin/mod_csp.so<br />

<br />

SetH<strong>and</strong>ler csp-h<strong>and</strong>ler<br />

<br />

Alias /csp/ /usr/cachesys/csp/<br />

<br />

AllowOverride None<br />

Options MultiViews FollowSymLinks ExecCGI<br />

Order allow,deny<br />

Allow from all<br />

<br />

Deny from all<br />

<br />

<br />

Deny from all<br />

<br />

<br />

ScriptAlias /csp-bin/ "/usr/cachesys/csp/bin/"<br />

<br />

AllowOverride None<br />

Options None<br />

Order allow,deny<br />

Allow from all<br />

<br />

Of course, if you are using Apache Version 2.x <strong>the</strong>n you should specify mod_csp2.so (instead<br />

of mod_csp.so) in <strong>the</strong> configuration block shown above.<br />

The above configuration block relies on <strong>the</strong> Regular Expressions (regex) processor being<br />

available to <strong>the</strong> Apache environment. Sometimes this is not <strong>the</strong> case <strong>and</strong> <strong>CSP</strong> files are consequently<br />

not served (‘File not found’ errors are returned). To remedy this situation, replace<br />

<strong>the</strong> following configuration block:<br />

<br />

SetH<strong>and</strong>ler csp-h<strong>and</strong>ler<br />

<br />

with:<br />

AddH<strong>and</strong>ler csp-h<strong>and</strong>ler csp cls<br />

Operating <strong>and</strong> Managing <strong>the</strong> <strong>Gateway</strong><br />

This connectivity option depends on <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong>’s Network Service Daemon (NSD).<br />

• Start <strong>the</strong> <strong>CSP</strong> NSD as described in <strong>the</strong> section dedicated to this service.<br />

• Apache must be (re)started after making changes to its configuration (httpd.conf).<br />

The order in which Apache <strong>and</strong> <strong>the</strong> NSD are started is unimportant.<br />

46 <strong>Installing</strong> <strong>and</strong> <strong>Configuring</strong> <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong>


Although <strong>CSP</strong> pages are served through <strong>the</strong> higher-performing module (mod_csp.so), <strong>the</strong><br />

<strong>Gateway</strong>’s management suite is accessed through <strong>the</strong> CGI module dedicated to this purpose<br />

(nph-<strong>CSP</strong>cgiSys).<br />

To access <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong>’s Systems Management suite, point your browser at:<br />

http:///csp-bin/nph-<strong>CSP</strong>cgiSys<br />

If you see an unauthorized user error message, refer to <strong>the</strong> security notes.<br />

The <strong>CSP</strong> engine is automatically invoked for requested files containing <strong>the</strong> .csp <strong>and</strong> .cls<br />

extension. For example:<br />

http:///csp/samples/menu.csp<br />

Apache Servers<br />

3.2.3 Option 2: Using <strong>the</strong> CGI Modules with <strong>the</strong> NSD (nph-<strong>CSP</strong>cgi*)<br />

The Web server should be configured such that it recognizes <strong>CSP</strong> requests (files of type .csp<br />

<strong>and</strong> .cls) <strong>and</strong> pass <strong>the</strong>m to <strong>the</strong> <strong>CSP</strong> gateway for processing.<br />

The Web server configuration file (httpd.conf) is found in <strong>the</strong> following directory:<br />

/usr/apache/conf<br />

For Red Hat Linux, <strong>the</strong> run-time version of ‘httpd.conf’ is found in:<br />

/etc/httpd/conf<br />

Add <strong>the</strong> following section to <strong>the</strong> end of httpd.conf:<br />

<strong>Installing</strong> <strong>and</strong> <strong>Configuring</strong> <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong> 47


Web Servers for UNIX, LINUX, <strong>and</strong> Mac OS X<br />

<br />

AllowOverride None<br />

Options FollowSymLinks ExecCGI<br />

Order allow,deny<br />

Allow from all<br />

<br />

ScriptAliasMatch /*\.([Cc][Ss][Pp]|[Cc][Ll][Ss])$ \<br />

"/usr/cachesys/csp/bin/nph-<strong>CSP</strong>cgi"<br />

Alias /csp/ /usr/cachesys/csp/<br />

<br />

AllowOverride None<br />

Options MultiViews FollowSymLinks ExecCGI<br />

Order allow,deny<br />

Allow from all<br />

<br />

Deny from all<br />

<br />

<br />

Deny from all<br />

<br />

<br />

ScriptAlias /csp-bin/ "/usr/cachesys/csp/bin/"<br />

<br />

AllowOverride None<br />

Options None<br />

Order allow,deny<br />

Allow from all<br />

<br />

The above configuration block relies on <strong>the</strong> Regular Expressions (regex) processor being<br />

available to <strong>the</strong> Apache environment. Sometimes this is not <strong>the</strong> case <strong>and</strong> <strong>CSP</strong> files are consequently<br />

not served (‘File not found’ errors are returned). To remedy this situation you can<br />

associate <strong>the</strong> (virtual) root location of your <strong>CSP</strong> applications with <strong>the</strong> CGI module instead<br />

of making <strong>the</strong> association through <strong>the</strong> <strong>CSP</strong> file extensions. For example, let’s say your <strong>CSP</strong><br />

applications are contained under location ‘/csp’. To associate <strong>the</strong> <strong>CSP</strong> CGI module with files<br />

under ‘/csp’, replace <strong>the</strong> following configuration blocks:<br />

<br />

AllowOverride None<br />

Options FollowSymLinks ExecCGI<br />

Order allow,deny<br />

Allow from all<br />

<br />

ScriptAliasMatch /*\.([Cc][Ss][Pp]|[Cc][Ll][Ss])$ \<br />

"/usr/cachesys/csp/bin/nph-<strong>CSP</strong>cgi"<br />

with:<br />

<br />

AllowOverride None<br />

Options FollowSymLinks ExecCGI<br />

Order allow,deny<br />

Allow from all<br />

<br />

ScriptAlias /csp "/usr/cachesys/csp/bin/nph-<strong>CSP</strong>cgi"<br />

These directives work for URLs of <strong>the</strong> form:<br />

http:///csp/*.csp<br />

48 <strong>Installing</strong> <strong>and</strong> <strong>Configuring</strong> <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong>


Duplicate <strong>the</strong> configuration block for o<strong>the</strong>r root Locations. For example, repeat <strong>the</strong> process<br />

for ‘/myapps’ for URLs of <strong>the</strong> form:<br />

http:///myapps/*.csp<br />

Apache Servers<br />

Ano<strong>the</strong>r approach to avoiding <strong>the</strong> ‘regex’ issue is to use an ‘Action’ directive in conjunction<br />

with a <strong>CSP</strong> MIME type. However, it should be noted that ‘Action’ is essentially a content<br />

filtering technique <strong>and</strong>, as such, requires that your <strong>CSP</strong> files are physically present on <strong>the</strong><br />

Web server host even if <strong>the</strong> Caché server is installed on a separate computer. If you wish to<br />

use this approach, first add a new MIME type to <strong>the</strong> end of <strong>the</strong> Apache mime.types file <strong>and</strong><br />

associate it with file types representing <strong>CSP</strong> content. The mime.types file are found in <strong>the</strong><br />

same directory as <strong>the</strong> httpd.conf file.<br />

text/csp<br />

csp cls<br />

Now, add <strong>the</strong> ‘Action’ directive to <strong>the</strong> end of <strong>the</strong> CGI configuration block in httpd.conf such<br />

that it reads:<br />

Alias /csp/ /usr/cachesys/csp/<br />

<br />

AllowOverride None<br />

Options MultiViews FollowSymLinks ExecCGI<br />

Order allow,deny<br />

Allow from all<br />

<br />

Deny from all<br />

<br />

<br />

Deny from all<br />

<br />

<br />

Deny from all<br />

<br />

<br />

Deny from all<br />

<br />

<br />

Deny from all<br />

<br />

<br />

ScriptAlias /csp-bin/ "/usr/cachesys/csp/bin/"<br />

<br />

AllowOverride None<br />

Options None<br />

Order allow,deny<br />

Allow from all<br />

<br />

Action text/csp “/csp-bin/nph-<strong>CSP</strong>cgi”<br />

Finally, note that because CGI is an open st<strong>and</strong>ard, The <strong>CSP</strong> CGI modules work with any<br />

Web server.<br />

<strong>Installing</strong> <strong>and</strong> <strong>Configuring</strong> <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong> 49


Web Servers for UNIX, LINUX, <strong>and</strong> Mac OS X<br />

3.2.3.1 Operating <strong>and</strong> Managing <strong>the</strong> <strong>Gateway</strong><br />

This connectivity option depends on <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong>’s Network Service Daemon (NSD).<br />

• Start <strong>the</strong> <strong>CSP</strong> NSD as described in <strong>the</strong> section dedicated to this service.<br />

• Apache must be (re)started after making changes to its configuration (httpd.conf).<br />

The order in which Apache <strong>and</strong> <strong>the</strong> NSD are started is unimportant.<br />

To access <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong>’s Systems Management suite, point your browser at:<br />

http:///csp-bin/nph-<strong>CSP</strong>cgiSys<br />

If you see an unauthorized user error message, refer to <strong>the</strong> security notes.<br />

The <strong>CSP</strong> engine is automatically invoked for requested files containing <strong>the</strong> .csp <strong>and</strong> .cls<br />

extension. For example:<br />

http:///csp/samples/menu.csp<br />

3.2.4 Option 3: Using a Built-in Apache API Module with <strong>the</strong> NSD<br />

(mod_csp.c)<br />

Be sure to read <strong>the</strong>se instructions in conjunction with <strong>the</strong> specific documentation contained<br />

within your Apache distribution. Note that <strong>the</strong> instructions given here assume that <strong>the</strong> root<br />

directory for <strong>the</strong> Apache installation is ‘apache’. In practice, this directory name usually has<br />

<strong>the</strong> apache version number appended to it.<br />

3.2.4.1 Adding <strong>the</strong> <strong>CSP</strong> Module Source Code to <strong>the</strong> Apache Source Directory<br />

The code for user-defined modules resides under <strong>the</strong> following directory:<br />

/usr/apache/src/modules<br />

Create <strong>the</strong> following directory for <strong>the</strong> <strong>CSP</strong> module:<br />

/usr/apache/src/modules/csp<br />

While in <strong>the</strong> ‘/usr/apache/src/modules’ directory type<br />

mkdir csp<br />

Copy <strong>the</strong> source for <strong>the</strong> <strong>CSP</strong> module (mod_csp.c) into this directory. You should now have:<br />

/usr/apache/src/modules/csp/mod_csp.c<br />

50 <strong>Installing</strong> <strong>and</strong> <strong>Configuring</strong> <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong>


Apache Servers<br />

3.2.4.2 Creating a ‘Makefile’ for <strong>the</strong> <strong>CSP</strong> Module<br />

The next task is to create a ‘Makefile’. The Makefile contains instructions on how <strong>the</strong> <strong>CSP</strong><br />

module should be compiled <strong>and</strong> linked. Apache always provides an example module – make<br />

a copy of <strong>the</strong> example’s Makefile <strong>and</strong> modify it for <strong>CSP</strong>.<br />

Make sure you are in <strong>the</strong> ‘csp’ directory:<br />

/usr/apache/src/modules/csp<br />

Copy <strong>the</strong> example Makefile by typing:<br />

cp ../example/Makefile* ./<br />

Depending on <strong>the</strong> version of Apache you have, one of <strong>the</strong> following files will be in <strong>the</strong> ‘<strong>CSP</strong>’<br />

directory:<br />

• Makefile — Apache 1.2.x series.<br />

• Makefile.tmpl — Makefile template, Apache 1.3.x series.<br />

Edit whichever file you have <strong>and</strong> replace all references to ‘mod_example’ with ‘mod_csp’.<br />

3.2.4.3 <strong>Configuring</strong> <strong>the</strong> Apache Build Process to Recognize <strong>the</strong> <strong>CSP</strong> Module<br />

1. Return to <strong>the</strong> ‘src’ directory:<br />

/usr/apache/src<br />

2. Edit <strong>the</strong> file: ‘Configuration’.<br />

• For Apache 1.2.x:<br />

Near <strong>the</strong> end of this file you should find <strong>the</strong> line:<br />

# Module example_module modules/example/mod_example.o<br />

After this line, add <strong>the</strong> following line:<br />

Module <strong>CSP</strong>_module modules/csp/mod_csp.o<br />

• For Apache 1.3.x:<br />

Near <strong>the</strong> end of this file you should find <strong>the</strong> line:<br />

# AddModule modules/example/mod_example.o<br />

After this line, add <strong>the</strong> following line:<br />

AddModule modules/csp/mod_csp.o<br />

<strong>Installing</strong> <strong>and</strong> <strong>Configuring</strong> <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong> 51


Web Servers for UNIX, LINUX, <strong>and</strong> Mac OS X<br />

3.2.4.4 Run <strong>the</strong> ‘Configure’ Script to Build <strong>the</strong> Main ‘Makefile’<br />

We can now configure <strong>the</strong> build process. Make sure you are in <strong>the</strong> ‘src’ directory:<br />

/usr/apache/src<br />

Enter <strong>the</strong> following comm<strong>and</strong>:<br />

./Configure<br />

3.2.4.5 Before Building Apache – A Special Note for Users of Red Hat Linux<br />

Red Hat Linux is distributed with a pre-built version of Apache. If you install Apache as part<br />

of <strong>the</strong> Linux installation procedure, Apache is automatically started when Linux is booted.<br />

The layout of <strong>the</strong> run-time file system for this pre-built version is slightly different to that<br />

which is prescribed as <strong>the</strong> default layout in <strong>the</strong> Apache source code. In order to account for<br />

this, <strong>the</strong> following change should be made to <strong>the</strong> Apache C header file ‘httpd.h’:<br />

For Apache 1.2.x:<br />

/usr/apache/src/httpd.h<br />

For Apache 1.3.x:<br />

/usr/apache/src/include/httpd.h<br />

The Web server root (HTTPD_ROOT) is one of <strong>the</strong> first items defined in this file. For Red<br />

Hat Linux this symbol should be defined as follows:<br />

#define HTTPD_ROOT “/etc/httpd”<br />

3.2.4.6 Build <strong>the</strong> Apache Executable<br />

Next, build <strong>the</strong> Apache executable. Make sure you are in <strong>the</strong> ‘src’ directory:<br />

/usr/apache/src<br />

Enter <strong>the</strong> following comm<strong>and</strong>:<br />

make<br />

This should produce a new Web server executable (httpd) with <strong>the</strong> <strong>CSP</strong> module’s functionality<br />

built-in.<br />

Run <strong>the</strong> following comm<strong>and</strong> to check that <strong>the</strong> <strong>CSP</strong> module has been successfully included<br />

in <strong>the</strong> Apache core (this comm<strong>and</strong> lists all modules currently built into Apache):<br />

./httpd -l<br />

52 <strong>Installing</strong> <strong>and</strong> <strong>Configuring</strong> <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong>


Apache Servers<br />

For example:<br />

Compiled in modules:<br />

core.c<br />

mod_access.c<br />

mod_auth.c<br />

mod_include.c<br />

mod_log_config.c<br />

mod_env.c<br />

mod_setenvif.c<br />

prefork.c<br />

http_core.c<br />

mod_mime.c<br />

mod_status.c<br />

mod_autoindex.c<br />

mod_asis.c<br />

mod_cgi.c<br />

mod_negotiation.c<br />

mod_dir.c<br />

mod_imap.c<br />

mod_actions.c<br />

mod_userdir.c<br />

mod_alias.c<br />

mod_csp.c<br />

The httpd executable is created in <strong>the</strong> ‘src’ directory. For normal operation, copy this to <strong>the</strong><br />

‘apache’ directory (<strong>and</strong> run it <strong>the</strong>re).<br />

For Red Hat Linux, <strong>the</strong> executable ‘httpd’ should be copied to:<br />

/usr/sbin<br />

Be sure to backup <strong>the</strong> existing copy first.<br />

3.2.4.7 Run-time Configuration<br />

Edit <strong>the</strong> Apache configuration file ‘httpd.conf’. For <strong>the</strong> st<strong>and</strong>ard Apache distribution this file<br />

is in:<br />

/usr/apache/conf<br />

For Red Hat Linux, <strong>the</strong> run-time version of ‘httpd.conf’ is in:<br />

/etc/httpd/conf<br />

Assuming that you wish to invoke <strong>the</strong> <strong>CSP</strong> engine for requested files containing <strong>the</strong> extension<br />

.csp <strong>and</strong> .cls, add <strong>the</strong> following section to <strong>the</strong> end of ‘httpd.conf’:<br />

<strong>Installing</strong> <strong>and</strong> <strong>Configuring</strong> <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong> 53


Web Servers for UNIX, LINUX, <strong>and</strong> Mac OS X<br />

<br />

SetH<strong>and</strong>ler csp-h<strong>and</strong>ler<br />

<br />

Alias /csp/ /usr/cachesys/csp/<br />

<br />

AllowOverride None<br />

Options MultiViews FollowSymLinks ExecCGI<br />

Order allow,deny<br />

Allow from all<br />

<br />

Deny from all<br />

<br />

<br />

Deny from all<br />

<br />

<br />

ScriptAlias /csp-bin/ "/usr/cachesys/csp/bin/"<br />

<br />

AllowOverride None<br />

Options None<br />

Order allow,deny<br />

Allow from all<br />

<br />

The above configuration block relies on <strong>the</strong> Regular Expressions (regex) processor being<br />

available to <strong>the</strong> Apache environment. Sometimes this is not <strong>the</strong> case <strong>and</strong> <strong>CSP</strong> files are consequently<br />

not served (‘File not found’ errors are returned). To remedy this situation, replace<br />

<strong>the</strong> following configuration block:<br />

<br />

SetH<strong>and</strong>ler csp-h<strong>and</strong>ler<br />

<br />

with:<br />

AddH<strong>and</strong>ler csp-h<strong>and</strong>ler<br />

Note that all requests to Apache are serviced by a set of modules invoked in a pre-defined<br />

sequence. The <strong>CSP</strong> module is one of <strong>the</strong> first modules invoked, provided its definition was<br />

added near <strong>the</strong> end of <strong>the</strong> 'Configuration' file as suggested.<br />

3.2.4.8 Operating <strong>and</strong> Managing <strong>the</strong> <strong>Gateway</strong><br />

This connectivity option depends on <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong>’s Network Service Daemon (NSD).<br />

• Start <strong>the</strong> <strong>CSP</strong> NSD as described in <strong>the</strong> section dedicated to this service.<br />

• Apache must be (re)started after making changes to its configuration (httpd.conf).<br />

The order in which Apache <strong>and</strong> <strong>the</strong> NSD are started is unimportant.<br />

Although <strong>CSP</strong> pages are served through <strong>the</strong> higher-performing built-in module (mod_csp.c),<br />

<strong>the</strong> <strong>Gateway</strong>’s management suite is accessed through <strong>the</strong> CGI module dedicated to this purpose<br />

(nph-<strong>CSP</strong>cgiSys).<br />

54 <strong>Installing</strong> <strong>and</strong> <strong>Configuring</strong> <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong>


To access <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong>’s Systems Management suite, point your browser at:<br />

http:///csp-bin/nph-<strong>CSP</strong>cgiSys<br />

If you see an unauthorized user error message, refer to <strong>the</strong> security notes.<br />

The <strong>CSP</strong> engine is automatically invoked for requested files containing <strong>the</strong> .csp <strong>and</strong> .cls<br />

extension. For example:<br />

http:///csp/samples/menu.csp<br />

Operating <strong>the</strong> Network Service Daemon (NSD)<br />

3.3 Operating <strong>the</strong> Network Service Daemon<br />

(NSD)<br />

First, change to <strong>the</strong> following directory:<br />

/usr/cachesys/csp<br />

Use <strong>the</strong> following comm<strong>and</strong> to start <strong>the</strong> NSD:<br />

./<strong>CSP</strong>nsd<br />

Before retiring to <strong>the</strong> background, <strong>the</strong> NSD displays a banner indicating its running configuration.<br />

It shows <strong>the</strong> TCP port number dedicated to this service, which is, by default, port<br />

number 7038. You can override this by starting <strong>the</strong> service as follows:<br />

./<strong>CSP</strong>nsd <br />

where port_no is <strong>the</strong> TCP port number of your choice.<br />

You can suppress all startup messages for this comm<strong>and</strong> using <strong>the</strong> ‘-s’ qualifier. For example,<br />

if you wish to ‘silently’ start <strong>the</strong> NSD from a script invoked when <strong>the</strong> system is booted use:<br />

/usr/cachesys/csp/<strong>CSP</strong>nsd –s [port_no]<br />

Use <strong>the</strong> following comm<strong>and</strong> to close down <strong>the</strong> NSD:<br />

./<strong>CSP</strong>nsd -stop<br />

Alternatively:<br />

kill –TERM `cat /usr/cachesys/csp/<strong>CSP</strong>nsd.pid`<br />

<strong>Installing</strong> <strong>and</strong> <strong>Configuring</strong> <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong> 55


Web Servers for UNIX, LINUX, <strong>and</strong> Mac OS X<br />

These comm<strong>and</strong>s close down <strong>the</strong> NSD in an orderly manner – it gracefully terminates all<br />

open connections to Caché <strong>and</strong> releases all its system resources before terminating. Do not<br />

use <strong>the</strong> ‘kill –9’ comm<strong>and</strong> to terminate <strong>the</strong> NSD.<br />

All errors are reported in <strong>the</strong> Event Log (‘<strong>CSP</strong>.log’). This file is created <strong>and</strong> maintained in<br />

<strong>the</strong> ‘/usr/cachesys/csp’ directory. The configuration file ‘<strong>CSP</strong>.ini’ also resides in this directory.<br />

The NSD also creates <strong>the</strong> following file:<br />

/usr/cachesys/csp/<strong>CSP</strong>nsd.ini<br />

This file is extremely important because it tells <strong>the</strong> ‘clients’ how to communicate with <strong>the</strong><br />

NSD. In this context, <strong>the</strong> ‘clients’ are <strong>the</strong> <strong>CSP</strong> module contained within, or dynamically<br />

linked to, Apache <strong>and</strong> <strong>the</strong> <strong>CSP</strong> CGI modules invoked by Apache. It is, <strong>the</strong>refore, essential<br />

that this file is not deleted or moved. It is also important that <strong>the</strong> Apache processes can read<br />

this file. Set <strong>the</strong> privileges accordingly, bearing in mind <strong>the</strong> UNIX user under which your<br />

Apache server is operating.<br />

56 <strong>Installing</strong> <strong>and</strong> <strong>Configuring</strong> <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong>


4<br />

General Web Server Configuration<br />

Issues<br />

4.1 A Note on <strong>the</strong> CGI Modules Supplied<br />

Typically, most <strong>CSP</strong> installations take advantage of <strong>the</strong> high-performing proprietary APIs<br />

that are supported by <strong>the</strong> hosting Web server. However, some connectivity options involve<br />

<strong>the</strong> use of small CGI executable, at least, for <strong>the</strong> purpose of running <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong>’s<br />

systems management suite. The notes in this section apply to all Operating System <strong>and</strong> Web<br />

Server combinations.<br />

Note that two series of CGI modules are supplied – those prefixed with ‘nph-‘ <strong>and</strong> those that<br />

are not. These modules are, in fact, <strong>the</strong> same, irrespective of whe<strong>the</strong>r or not <strong>the</strong>y have <strong>the</strong><br />

‘nph-‘ prefix. The ‘nph’ prefix is <strong>the</strong> CGI convention for instructing <strong>the</strong> Web server not to<br />

parse <strong>the</strong> HTTP headers (that is, non-parsed-headers). The Web server simply forwards your<br />

headers on to <strong>the</strong> browser. In <strong>the</strong> context of a URL, <strong>the</strong> ‘nph-‘ prefix must always be expressed<br />

in lower-case.<br />

<strong>CSP</strong> <strong>and</strong> <strong>CSP</strong>-based applications usually assume <strong>the</strong> responsibility for sending a full HTTP<br />

header. Under CGI, <strong>the</strong> first line of <strong>the</strong> header (<strong>the</strong> request status line) has traditionally been<br />

<strong>the</strong> responsibility of <strong>the</strong> server-side of <strong>the</strong> CGI interface. Some Web servers are strict about<br />

this – Apache is one such example. Apache expects <strong>the</strong> first header line sent by your application<br />

to be <strong>the</strong> ‘Content-type’ line <strong>and</strong> not <strong>the</strong> request status line (such as HTTP/1.1 200 OK)<br />

– it returns an error if it parses <strong>the</strong> header <strong>and</strong> doesn’t detect a ‘Content-type’ line first. Using<br />

<strong>the</strong> ‘nph’ version of <strong>the</strong> CGI module alleviates this problem. Not all Web servers are so strict<br />

<strong>Installing</strong> <strong>and</strong> <strong>Configuring</strong> <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong> 57


General Web Server Configuration Issues<br />

about this convention. For example, Microsoft’s Web servers do not object to receiving a full<br />

HTTP header from a CGI executable not prefixed with ‘nph’ (for example: <strong>CSP</strong>cgi.exe).<br />

4.2 Security Issues in Accessing <strong>the</strong> <strong>Gateway</strong>’s<br />

Systems Management<br />

By default, only clients local to <strong>the</strong> <strong>Gateway</strong>’s hosting computer are allowed access to <strong>the</strong><br />

Systems Management suite. For example:<br />

http://localhost/csp/bin/<strong>CSP</strong>msSys.dll<br />

or:<br />

http://127.0.0.1/csp/bin/<strong>CSP</strong>msSys.dll<br />

This effectively means that <strong>the</strong> browser through which <strong>the</strong> administration forms are accessed<br />

must be running on <strong>the</strong> same machine as <strong>the</strong> Web server <strong>and</strong> <strong>CSP</strong> <strong>Gateway</strong>.<br />

You can add additional clients to <strong>the</strong> list of authorized administrators by adding <strong>the</strong> client IP<br />

addresses to <strong>the</strong> System_Manager parameter in <strong>CSP</strong>.ini. This parameter is held in <strong>the</strong> SYSTEM<br />

section. For example:<br />

[SYSTEM]<br />

System_Manager=190.8.7.6,190.8.7.5,190.8.7.4<br />

This parameter represents a comma (or ‘+’) separated list of clients (by IP address) who may<br />

access <strong>the</strong> <strong>Gateway</strong>'s system management <strong>and</strong> configuration forms. The directive shown<br />

above would grant access to three remote clients in addition to <strong>the</strong> default local access.<br />

For new <strong>Gateway</strong> installations, for which <strong>the</strong>re is no local browser available, it is necessary<br />

to manually create this configuration setting.<br />

The System_Manager parameter is equivalent to <strong>the</strong> Systems Manager Machines setting<br />

which is found under <strong>the</strong> default parameters section of <strong>the</strong> <strong>Gateway</strong>’s management suite.<br />

<strong>Gateway</strong> Build 662.698 (<strong>and</strong> higher) allows wildcard <strong>and</strong> numeric ranges to be specified in<br />

<strong>the</strong> entries for <strong>the</strong> Systems Manager Machines parameter.<br />

For example:<br />

[SYSTEM]<br />

System_Manager=190.8.7.4-6<br />

58 <strong>Installing</strong> <strong>and</strong> <strong>Configuring</strong> <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong>


This indicates that <strong>the</strong> last part of <strong>the</strong> IP address can take <strong>the</strong> value of a number between 4<br />

<strong>and</strong> 6 inclusive. In o<strong>the</strong>r words, it is a more convenient way of writing:<br />

[SYSTEM]<br />

System_Manager=190.8.7.6,190.8.7.5,190.8.7.4<br />

Wildcards can also be used. For example:<br />

[SYSTEM]<br />

System_Manager=190.8.7.*<br />

The following directive grants access to all clients:<br />

[SYSTEM]<br />

System_Manager=*.*.*.*<br />

Making a <strong>CSP</strong> Page <strong>the</strong> Default Page (or ‘Homepage’) for <strong>the</strong> Web Server<br />

However, it is not recommended that such a directive be used on operational systems.<br />

It should be recognized that <strong>the</strong>re are shortcomings in using this scheme as a way of protecting<br />

<strong>the</strong> <strong>Gateway</strong>'s management suite.<br />

• This scheme is not able to provide strong security. For <strong>the</strong> purpose of checking Web<br />

clients, <strong>the</strong> IP address of a client is obtained from <strong>the</strong> CGI environment variable<br />

REMOTE_ADDR. Client IP addresses can be spoofed.<br />

• The use of a proxy between <strong>the</strong> client <strong>and</strong> <strong>the</strong> Web server/gateway installation effectively<br />

translates all client IP addresses to that of <strong>the</strong> proxy. In this scenario you would have to<br />

ei<strong>the</strong>r specify <strong>the</strong> proxy's IP address as a <strong>Gateway</strong> Systems Manager (which would<br />

effectively grant access to all Web users coming in through <strong>the</strong> proxy) or, preferably,<br />

enable <strong>the</strong> designated systems managers to bypass <strong>the</strong> proxy layer altoge<strong>the</strong>r.<br />

The IP-based scheme, while useful as a first line of defense, should not be relied upon as <strong>the</strong><br />

sole means through which access to <strong>the</strong> <strong>Gateway</strong> management suite is controlled – certainly<br />

not for <strong>CSP</strong> installations that are available over <strong>the</strong> Internet. For production systems it is<br />

recommended that <strong>the</strong> hosting Web server's configuration controls access to <strong>the</strong> <strong>Gateway</strong>'s<br />

systems management modules.<br />

4.3 Making a <strong>CSP</strong> Page <strong>the</strong> Default Page (or<br />

‘Homepage’) for <strong>the</strong> Web Server<br />

This section describes <strong>the</strong> configuration changes that are necessary to allow a <strong>CSP</strong> page to<br />

be served as <strong>the</strong> Web server’s default page (or homepage). As an example, <strong>the</strong> procedure for<br />

<strong>Installing</strong> <strong>and</strong> <strong>Configuring</strong> <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong> 59


General Web Server Configuration Issues<br />

making <strong>the</strong> <strong>CSP</strong> samples menu (/csp/samples/menu.csp) <strong>the</strong> server’s default page is outlined.<br />

The Web server’s default page is accessed via:<br />

http:///<br />

When a <strong>CSP</strong> page is served in this way it should be noted that embedded URLs must be<br />

specified in full. If relative URLs are used for embedded hyperlinks, <strong>the</strong> browser interprets<br />

<strong>the</strong>se as relative to <strong>the</strong> documentation root directory <strong>and</strong> not <strong>the</strong> <strong>CSP</strong> root. For example, taking<br />

our samples menu as <strong>the</strong> homepage, <strong>the</strong> URL to, say, <strong>the</strong> inspector option should be:<br />

http:///csp/samples/inspector.csp<br />

If relative URLs are used, <strong>the</strong>n <strong>the</strong> browser incorrectly interprets this link as:<br />

http:///inspector.csp<br />

4.3.1 Peer Web Server<br />

1. Open <strong>the</strong> Internet Service Manager window.<br />

2. Double-click on <strong>the</strong> WWW Service to bring up <strong>the</strong> WWW Service Properties window.<br />

3. Click on <strong>the</strong> Directories tab.<br />

4. Replace <strong>the</strong> Default Document with /csp/samples/menu.csp.<br />

5. Ensure that <strong>the</strong> Enable Default Document checkbox is ticked.<br />

6. Save <strong>and</strong> Apply all changes.<br />

7. The new default page (/csp/samples/menu.csp) must physically exist relative to <strong>the</strong> Web<br />

server’s documentation root directory. It is only necessary to create an empty file. For<br />

example, if your document’s root is c:\inetpub\wwwroot proceed as follows:<br />

cd c:\inetpub\wwwroot<br />

md csp<br />

cd csp<br />

md samples<br />

cd samples<br />

copy con menu.csp<br />

^Z<br />

4.3.2 Internet Information Services<br />

1. Open <strong>the</strong> Internet Services Manager window.<br />

2. In <strong>the</strong> left-h<strong>and</strong> window, navigate to <strong>the</strong> Default Web Site.<br />

60 <strong>Installing</strong> <strong>and</strong> <strong>Configuring</strong> <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong>


3. Right-click on <strong>the</strong> Default Web Site. Select Properties from <strong>the</strong> menu to bring up <strong>the</strong><br />

Default Web Site Properties window.<br />

4. Click on <strong>the</strong> Directory tab.<br />

5. Click <strong>the</strong> Add button to bring up <strong>the</strong> Add Default Document Name window.<br />

6. Enter <strong>the</strong> document name (/csp/samples/menu.csp) for <strong>the</strong> Default Document Name window.<br />

7. Click on <strong>the</strong> OK button.<br />

8. Ensure that <strong>the</strong> Enable Default Document checkbox is ticked.<br />

9. In <strong>the</strong> Directories tab, use <strong>the</strong> arrow keys to move <strong>the</strong> new default document (/csp/samples/menu.csp<br />

) to <strong>the</strong> top of <strong>the</strong> list.<br />

10. Click Apply <strong>and</strong> OK to save <strong>and</strong> activate all changes.<br />

11. The new default page (/csp/samples/menu.csp) must physically exist relative to <strong>the</strong> Web<br />

server’s documentation root directory. It is only necessary to create an empty file. For<br />

example, if your document’s root is c:\inetpub\wwwroot proceed as follows:<br />

cd c:\inetpub\wwwroot<br />

md csp<br />

cd csp<br />

md samples<br />

cd samples<br />

copy con menu.csp<br />

^Z<br />

Making a <strong>CSP</strong> Page <strong>the</strong> Default Page (or ‘Homepage’) for <strong>the</strong> Web Server<br />

4.3.3 Netscape, iPlanet, <strong>and</strong> Sun Web Servers<br />

The procedure described in this section is only available with <strong>Gateway</strong> build 663.763 (<strong>and</strong><br />

later).<br />

The following directive specifies <strong>the</strong> homepage for a Netscape server in <strong>the</strong> default section<br />

of obj.conf:<br />

NameTrans fn="home-page" path="/csp/samples/menu.csp"<br />

This directive, however, does not result in <strong>the</strong> <strong>CSP</strong> form menu.csp becoming <strong>the</strong> home page<br />

for <strong>the</strong> server. The reason for this is that <strong>the</strong> server does not update <strong>the</strong> environment variables<br />

relating to <strong>the</strong> page requested before transferring control to <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong>. The <strong>Gateway</strong><br />

sees <strong>the</strong> incoming request as a request for / instead of /csp/samples/menu.csp. Netscape-based<br />

servers expect NSAPI extensions to accept <strong>the</strong> responsibility for recognizing this scenario<br />

<strong>and</strong> update <strong>the</strong> variables identifying <strong>the</strong> page requested <strong>and</strong> its path accordingly. You can<br />

work around this behavior as follows:<br />

<strong>Installing</strong> <strong>and</strong> <strong>Configuring</strong> <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong> 61


General Web Server Configuration Issues<br />

• Define <strong>the</strong> <strong>CSP</strong> homepage in <strong>the</strong> default section of obj.conf:<br />

NameTrans fn="home-page" path="/csp/samples/menu.csp"<br />

• The section that describes <strong>the</strong> mapping between <strong>CSP</strong> files <strong>and</strong> <strong>the</strong> <strong>Gateway</strong> modules must<br />

be modified to include <strong>the</strong> home-page-path directive as follows:<br />

<br />

Service method=(GET|HEAD|POST) fn=csp_req \<br />

home-page-path="/usr/cachesys/csp/samples"<br />

<br />

<br />

Service method=(GET|HEAD|POST) fn=csp_req \<br />

home-page-path="/usr/cachesys/csp/samples"<br />

<br />

<br />

Service method=(GET|HEAD|POST) fn=csp_req_sys<br />

<br />

<br />

Service method=(GET|HEAD|POST) fn=csp_req<br />

<br />

It is not entirely necessary to specify <strong>the</strong> path to <strong>the</strong> home page in <strong>the</strong> home-page-path property<br />

within <strong>the</strong> Service directive, but if you do, it results in <strong>the</strong> PATH_TRANSLATED environment<br />

variable taking <strong>the</strong> value that it would have done had /csp/samples/menu.csp been requested<br />

directly. In o<strong>the</strong>r words, PATH_TRANSLATED for <strong>the</strong> home-page (/) is returned as:<br />

/cachesys/csp/samples/inspector.csp<br />

instead of:<br />

/csp/samples/inspector.csp<br />

4.4 Apache Servers<br />

Find <strong>the</strong> DirectoryIndex directive in <strong>the</strong> Apache configuration file. For example:<br />

DirectoryIndex index.html index.html.var<br />

Add <strong>the</strong> new default page for <strong>the</strong> Web server at <strong>the</strong> head of <strong>the</strong> list:<br />

DirectoryIndex /csp/samples/menu.csp index.html index.html.var<br />

62 <strong>Installing</strong> <strong>and</strong> <strong>Configuring</strong> <strong>the</strong> <strong>CSP</strong> <strong>Gateway</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!