30.01.2015 Views

CSP Gateway Configuration Guide - InterSystems Documentation

CSP Gateway Configuration Guide - InterSystems Documentation

CSP Gateway Configuration Guide - InterSystems Documentation

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

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

On startup, the NSD creates the following file:<br />

<strong>CSP</strong>nsd.ini<br />

Typically, this file contains the following lines:<br />

[SYSTEM]<br />

Ip_Address=127.0.0.1<br />

TCP_Port=7038<br />

In this context, the clients are the <strong>CSP</strong> modules contained within, or dynamically linked to, the Web server and/or the <strong>CSP</strong><br />

CGI modules invoked by the server. It is, therefore, essential that this file is not deleted or moved. It is also important that<br />

the Web server processes can read this file. Set the privileges accordingly, bearing in mind the Windows user under which<br />

your Web server is operating. The NSD clients attempt to find this file in a location contained within the Windows PATH<br />

variable. For example:<br />

\Windows<br />

The <strong>CSP</strong>nsd.ini file must be moved to this location before starting the Web server<br />

Clearly, storing the NSD port number in the <strong>CSP</strong>nsd.ini file is inappropriate for situations in which multiple instances of<br />

the NSD are running. For Apache servers, there is a much better mechanism for communicating the TCP port number of<br />

the NSD to its clients.<br />

Set the following environment variables in the Apache configuration to indicate the address and port of the target NSD<br />

installation. The values specified in these environment variables take precedence over any values found in the <strong>CSP</strong>nsd.ini<br />

file.<br />

<strong>CSP</strong>_NSD_NAME — This is the IP address of the NSD. Only use this parameter if the NSD is operating on a remote computer.<br />

<strong>CSP</strong>_NSD_PORT — This is the TCP port of the NSD.<br />

Example 1:<br />

Distribute the load for two Apache virtual hosts (say, 123.123.1.1 and 123.123.1.2) between two independent NSD installations<br />

(listening on TCP port 7038 and 7039).<br />

Add the following directives to the Apache configuration (httpd.conf):<br />

<br />

ServerName 123.123.1.1<br />

SetEnv MGW_NSD_PORT 7038<br />

<br />

<br />

ServerName 123.123.1.2<br />

SetEnv MGW_NSD_PORT 7039<br />

<br />

Example 2:<br />

Distribute the load for two <strong>CSP</strong> applications (say, /csp1 and /csp2) between two independent NSD installations (listening<br />

on TCP port 7038 and 7039).<br />

1. Add the following directives to the Apache configuration (httpd.conf):<br />

<br />

SetEnv MGW_NSD_PORT 7038<br />

<br />

<br />

SetEnv MGW_NSD_PORT 7039<br />

<br />

2. Restart Apache after making changes to its configuration.<br />

In cases where multiple instances of the NSD are running, it is recommended that the separate instances be installed in<br />

separate directories, each maintaining its own copy of the configuration and log files (<strong>CSP</strong>.ini and <strong>CSP</strong>.log). The <strong>CSP</strong> Web<br />

<strong>Gateway</strong> Management page for each instance can easily be accessed by using the NSD internal HTTP server. For example:<br />

<strong>CSP</strong> <strong>Gateway</strong> <strong>Configuration</strong> <strong>Guide</strong> 101

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!