Accessibility

ColdFusion Article

Configuring the Web Server

JRun ships with several different connectors that plug into the major web servers (such as Apache, Iplanet, and IIS). If you use a hardware load-balancing device between the application server and the web server, you cannot use the JRun connector. In place of the connector, you can use a proxy filter that plugs into the web server. With Apache, you can use the mod_Rewrite and mod_Proxy modules.

With IIS, there are several possible solutions available. In this article, we used ISAPI Rewrite. ISAPI_Rewrite is a powerful URL manipulation engine that uses regular expressions to parse through URLs and redirect requests based on the rules you provide. It acts like the Apache mod_Rewrite, but it is designed especially for Microsoft Internet Information Server (IIS). You can download the installer for ISAPI Rewrite from http://www.isapirewrite.com/. To configure the ISAPI Rewrite, we use it as a proxy; for the proxy feature to work, you must first purchase a license.

Configuring IIS with ISAPI Rewrite

Use the following steps to configure IIS with ISAPI Rewrite.

  1. Downloading and register ISAPI Rewrite
  2. Run the installer. After the installer completes, you may be asked to reboot your server.
  3. After the install, verify the configuration of ISAPI Rewrite.

    1. Open up the Microsoft Management Console (MMC) for IIS.
    2. Right click on the server name and click on properties.
    3. Choose Master Properties, click Edit, then click on the ISAPI filter tab. If the filter is correctly installed, your configuration should look like the following figure:

      Figure 6. Verifying the ISAPI settings.

      Figure 6. Verifying the ISAPI settings.

      Make sure that the JRun filter is not installed at the Master or Site level as it will cause conflicts with the ISAPI Rewrite filter.

  4. Next, verify that the extension for the ISAPI Rewrite filter extension propagated down to the site that will service your domain.

    1. Right click on the site in the MMC and select properties
    2. Click Edit, then click the ISAPI filters tab. Verify that you added the .isrwhlp extension mapping and that it points to {ISAPI_Rewrite_install}\rwhelper.dll.

      Figure 7. The Application Extension Mapping dialog box.

      Figure 7. The Application Extension Mapping dialog box.

  5. Match the context root that you used earlier when you configured the application servers to configure the redirection rules for ISAPI_Rewrite.

    1. Open the file httpd.ini and add the following line. In this case 10.15.1.41:8100 is the ip and port for the BigIP hardware load balancer. This is the pool that is used for the application servers.

      RewriteRule ^/cfusion(.*) http\://10.15.1.41:8100/cfusion$1 [U,P]
    2. Based on this rule, the server will redirect any incoming requests to the web server which contain /cfusion that to BigIP, which in turn load balances it to the application servers. If you would like to bypass the BigIP for testing, you can change the ip:host to the value of one your application server instances.

    For complete details on the syntax for rewrite rules in ISAPI Rewrite see the ISAPI Rewrite documentation.

Configuring Apache with mod_rewrite and mod_proxy

If you are using a Unix/Linux platform or would rather use Apache instead of IIS, the configuration is just as simple. Open the Apache httpd.conf file and remove the comment for the following two entries to enable the rewrite and proxy modules.

LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule rewrite_module modules/mod_rewrite.so

Add the following lines to the httpd.conf so Apache redirects matching incoming requests.

#enabling rewriting in Apache
RewriteEngine on
RewriteRule ^/cfmx/(.*)$ http://10.15.1.41:8100/cfmx/$1 [P,L]

For complete details on the syntax for rewrite rules in Apache see the Apache documentation URL rewrite guide.

If the application server is unavailable for the redirected requests, Apache will display a 502 error in the client browser. If you would rather have an HTML page displaying that the site is down, add the following to the httpd.conf file:

ErrorDocument 502 /errorpage.htm

‹ Back | Contents | Next ›