Configuring Apache to Pass Additional File Types (All Platforms)
On all platforms, Apache API modules always recognize the following InterSystems file types and send them to the Web Gateway:
.csp .cls .zen .cxw
You may have other files that you want to send to the Web Gateway for processing. For example, if you need to serve other static files through the Web Gateway or need to access the Management Portal through this web server, add mappings for file types .jpg, .gif, .png, .css, and .js.
You can configure Apache to pass files to InterSystems IRIS (specifically to the CSP engine) in any of the following ways:
Configuring Apache by Location
Use the CSP location directive to forward all files within a certain location to InterSystems IRIS. The following causes Apache to forward all files and directories under the /csp path to InterSystems IRIS.
<Location /csp> CSP On CSPFileTypes csp cls zen cxw </Location>
For example, all the following would be sent to InterSystems IRIS for processing:
/csp/ /csp/samples/menu.csp /csp/sys/
Configuring Apache by File Extension (CSPFileTypes Directive)
The CSPFileTypes directive works for requests for files that have extensions (such as /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 Web 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 causes Apache to send all files of type xxx and yyy to InterSystems IRIS (specifically by the CSP engine).
CSPFileTypes xxx yyy
By location: The following causes Apache to send all files of type xxx and yyy to InterSystems IRIS, 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 causes Apache to send all files under path /csp (and /csp/samples and so on) to InterSystems IRIS.
<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.