Skip to main content

Apache for Windows

Apache for Windows

The Apache HTTP web server (httpd) is developed and maintained by the Apache Software Foundation. The Apache Software Foundation does not distribute Windows-compatible Apache httpd binaries; you can compile httpd yourself (see https://httpd.apache.org/docs/current/platform/win_compiling.htmlOpens in a new tab) or obtain an httpd binary package from a trusted third-party source (see https://httpd.apache.org/docs/current/platform/windows.htmlOpens in a new tab). For detailed guidance, consult the Apache documentation (https://httpd.apache.org/docs/Opens in a new tab).

This section describes how to deploy the Web Gateway within Apache httpd on a Windows system using the dynamic module csp_module_sa, which InterSystems implements using Apache’s native API. This is the recommended deployment option for Apache; it is effective for the vast majority of use cases.

Note:

State-aware connectivity (preserve mode 1) should not be used with this module.

Alternative Options for Apache describes other options for deploying the Web Gateway with Apache, including options which use the Network Service Daemon (NSD).

Acquire the .dll Files for the csp_module_sa Module

On Windows, the csp_module_sa module implements the Web Gateway using two dynamic linked library (.dll) files:

  • CSPa24.dll — the runtime binary.

  • CSPa24Sys.dll — the Web Gateway management binary.

On Windows systems, an InterSystems IRIS installation does not include these files. To acquire these files, download and install a stand-alone Web Gateway which includes the Web Gateway modules for Apache HTTPD servers installation component.

Verify That Apache Can Manage Shared Object Modules

Before you attempt to add the Web Gateway to your Apache configuration using Apache’s proprietary API, check that your build of Apache includes the built-in module for managing shared objects: mod_so.

To perform this check on Windows, navigate to the \bin\ subdirectory for your Apache installation from the command line and execute the following command:

httpd.exe -l

This command displays the list of modules included in your current Apache installation. If mod_so is not included in this list, follow the instructions provided within the Apache documentation (https://httpd.apache.org/docs/2.4/Opens in a new tab) to compile a new build of Apache that includes this module.

Add the Web Gateway Modules to Your Web Server Configuration

  1. Note the file system location of the Web Gateway module files. These instructions use the example location C:\InterSystems\WebGateway\; be sure to replace that location with the location of the Web Gateway module files within your file system.

  2. Open the Apache httpd web server configuration file (httpd.conf) in a text editor. This file is located in your Apache installation directory, within the /conf subdirectory. On Windows, the default installation directory for httpd is usually C:\Apache24\

  3. Append directives to the end of the file which add the Web Gateway module. These directives should accomplish the following:

    • Load the module using the LoadModule directive, providing the name of the module (csp_module_sa) and the location of the .dll file for the Web Gateway’s runtime functions. For example:

      LoadModule csp_module_sa "C:/InterSystems/WebGateway/CSPa24.dll"
      
    • Issue the CSPModulePath directive, providing the full path for the directory that contains the .dll file for the Web Gateway’s runtime functions. For example:

      CSPModulePath "C:/InterSystems/WebGateway/"
      
    • Issue the CSPConfigPath directive, providing the full path for the directory that contains the .dll file for the Web Gateway management functions. For example:

      CSPConfigPath "C:/InterSystems/WebGateway/"
      
    • Configure access settings for the directory that contains the Web Gateway binaries. To do so, add a <Directory> directive block for that directory as follows (the example assumes the most common installation location):

      <Directory "C:/InterSystems/WebGateway">
          AllowOverride None
          Options MultiViews FollowSymLinks ExecCGI
          Require all granted
          <FilesMatch "\.(log|ini|pid|exe)$">
              Require all denied 
          </FilesMatch>
      </Directory>
      
  4. Optional: if you want the web server to serve static files for your web applications, append directives to map the appropriate /csp paths to file system locations accessible to your web server. The Apache Alias directive provides one such method to accomplish this.

    For example: if the application /dashboard is served by a remote InterSystems IRIS instance but you want to serve static files for the application from the directory C:\iris\csp\dashboard on the web server’s machine, you could add the following directive:

    Alias /dashboard/ "C:/iris/csp/dashboard"
    
  5. Issue directives which invoke the Web Gateway to handle requests intended for your InterSystems IRIS applications. InterSystems provides the following Apache configuration directives for this purpose:

    • CSPFileTypes, which invokes the Web Gateway for requests for the set of file types you specify.

      Note:

      Because REST API endpoints are often paths and not files, the CSPFileTypes directive is not sufficient to route requests for REST applications.

    • CSP On and CSP Off, which enable or disable the Web Gateway as the handler for all requests.

    By issuing these directives within <Location> blocks, you can configure your web server in a granular way, invoking the Web Gateway only for those relative URL paths which correspond with your InterSystems IRIS web applications. (See Specify the Application Paths You Need for further information regarding the paths associated with built-in InterSystems IRIS web applications.)

    The following location block would invoke the Web Gateway exclusively for requests directed to the Management Portal for an InterSystems IRIS instance named iris3:

    <Location "/iris3/csp/sys/">
        CSP On
    </Location>
    
    Note:

    To access the management pages for a Web Gateway without access to an InterSystems IRIS instance, enable the Web Gateway for the /csp path. Routing requests to the/<instancePrefix> or /<instancePrefix>/csp path for an instance’s

  6. Save the httpd.conf file.

  7. If Apache is running, restart Apache to allow the configuration changes to take effect.

Start Apache

If Apache is not already running, navigate to the \bin\ subdirectory for the Apache installation from the command line and execute the following command to start it:

httpd.exe

Next Steps: Define Web Gateway Server Access Profile and Application Access Profiles

To finish configuring the Web Gateway connection between Apache httpd and your InterSystems IRIS server instance, you must complete the following steps:

  1. Define a server access profile for your instance within the configuration for httpd’s Web Gateway.

  2. Define one or more application access profiles for desired application paths within the configuration for httpd’s Web Gateway.

FeedbackOpens in a new tab