Web server configuration for application isolation



When you use multiple server instances for application isolation, the steps you perform to configure communication between the website and the server instance differ for each web server.

To enhance performance when using an external web server with multiple server instances, place all static content (HTML files and images, for example) under the web server root directory or one of its subdirectories. Minimize the amount of static content served from ColdFusion web application root directory.

Configuring application isolation in IIS

When you use multiple virtual websites with multiple server instances under IIS, you define separate filters and mappings for each virtual website and server instance combination.

It is assumed that you already created server instances and virtual websites, as described in Enabling application isolation.

Configure multiple server instances for application isolation when using IIS

Run the Web Server Configuration Tool multiple times, once for each virtual website, and specify a different site and server instance each time. Ensure that you select the Configure Web Server for ColdFusion MX Applications option (GUI) or use the ‑coldfusion option (command line). For more information on running the Web Server Configuration Tool, see Using an external web server.

Configuring application isolation in Apache

When you use multiple virtual hosts with multiple server instances under Apache, you edit the httpd.conf file manually.

It is assumed that you already created server instances and virtual websites, as described in Enabling application isolation.

Configure multiple server instances for application isolation when using Apache

  1. Run the Web Server Configuration Tool once, specifying the location of the Apache httpd.conf file and any other required information. Ensure that you select the Configure Web Server for ColdFusion MX Applications option (GUI) or use the ‑coldfusion option (command line).

  2. The Web Server Configuration Tool creates a sequentially numbered subdirectory under jrun_root/lib/wsconfig. You can use the subdirectory created by the Web Server Configuration Tool for one of your virtual hosts, but you must create additional subdirectories for all other virtual hosts. For example, the first time you run the Web Server Configuration Tool, it creates jrun_root/lib/wsconfig/1; if you have two other virtual hosts, manually create two other directories (jrun_root/lib/wsconfig/mystore and jrun_root/lib/wsconfig/myemp in this example). These directories can be empty.

  3. Open the jrun_root/servers/servername/SERVER-INF/jrun.xml file for each server instance and locate the ProxyService service. Ensure that the deactivated element is set to false, and note the value of the port element. For example:

    ... 
    <service class="jrun.servlet.jrpp.JRunProxyService" name="ProxyService"> 
         <attribute name="activeHandlerThreads">25</attribute> 
         <attribute name="backlog">500</attribute> 
         <attribute name="deactivated">false</attribute>  
         <attribute name="interface">*</attribute> 
         <attribute name="maxHandlerThreads">1000</attribute> 
         <attribute name="minHandlerThreads">1</attribute> 
         <attribute name="port">51002</attribute>  
    ...
  4. Restart each of the modified JRun servers.

  5. Open the apache_root/conf/httpd.conf file in a text editor and find the VirtualHost directives. The settings added by the Web Server Configuration Tool are after the last </IfModule> directive, as the following example shows:

    ... 
    # JRun Settings 
    LoadModule jrun_module "C:/JRun4/lib/wsconfig/1/mod_jrun20.so" 
    <IfModule mod_jrun20.c> 
    JRunConfig Verbose false 
    JRunConfig Apialloc false 
    JRunConfig Ssl false 
    JRunConfig Ignoresuffixmap false 
    JRunConfig Serverstore "C:/JRun4/lib/wsconfig/1/jrunserver.store" 
    JRunConfig Bootstrap 127.0.0.1:51000 
    #JRunConfig Errorurl <optionally redirect to this URL on errors> 
    #JRunConfig ProxyRetryInterval <number of seconds to wait before trying to reconnect to unreachable clustered server> 
    #JRunConfig ConnectTimeout 15 
    #JRunConfig RecvTimeout 300 
    #JRunConfig SendTimeout 15 
    AddHandler jrun-handler .jsp .jws .cfm .cfml .cfc .cfr .cfswf 
    </IfModule> 
     
    NameVirtualHost 127.0.0.1 
    <VirtualHost 127.0.0.1> 
    ServerAdmin admin@mysite.com 
    DocumentRoot "C:/Program Files/Apache Group/Apache2/htdocs" 
    ServerName SERVER02 
    ErrorLog logs/error.log 
    </VirtualHost> 
    <VirtualHost 127.0.0.1> 
    ServerAdmin admin@mysite.com 
    DocumentRoot "C:/Program Files/Apache Group/Apache2/htdocs2" 
    ServerName mystore 
    ErrorLog logs/error-store.log 
    </VirtualHost> 
    <VirtualHost 127.0.0.1> 
    ServerAdmin admin@mysite.com 
    DocumentRoot "C:/Program Files/Apache Group/Apache2/htdocs3" 
    ServerName myemployee 
    ErrorLog logs/error-employee.log 
    </VirtualHost> 
    ...
  6. For each VirtualHost directive that relates to a ColdFusion server instance, copy the entire IfModule mod_jrun20.c directive from its original location outside the VirtualHost directive to the last element in the VirtualHost directive.

  7. Delete the Apialloc, Ssl, Ignoresuffixmap, and AddHandler elements in the IfModule directive for each virtual host. Modify the Serverstore and Bootstrap elements to point to the appropriate proxy port (from the jrun.xml file) and jrun_root/lib/wsconfig/subdirectory/jrunserver.store file, which the web server connector creates automatically.

  8. In the original IfModule directive, remove or comment out the Serverstore and Bootstrap lines (comments start with #). The following example shows three virtual hosts, two of which are configured for ColdFusion:

    ... 
    # JRun Settings 
    LoadModule jrun_module "C:/JRun4/lib/wsconfig/1/mod_jrun20.so" 
    <IfModule mod_jrun20.c> 
    JRunConfig Verbose false 
    JRunConfig Apialloc false 
    JRunConfig Ssl false 
    JRunConfig Ignoresuffixmap false 
    #JRunConfig Serverstore "C:/JRun4/lib/wsconfig/1/jrunserver.store" 
    #JRunConfig Bootstrap 127.0.0.1:51020 
            AddHandler jrun-handler .jsp .jws .cfm .cfml .cfc .cfr .cfswf 
    </IfModule> 
    NameVirtualHost 127.0.0.1 
    <VirtualHost 127.0.0.1> 
    ServerAdmin admin@mysite.com 
    DocumentRoot "C:/Program Files/Apache Group/Apache2/htdocs" 
    ServerName RNIELSEN02 
    ErrorLog logs/error.log 
    </VirtualHost> 
    <VirtualHost 127.0.0.1> 
    ServerAdmin admin@mysite.com 
    DocumentRoot "C:/Program Files/Apache Group/Apache2/htdocs2" 
    ServerName rnielsenstore 
    ErrorLog logs/error-store.log 
    <IfModule mod_jrun20.c>  
           JRunConfig Verbose true  
           JRunConfig Serverstore "C:/JRun4/lib/wsconfig/mystore/jrunserver.store" 
    JRunConfig Bootstrap 127.0.0.1:51002 
         </IfModule> 
    </VirtualHost> 
    <VirtualHost 127.0.0.1> 
    ServerAdmin admin@mysite.com 
    DocumentRoot "C:/Program Files/Apache Group/Apache2/htdocs3" 
    ServerName rnielsenemployee 
    ErrorLog logs/error-employee.log 
    <IfModule mod_jrun20.c> 
           JRunConfig Verbose true 
           JRunConfig Serverstore "C:/JRun4/lib/wsconfig/myemp/jrunserver.store" 
    JRunConfig Bootstrap 127.0.0.1:51003 
         </IfModule> 
    </VirtualHost> 
    ...
  9. Restart Apache.

  10. (Optional) Store the ColdFusion files of your application in the external web server root directory.

  11. Test the applications under each virtual host.

Note: Remember that the web server connector doesn’t serve static content, such as HTML and images. Place these files under the web root or create a web server mapping to the ColdFusion web application root.

Configuring application isolation in Sun ONE Web Server

Under Sun ONE Web Server, each ColdFusion server instance is mapped to a Sub ONE Web Server instance, when you use multiple virtual hosts with multiple server instances.

It is assumed that you already created server instances, as described in Enabling application isolation.

Configure multiple server instances for application isolation when using Sun ONE Web Server

Run the Web Server Configuration Tool for each Sun ONE Web Server instance. Specify a different configuration directory and ColdFusion server instance each time. Ensure that you select the Configure Web Server for ColdFusion MX Applications option (GUI) or use the ‑coldfusion option (command line).