Skip to main content

Configuring Apache to Work With the Web Gateway (Windows)

This article describes how to configure an Apache web server for use with the InterSystems Web Gateway on Windows. (On Windows, the other options are IIS and Nginx; options are different on other operating systems.)

If you installed the Web Gateway through the InterSystems IRIS® installer or if you want to configure an Apache server to work with CSP, follow the instructions in this article.

If you are using an Apache web server, follow these directions to configure Apache using Native Modules. Native Modules are extensions implemented as dynamically-linked modules (DLLs). They enable you to utilize the Internet Server Application Programming Interface (ISAPI) extensions. ISAPI is a high-performance API developed for Microsoft’s web servers.

Apache is supplied by the Apache Group and can be downloaded free of charge from: http://www.apache.org.

The complete source code to Apache is available from Apache for download together with clear instructions for building the server. To build Apache under Windows, you must have the Microsoft C compiler (Visual C++) version 5.0 or later. Instead of building the server yourself, you can instead download prebuilt kits for Windows. The prebuilt kits are, generally, a few builds behind the latest Apache source code.

First follow the directions in Install Locations with Apache Servers (All Configurations), then follow the directions in Recommended Option: Apache API Modules (CSPa24.dll) (or if you are installing an atypical configuration, see Alternative Options for Windows Apache).

Assumptions

This article assumes that:

  • The Web Gateway components are installed in C:\Program Files\Apache Group\Apache\WebGateway

  • The web server is installed in C:\Program Files\Apache Group\Apache\

If the layout is different on your system, modify the configuration directives as appropriate.

Install Locations with Apache Servers (All Configurations)

All users of the Apache server should follow the directions in this section. Install the Web Gateway components and the CSP static files as follows:

  1. CGI and other dynamically-linked modules:

    The common files for all Apache versions are:

    • CSPcgi.exe (Runtime module)

    • nph-CSPcgi.exe (Copy of CSPcgi.exe)

    • CSPcgiSys.exe (Systems-Management module)

    • nph-CSPcgiSys.exe (Copy of CSPcgiSys.exe)

    Separate binaries for Apache Version 2.4.x are:

    • mod_csp24.dll (Apache built-in module as a DLL, if supplied)

    • CSPa24.dll (Runtime module, if supplied)

    • CSPa24Sys.dll (Gateway Systems Management module, if supplied)

    The default location for these binaries is C:\Program Files\Apache Group\Apache\WebGateway\bin

    The original location (install-dir\csp\bin) is used to hold the Web Gateway components required for serving the Management Portal for the specific instance of InterSystems IRIS.

    The configuration and log files are written in this directory for non NSD-based connectivity options.

    The modules with Sys appended are special modules for accessing the Web Gateway management pages. The runtime modules (that is, those without Sys) have no access to the systems management forms.

  2. HyperEvents Components

    • CSPBroker.js

    • CSPxmlhttp.js

    The default location for these files is install-dir\csp\broker

  3. Miscellaneous static resources used by the CSP samples

    A number of static web resources (such as image files) are required by the CSP samples. The default location for these files is install-dir\csp\samples

  4. Miscellaneous static resources used by the Management Portal

    A number of static web resources (such as image files) are required by the Management Portal. The default location for these files is install-dir\csp\sys

Recommended Option: Apache API Modules (CSPa24.dll)

This is the option that is used by the Private Web Server that serves the Management Portal.

This connectivity option is relatively new and offers the best performance as well as being the easiest to configure. Apache under Windows is entirely multi-threaded and its modules persist in memory from the time Apache is started. These two essential characteristics make it possible to implement the Web Gateway’s functionality as a set of stand-alone modules.

If you are installing an atypical configuration, see Alternative Options for Apache (Windows).

The modules CSPap*.dll (Runtime) and CSPapSys*.dll (Web Gateway systems management) are dynamically-linked modules that are designed to work the same way as the corresponding Microsoft ISAPI DLLs. For Apache 2.4.x, these modules are named: CSPa24.dll and CSPa24Sys.dll.

Configure the web server so that it recognizes InterSystems file types and passes them to the Web Gateway module for processing.

The web server configuration file (httpd.conf) is in C:\Program Files\Apache Group\Apache\conf

  1. Apache 2.4.x: Add the following section to the end of httpd.conf.

    LoadModule csp_module_sa c:/iris/csp/bin/CSPa24.dll 
    <Location "/csp/bin/Systems/"> 
    SetHandler csp-handler-sa 
    </Location> 
    <Location "/csp/bin/RunTime/"> 
    SetHandler csp-handler-sa 
    </Location> 
    CSPFileTypes csp cls zen cxw 
    Alias /csp/ c:/iris/csp/ 
    <Directory "c:/iris/csp"> 
        AllowOverride None 
        Options MultiViews FollowSymLinks ExecCGI 
        Require all granted
        <FilesMatch "\.(log|ini|pid|exe)$"> 
        Require all denied 
        </FilesMatch>
    </Directory> 

    Apache 2.2.x: Add the following section to the end of httpd.conf

    LoadModule csp_module_sa c:/iris/csp/bin/CSPa22.dll 
    <Location "/csp/bin/Systems/"> 
    SetHandler csp-handler-sa 
    </Location> 
    <Location "/csp/bin/RunTime/"> 
    SetHandler csp-handler-sa 
    </Location> 
    CSPFileTypes csp cls zen cxw 
    Alias /csp/ c:/iris/csp/ 
    <Directory "c:/iris/csp"> 
        AllowOverride None 
        Options MultiViews FollowSymLinks ExecCGI 
        Order allow,deny
                  Allow from all
        <FilesMatch "\.(log|ini|pid|exe)$"> 
        Deny from all
        </FilesMatch>
    </Directory> 

    Apache 2.0.x: Add the previous using CSPa2.dll to the end of httpd.conf

  2. Restart Apache after making changes to httpd.conf.

  3. If needed, see Configuring Apache to Pass Additional File Types.

Now you can use the Web Gateway management pages to further configure the Web Gateway.

Feedback