If the CSP module is supplied with your distribution as an OpenVMS shareable image (MOD_CSP.EXE), this provides a better-performing solution than the CGI-based solution described elsewhere. Use shareable image MOD_CSP22.EXE for SWS/Apache Version 2.2 and later.
Configure the web server so that it recognizes CSP requests (files of type .csp, .cls, and .zen) and passes them to the CSP Gateway for processing.
Note: Note for OpenVMS Clusters All of the web server's files reside under its root directories pointed to by the
APACHE$ROOT logical name. During installation, file protection is set to (S:RWED, O:RWED, G, W). During configuration, all files are set to be owned by the APACHE$WWW account. The APACHE$ROOT logical name is used for the examples in this section. For multi-server clustered environments it may be more appropriate to use the APACHE$COMMON logical name since this defines cluster-wide files in APACHE$ROOT. For single-server installations, these two OpenVMS logicals are equivalent.
The web server configuration file (HTTPD.CONF) is found in the following directory:
APACHE$ROOT:[CONF]
Add the following section to the end of HTTPD.CONF.
LoadModule csp_module /apache$root/csp/bin/mod_csp22.exe CSPFileTypes csp cls zen
<LocationMatch "/*\.([Cc][Ss][Pp]|[Cc][Ll][Ss]|[Zz][En][Nn])$"> AllowOverride None
Options FollowSymLinks ExecCGI Order allow,deny
Allow from all </LocationMatch>
Alias /csp/ /apache$root/csp/ <Directory "/apache$root/csp"> AllowOverride None
Options MultiViews FollowSymLinks ExecCGI Order allow,deny
Allow from all
<FilesMatch "\.(log|ini|pid|exe)$"> Deny from all
</FilesMatch> </Directory>
ScriptAliasMatch /csp/bin/Systems/Module.cxw "/apache$root/csp/bin/nph-CSPcgiSys" ScriptAliasMatch /csp/bin/RunTime/Module.cxw "/apache$root/csp/bin/nph-CSPcgi" ScriptAlias /csp-bin/ "/apache$root/csp/bin/"
<Directory "/apache$root/csp/bin/"> AllowOverride None
Options None Order allow,deny Allow from all </Directory>
Restart SWS/Apache after making these changes to the configuration file.
4.2.1 Registering Additional File Types with CSP
Apache API modules always recognize the following reserved file extensions: .csp .cls .zen .cxw
You may have other files that you want to send to CSP for processing. For example, if you need to serve other static files through the CSP Gateway or need to access the Management Portal through this web server, add mappings for file types
You can configure Apache to recognize what files to pass on to CSP in any of the following ways:
• By CSP location directive
• By file extension—CSPFileTypes directive
• By MIME type By CSPlocation directive
Use the CSP directive to request that all files within a certain location be processed by CSP. The following requests that all files and directories under the /csp path be processed by CSP.
<Location /csp> CSP On
SetHandler csp-handler </Location>
For example, all the following would be sent to CSP for processing: /csp/
csp/samples/menu.csp csp/sys/
By file extension — CSPFileTypes directive
The CSPFileTypes directive works for requests for files that have extensions (such /csp/menu.csp). It does not work for requests for files that do not have file extensions (such as/csp/menu).
This parameter is processed by the Gateway’s Apache modules and can be globally defined at the server definition level (in httpd.conf) or restricted within the definition for a location or directory block.
By file type: The following directive requests that files of type xxx and yyy be processed by CSP. CSPFileTypes xxx yyy
By location: The following requests that files of type xxx and yyy be processed by CSP but only for locations under /csp
(including subdirectories, such as /csp/samples and so on). <Location /csp/>
CSPFileTypes xxx yyy </Location>
Using the wildcard character, the following requests that all files under path /csp (and /csp/samples and so on) be processed by CSP.
<Location /csp/> CSPFileTypes * </Location>
By MIME type
In addition to recognizing the file extensions listed above, CSP can also recognize files for the following MIME types: application/x-csp
and text/csp
For example, to add the file extension xxx to the list of files processed by CSP, use: LoadModule csp_module /apache$root/csp/bin/mod_csp22.exe
AddType application/x-csp csp cls zen xxx
One of the problems with using MIME types to associate types of file with CSP is that Apache checks to ensure that the path to the resource (that is, the hosting directory) physically exists, and returns a file not found error if it does not.
It does not, however, check to ensure that the file requested physically exists – which is appropriate for resources served by CSP since they are served by Caché and are virtual as far as the web server is concerned. The “By MIME type” approach is therefore only suitable for cases where the application’s path structure can be replicated on the web server.
4.2.2 Operating and Managing the Gateway with OpenVMS API and NSD
This connectivity option depends on the CSP Gateway’s Network Service Daemon (NSD). 1. Start the CSP NSD as described in “Operating the Network Service Daemon (NSD)” . 2. Restart SWS/Apache after making changes to its configuration file (HTTPD.CONF).
The order in which SWS/Apache and the NSD are started is unimportant.
3. To access the CSP Web Gateway Management page, point your browser at one of the following locations. Although CSP pages are served through the higher-performing module (MOD_CSP*.EXE), the CSP Web Gateway Management page is accessed through the CGI module dedicated to this purpose (NPH-CSPCGISYS.EXE).
http://localhost:<port_no>/csp/bin/Systems/Module.cxw http://localhost:<port_no>/csp-bin/nph-CSPcgiSys.exe
If you see an Unauthorized User error message, refer to the section on security considerations.
The CSP engine is automatically invoked for requested files that contain a .csp, .cls, or .zen extension. For example:
http://localhost:<port_no>/csp/samples/menu.csp