August 26, 2024
IIS manual connector configuration (Updated) – CF2021 & CF2023
Comments
(0)
August 26, 2024
IIS manual connector configuration (Updated) – CF2021 & CF2023
Staff 7 posts
Followers: 2 people
(0)

ColdFusion comes with a webserver configuration tool for connecting to external web servers. There can be occasions, however, when the tool doesn’t work properly. If the tool doesn’t work, you can configure the connector manually.

This TechNote demonstrates the steps (updated for CF2023 and CF2021) that are required to manually configure a connection to IIS. It presumes there is currently no connection configured between IIS and CF, and it discusses creating a single connector for a single web site. It also presumes you have enabled the following features for IIS (as configured in the Windows Server Manager on server versions of Windows, or in the “Turn Windows features on or off” in desktop versions of Windows):

  • ISAPI Extensions
  • ISAPI Filters
  • CGI
  • ASP .NET

ColdFusion server connects to IIS (and Apache) through an AJP Connector Port, whose value is identified within ColdFusion’s server.xml file, which you can find in the {CF-HOME}/cfusion/runtime/conf directory. See the AJP “connector” line to identify the port. In the following example, the port would be 8122:

<Connector packetSize="65535" protocol="AJP/1.3" port="8022" redirectPort="8455"... />

In all the configurations below, replace {CF-HOME} with the actual ColdFusion installation directory. (For example, C:/ColdFusion2023 for Windows.)

1. Create a folder in {CF-HOME}/config/wsconfig/{magic-number} . The term “magic number” simply refers to an incrementing number (starting at 1) that the web server connector tool would create in that folder. As additional connectors are added, they would be created in another  such number with a new number. Again, this technote presumes you are creating only one connector being created for a single web site.

2. Extract into that folder the IIS connector DLL which can be found within the wsconfig.jar file in {CF-HOME}/cfusion/runtime/lib. (A jar file is essentially a zip, so use any suitable to extra the file.) The IIS 64-bit DLL is in connector/isapi/intel-win64/prebuilt/amd64/isapi_redirect.dll .

3. Create another file in that folder, {CF-HOME}/config/wsconfig/{magic-number}, naming it isapi_redirect.properties, and copy the content below into it.

extension_uri= /jakarta/isapi_redirect.dll
log_file= {CF-HOME}/config/wsconfig/{magic-number}/isapi_redirect.log
log_level= info
worker_file= {CF-HOME}/config/wsconfig/{magic-number}/workers.properties
worker_mount_file= {CF-HOME}/config/wsconfig/{magic-number}/uriworkermap.properties
iis_buffer_enable= true
auth_complete= 1
iis_skip_custom_errors_enable= false

4. Create uriworkermap.properties under {CF-HOME}/config/wsconfig/{magic-number} and copy into it the content below.

/cffileservlet/* = cfusion
/CFFileServlet/* = cfusion
/rest/* = cfusion
/restapps/* = cfusion
/__cf_connector_heartbeat__ = cfusion
/cfapiresources/* = cfusion
/*.cfm = cfusion
/*.CFM = cfusion
/*.Cfm = cfusion
/*.cfm/* = cfusion
/*.CFM/* = cfusion
/*.Cfm/* = cfusion
/*.cfml = cfusion
/*.CFML = cfusion
/*.Cfml = cfusion
/*.cfml/* = cfusion
/*.CFML/* = cfusion
/*.Cfml/* = cfusion
/*.cfc = cfusion
/*.CFC = cfusion
/*.Cfc = cfusion
/*.cfc/* = cfusion
/*.CFC/* = cfusion
/*.Cfc/* = cfusion
/*.cfr = cfusion
/*.CFR = cfusion
/*.Cfr = cfusion
/*.jsp = cfusion
/*.hbmxml = cfusion
!/CFIDE* = cfusion

5. Create a workers.properties file under {CF-HOME}/config/wsconfig/{magic-number} and copy into it the content below. Make sure that the port mentioned is the same as the connector port mentioned for protocol “AJP/1.3” in server.xml.

worker.list=cfusion

heartbeat_interval=30
heartbeat_limit=90

worker.cfusion.type=ajp13
worker.cfusion.host=localhost
worker.cfusion.port=8022
worker.cfusion.heartbeat_servlet_path=/__cf_connector_heartbeat__
worker.cfusion.connection_pool_size=500
worker.cfusion.connection_pool_timeout=60
worker.cfusion.max_reuse_connections=250
worker.cfusion.monitoringsecret={cfusion.monitoringsecret}
worker.cfusion.secret={cfusion.secret}

The cfusion.monitoringsecret value to be placed above can be found as the secretkey value for the instance in {CF-HOME}/config/instances.xml

The cfusion.secret value can be found as the secret value found on the AJP connector line in {CF-HOME}/cfusion/runtime/conf/server.xml), as discussed above prior to step 1.

6. Open IIS Manager, and in the “Connections” panel on the left, select the website to be connected to ColdFusion. Right-click the site and choose “Add Virtual Directory” to create each of the following two  virtual directories.

6a. For the “alias” cf_scripts, point it to the “physical path” {CF-HOME}/cfusion/wwwroot/cf_scripts.

6b. For the “alias” jakarta, point it to the “physical path” {CF-HOME}/config/wsconfig/{magic-number}.

7. Select the jakarta virtual directory just created (as now visible in the IIS Connections panel).

7a. In the Features View for this jakarta virtual directory, double-click the Handler Mappings icon.

7b. In the Actions panel (on the far right), click Edit Feature Permissions.

7c. Ensure Execute is selected.

8. Select again the web site, in the left Connections panel. (The following changes will be done at the site level, whereas the previous step was done for the jakarta virtual directory, alone.)

9. In the Features view for this site, double-click Handler Mappings, and in the Actions panel on the far right, click Add Script Map. Add script maps for each of the following: cfc, cfm, cfml, cfr, and cfswf.

9a. In the Add Script Map panel, enter the Request path with a pattern like *.cfc, and a Name with a pattern like cfmHandler, then pointing the Executable (for all of them) to /{CF-HOME}/config/wsconfig/{magic-number}/isapi_redirect.dll/

10. Again at the web site level (in the Connections panel), double-click ISAPI Filters and in the Actions panel click Add. Enter the Filter name as Tomcat and point the Executable at {CF-HOME}/config/wsconfig/{magic-number}/isapi_redirect.dll.

Test your site’s ability to serve a ColdFusion request.

0 Comments
Add Comment