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. This section contains the following sections:
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.
This section assumes 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 check box (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.
This section assumes 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
- 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 check box (GUI) or use the -coldfusion option (command-line).
- 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, you must manually create two other directories (jrun_root/lib/wsconfig/mystore and jrun_root/lib/wsconfig/myemp in this example). These directories can be empty.
- Open the jrun_root/servers/servername/SERVER-INF/jrun.xml file for each of your server instances, 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>
...
- Restart each of the modified JRun servers.
- 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>
...
- 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.
- 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.
- 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>
...
- Restart Apache.
- (Optional) Store the application's ColdFusion files in your external web server root directory.
- 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
When using multiple virtual hosts with multiple server instances under Sun ONE Web Server, you create multiple Sun ONE Web Server instances, one for each ColdFusion server instance.
This section assumes 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 multiple times, once for each Sun ONE Web Server server instance, and specify a different configuration directory and ColdFusion server instance each time. Ensure that you select the Configure Web Server for ColdFusion MX Applications check box (GUI) or use the -coldfusion option (command-line).