Configuring Apache to Pass Additional File Types (All Platforms)
On all platforms, Apache API modules always recognize the requests for the following InterSystems file types and send them to the Web Gateway:
.csp .cls .zen .cxw
You may have requests for other files that you want to send to the Web Gateway for routing to the appropriate InterSystems IRIS instance’s CSP server. For example, if you need to access the Management Portal through this web server, you must also add mappings for the following static file types: .jpg, .gif, .png, .svg, .css, and .js.
You can configure Apache to pass requests for additional files to the Web Gateway in any of the following ways:
The CSP directives described on this page cannot be invoked as part of <VirtualHost> configurations.
Configuring Apache by Location
Use the CSP directive within a <Location> block to pass all requests for resources under a certain directory to the Web Gateway. The following causes Apache to forward all requests for resources under the /csp directory to the Web Gateway:
<Location /csp> CSP On </Location>
For example, requests made for all of the following resources would be sent to the Web Gateway for routing to the appropriate InterSystem IRIS instance:
/csp/ /csp/samples/menu.csp /csp/sys/
Configuring Apache by File Extension (CSPFileTypes Directive)
The CSPFileTypes directive configures the web server to route requests for files to the Web Gateway if they are files of a particular type (or types). This directive only works for requests for files that have extensions (such as /csp/menu.csp). It does not work for resources that do not have file extensions (such as /csp/menu).
The following directive causes Apache to pass requests for files of types xxx and yyy to the Web Gateway.
CSPFileTypes xxx yyy
You can issue this directive globally for the entire server or restrict it to a <Location> or <Directory> block. For example, the following causes Apache to pass requests for files of type xxx and yyy to the Web Gateway, but only when requests are sent to locations under the /csp directory (including subdirectories such as /csp/samples):
<Location /csp/> CSPFileTypes xxx yyy </Location>
Using the wildcard character (*) with the CSPFileTypes directive as follows causes Apache to pass requests for files of all type under the /csp directory (and /csp/samples, and so on) to the Web Gateway.
<Location /csp/> CSPFileTypes * </Location>
Configuring Apache by MIME Type
In addition to recognizing the file extensions listed above, the CSP engine can also recognize files for the following MIME types:
For example, to add the file extension xxx to the list of files processed by InterSystems IRIS (specifically by the CSP engine), use:
LoadModule csp_module_sa /iris/csp/bin/CSPa24.dll 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 the CSP engine, which can be 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.