ColdFusion Manual Configuration & Issues with TCP ports 51011, 51010 and 51800 on IIS and Apache

ColdFusion works by configuring your web server (IIS, or Apache) to execute files with known extensions (.cfm, .cfml, .cfc et al) to run as script. And for doing that ColdFusion comes with a small and important tool called “wsconfig”.

Problem: At times, regardless of operating system and the web server you are using, the ColdFusion installation will fail to configure web-server due to your network settings or firewall/security settings. When running wsconfig tool, you may encounter errors similar to the following:

  • Could not connect to any JRun/ColdFusion servers on host localhost.
    • Possible causes:
      • Server not running
        - Start Macromedia JRun4 or ColdFusion server
      • Server running
        - JNDI listen port in jndi.properties blocked by TCP/IP filtering or firewall on server
        - host restriction in security.properties blocking communication with server

CF-Install-32BitApp

Snapshot above shows one of the common scenario when wsconfig will not configure IIS.

Solution: Here is one fail proof solution to complete the installation of ColdFusion and stop worrying about getting wsconfig to… “run”. Yes, you we will not run “wsconfig”. Instead, we will manually configure web-servers and manually create files that are created by wsconfig.

Let’s first take into account the files that are created or modified by wsconfig:

  1. Create jrunserver.store – The wsconfig tool will create a .store file that the jrun server uses to store port number for connecter to work with your server. Port number for CFMX 6.1 is 51010. Port for CF 7.0 is 51011. And port for CF 8 and CF 9 is 51800. You can check the port number for your machine in jrun.xml file stored in cf_root\runtime\servers\coldfusion\SERVER-INF\jrun.xml – search for “ProxyService” in this file and under the <service> tag you will find <attribute name="port">YOUR PORT NUMBER</attribute>.
  2. For IIS, creates jrun.ini or jrun_iis6.ini – Only when configuring IIS on Windows. For IIS4 and IIS5, a jrun.ini file is created. For later versions, i.e. for IIS6 and II7 jrun_iis6.ini file is created.   
  3. For Apache, modifies httpd.conf – Only when configuring Apache server. The httpd.conf file is part of Apache. Its the web-server configuration file and this file is modified by wsconfig tool so that Apache will load mod_jrun2.so or mod_jrun22.so depending on version of ColdFusion.

wsconfig-folder

Let’s Just Do It Manually

  • Open jrun.xml file found at cf_root\runtime\servers\coldfusion\SERVER-INF\. Edit the file, find “ProxyService” and change value of deactivated to true. Like shown in the snapshot below. 
    Jrun-ProxyService-Deactivated-True 
  • After you have edited the above XML file, you must restart the ColdFusion Application server.
  • Create wsconfig.properties file – this file is created by wsconfig tool to store the list of servers it has configured. Take a look at the following snap-shot – the wsconfig tool will store two records in wsconfig.properties file when you have both IIS and Apache configured. So, if you have just one server configured then only one record is saved in the file and the same is shown in the tool. 
    WsConfig-Tool
    WsConfig.Properties
    • Create wsconfig.properties file at cf_root/runtime/lib/wsconfig
    • Edit the file to contain following information depending on your server:
      • For IIS:
        • For ColdFusion 7+
          1 =IIS,1,false,""
          1 .srv=localhost,"coldfusion"
          1.cfmx=true,C:/inetpub/wwwroot
        • For ColdFusion MX 6.1, instead of the above line, enter:
          1 =IIS,1,false,""
          1 .srv=localhost,"default"
          1.cfmx=true,C:/inetpub/wwwroot
      • For Apache:
        • On Windows:
          1=Apache,C:/Apache Group/Apache2/conf,"","",""
          1 .srv=localhost,"coldfusion"
          1.cfmx=true,<null>
        • On Unix:
          1=Apache,/opt/apache/2.0.47/conf,"","",""
          1 .srv=localhost,"coldfusion"
          1.cfmx=true,<null>
  • Extract connector files (DLL or SO files) from wsconfig.jar: The wsconfig tool will extract the DLL files from wsconfig.jar file. Which files are extracted depends on the server you are running. When you are running IIS4 or IIS5 or IIS6 or IIS7 the wsconfig tool will extract *.dll files specific for your version. When running Apache, specific *.so file for your version is extracted.  Now, lets look into specific details for each server and see what files are extracted for a specific web server:
  • IIS 6 and IIS 7 configuraton: wsconfig-folder-1

    1. Extract jrunwin32.dll and jrun_iis6.dll from cf_root\runtime\lib\wsconfig.jar and copy them to cf_root\runtime\lib\wsconfig\.
    2. Extract jrun_iis6_wildcard.dll from cf_root\runtime\lib\wsconfig.jar and copy it to cf_root\runtime\lib\wsconfig\1.
    3. Create a jrun_iis6_wildcard.ini file in cf_root\runtime\lib\wsconfig\1. It should contain the following information: 

      verbose=false
      serverstore=cf_root/runtime/lib/wsconfig/1/jrunserver.store (use absolute path. see note below)
      bootstrap=127.0.0.1:51800 (port number differs by version of ColdFusion server. see note below)
      apialloc=false
      ssl=false
      #errorurl=<optionally redirect to this URL on errors>

      Notes:

      • serverstore above should point to actual JRun 4 installation
      • bootstrap port number for ColdFusion 9 is 51800, for ColdFusion 7 and 8 port number is 51011. And, for ColdFusion 6 the port number is 51010.
    4. Create the jrunserver.store file in cf_root\runtime\lib\wsconfig\1. Edit as follows:

      proxyservers=127.0.0.1:51800 (127.0.0.1:51010 for MX 6.1; 127.0.0.1:51011 for MX 7)
  • Specific for IIS 6:
    1. Using the IIS Management Console, add a new Web Service Extension named Macromedia Server Extensions. Set the status to Allowed. Set Required Files to
      cf_root\runtime/lib\wsconfig\1\jrun_iis6_wildcard.dll and cf_root\runtime\lib\wsconfig\jrun_iis6.dll.
    2. Right-click on the website you are connecting and select the properties. Select the Home Directory tab and click on the Configuration button. Add extension mappings in the Application extensions for .cfc, .cfm, .cfml, .cfr, .cfswf,.jsp and .jws. Point all of them to cf_root\runtime\lib\wsconfig\jrun_iis6.dll.
    3. In the Wildcard application maps at the lower half of the same window, insert the following:
      cf_root\runtime\lib\wsconfig\1\jrun_iis6_wildcard.dll.
  • Specific or IIS 7:
    1. Under the IIS Management Console, click on your computer name, click on “ISAPI and CGI Restrictions” and add two entries: one for cf_root\runtime/lib\wsconfig\1\jrun_iis6_wildcard.dll and the other for cf_root\runtime\lib\wsconfig\jrun_iis6.dll. Set both to allowed.
       ISAPI and CGI Restrictions
    2. Click on your computer name and click on “Handler Mappings” and add one “Wildcard Script Map”:
      Add-Wildcard-Script-Map
    3. After adding wildcard script map, add script handlers for *.cfm files:
      Add Script Map 
    4. Add other file extensions that are supported by your version of ColdFusion. For ColdFusion 9, you will add the following script handler mappings (*.jsp, *.jws, *.cfml, *.cfc, *.cfr, *.cfswf, *.hbmxml):
       Handler-Mappings

  • IIS 4 or IIS 5 configuration:

    1. Extract jrunwin32.dll from cf_root\runtime\lib\wsconfig.jar and copy it to cf_root\runtime\lib\wsconfig\.
    2. Extract jrun.dll from cf_root\runtime\lib\wsconfig.jar and copy it to cf_root\runtime\lib\wsconfig\1.
    3. Create a jrun.ini file in cf_root\runtime\lib\wsconfig\1. It should contain the following information:

      verbose=false
      scriptpath=/JRunScripts/jrun.dll (must be a valid URL. see note below)
      serverstore={cf-root}/runtime/lib/wsconfig/1/jrunserver.store (use absolute path. see note below)
      bootstrap=127.0.0.1:51800 (port number varies by version of CF. see note below)
      apialloc=false
      ssl=false
      ignoresuffixmap=false
      #errorurl=<optionally redirect to this URL on errors>

      Notes:

      • scriptpath above points to /JRunScripts/jrun.dll and it must be a valid URL. Using the IIS Management Console, add a virtual directory named JRunScripts to the website. The Local Path property of the folder should point to cf_root\runtime\lib\wsconfig\1 and Execute Permissions must be set to "Scripts and Executables"
      • serverstore above should point to actual JRun 4 installation
      • bootstrap port number for ColdFusion 9 is 51800, for ColdFusion 7 and 8 port number is 51011. And, for ColdFusion MX 6.1 the port number is 51010.
    4. Add the JRunConnector Filter to the ISAPI Filter properties of the website:
    1. Right-click on the website.
    2. Select the ISAPI Filters tab.
    3. Click the Add button.
    4. In the Filter Name text box, enter "JRun Connector Filter".
    5. In the Executable text box, browse to or enter "cf_root\runtime\lib\wsconfig\1\jrun.dll".
    6. Select the Home Directory tab and click on the Configuration button. Add extension mappings in the Application extensions for .cfc, .cfm, .cfml, .cfr, .cfswf, jsp and .jws. Point all of them to cf_root\runtime\lib\wsconfig\1\jrun.dll.
    7. Restart the World Wide Web Publishing service from the Windows Control Panel and check the ISAPI Filter property for the website. The JRun Connector Filter should show a high priority with a green arrow pointing upwards.
  • For Apache web server:

    wsconfig-folder-2
    1. Extract the .SO file file for your Apache server version from wsconfig.jar file. In the screenshot above you will see that mod_jrun22.so has been extracted. mod_jrun20.so supports Apache 2.x web servers. To connect to Apache 1.3.x, use mod_jrun.so.
    2. Create jrunserver.store file under cf_root\runtime\lib\wsconfig\1 directory with the following files:
      jrunserver.store - Create a file called jrunserver.store and enter the following information:
      • For ColdFusion MX 6.1:
        proxyservers=127.0.0.1:51010
      • For ColdFusion MX 7:
        proxyservers=127.0.0.1:51011
      • For ColdFusion 8 and ColdFusion 9
        proxyservers=127.0.0.1:51800
    3. Edit the Apache configuration file (located in apache_install_directory/conf/httpd.conf) and add the following section at the end of the file:
      # JRun Settings
      LoadModule jrun_module "cf_root/runtime/lib/wsconfig/2/mod_jrun22.so"
      <IfModule mod_jrun22.c>
          JRunConfig Verbose false
          JRunConfig Apialloc false
          JRunConfig Ignoresuffixmap false
          JRunConfig Serverstore "cf_root/runtime/lib/wsconfig/2/jrunserver.store"
          JRunConfig Bootstrap 127.0.0.1:51800
          #JRunConfig Errorurl url <optionally redirect to this URL on errors>
          #JRunConfig ProxyRetryInterval 600 <number of seconds to wait before trying to reconnect to unreachable clustered server>
          #JRunConfig ConnectTimeout 15 <number of seconds to wait on a socket connect to a jrun server>
          #JRunConfig RecvTimeout 300 <number of seconds to wait on a socket receive to a jrun server>
          #JRunConfig SendTimeout 15 <number of seconds to wait on a socket send to a jrun server>
          AddHandler jrun-handler .jsp .jws .cfm .cfml .cfc .cfr .cfswf
      </IfModule>

      Notes:

      • LoadModule jrun_module must point to actual location of .so file using absolute path.
      • JRunConfig Serverstore must point to actual location of .store file created in step #2.
      • JRunConfig Bootstrap must use the correct port number. For ColdFusion 9 use 51800. For MX 7 use 51011 and for MX 6.1 use 51010.
    4. Restart the Apache web server.

 

If you are on IIS, you might have to restart the IIS web server, but in most cases you won’t have to.

Now, you’re finished configuring your ColdFusion server with your web server without running wsconfig tool. This will help those who find that wsconfig is failing to configure their web servers. Phew!

Comments

  1. Thanks for your post.

    But CF8 port number makes me confused, sometimes you mentioned it is 51011 (port number for ColdFusion 9 is 51800, for ColdFusion 7 and 8 port number is 51011)

    or 51800 (For ColdFusion 8 and ColdFusion 9
    proxyservers=127.0.0.1:51800 )

    I think is 51800, correct?

    Regards.

    ReplyDelete
  2. Sameer,

    Thanks so much for you post! Followed it carefully and was able to get my Coldfusion 6.1 running on our Windows 2008 Server 64bit. Awsome! Thanks again.

    ReplyDelete
  3. Nice write up... You seem to have one typo. JRunProxyService should be activated, so "deactivated" should be set to "false" not "true" as you have it. (I've tried setting it to true and I get http 503 error: Could not connect to JRun Server).

    Another thing... I have a CF7 running on IIS 7.5 (Windows Server 2008 R2, which only comes in 64bit flavor) It might be worth mentioning that in any flavor of 64bit Windows, the AppPool that CF7 runs in must be set to "Enable 32-bit Applications". Not sure about CF8, but I suspect that's also has a 32bit dll.

    ReplyDelete
  4. FYI, here is an alternative configuration for CF7 on IIS 7.5 - Windows 2008 R2 (It will most likely work on other CF and IIS combinations). It's a bit more complicated, but I recommend it for production servers as it has some security and performance advantages.

    1) Skip (Remove) Wildcard Script Map setup in Handler Mappings.

    2) When adding Script Maps for *.cfm, *.cfc, etc use jrun_iis6_wildcard.dll (jrun_iis6.dll won't work). For each Script Map in Request Restrictions check "File" under "Invoke handler only if request is mapped to".

    The advantage of such setup is that IIS handles all your 404 errors including for *.cfm and other CF mapped file extensions. You can have per site 404 custom pages instead of having to rely on server-wide CF "Missing Template" page for all .cfm 404s. Second, your /CFIDE/Administrator will not be accessible through any of your sites (unless you add a Virtual directory through IIS). Third, I was not able to find out if there is a performance penalty associated with having Wildcard Script Map for CF connector but it is a well known fact that there is a performance penalty when using ASP.NET Wildcard Script Map. At any rate, with my setup CFusion does not process/handle any static files (.htm, jpg, gif, etc).

    If you are using CFCHART, Flash Remoting, and some other servlets (see servlet-mappings in cfwwwroot/WEB-INF/web.xml) you will need to optionally add these on per site basis:

    3) CFCHART invokes GraphServlet servlet which is mapped to /CFIDE/GraphData.cfm. The solution is simple: In root of your site create CFIDE folder and in it create empty GraphData.cfm file. While you are at it, create a virtual directory "scripts" in your newly created CFIDE folder and point it to "real" /CFIDE/scripts folder. This will assure that various .js, .swf scripts used in CFFORM are available. (Not sure if you need any other mappings for CFGRID, CFTREE, CFSLIDER, etc)

    4) Flash Remoting (FlashGateway servlet) invokes /flashservices/gateway. Solution: In your site root create empty flashservices folder. In IIS Handler Mappings for that folder edit your CFC (or any other CF) mapping and change path from "*.cfc" to "gateway", also uncheck map to File in Request Restrictions. Flash remoting now works.

    ReplyDelete
  5. Daniel, thanks for your inputs. You seem to have spent quite some time tinkering with the installation process.

    ReplyDelete
  6. i've been trying to install CF9 64bit in a Windows Server 2008 64bits running plesk. I followed your instructions but still have, when trying to get to the admin page: "HTTP Error 404.17 The requested content appears to be script and will not be served by the static file handler" with call to "Requested URL http://127.0.0.1:80/CFIDE/administrator/index.cfm
    Physical Path D:\inetpub\vhosts\default\htdocs\CFIDE\administrator\index.cfm
    "
    Any idea?
    thanks a lot

    ReplyDelete
  7. @Isabelle,

    Can you download CF 9.0.1 installation? It doesn't require any IIS6 metabase and management features. Follow instructions here: http://www.codecurry.com/2010/07/installing-coldfusion-901-update.html

    ReplyDelete
  8. Thank you so much! you got me up and running!

    ReplyDelete
  9. Hola a todos, bueno yo tengo un problema con CF MX7 y apache 2.2, intale apache y corria perfectamente pero al instalar CF no se puede iniciar el servicio, por x razon el apache lo necesito en un puerto diferente al 80 (le puse el 5000). Los servicios de CF si me aparecen iniciados pero el de apache no. ¿Alguna idea?

    ReplyDelete
  10. I get "HTTP Error 404.17 - Not Found" with error code:0x80070032, when i open my coldfusion admin url i.e. http://127.0.0.1/CFIDE/administrator/index.cfm
    My iis version is 7, coldfusion 9 with update 9.01, windows 7 64bit.
    plz help

    ReplyDelete
  11. This is Very very nice article. Everyone should read. Thanks for sharing. Don't miss WORLD'S BEST GAMES

    ReplyDelete
  12. Dr Driving is one of the my favourite game ever and today I am going to share Dr Driving Mod Apk
    https://www.drdrivingmodapk.xyz/

    ReplyDelete
  13. Whatsapp Group Link - 5000+ Updated Whatsapp Groups
    whatsapp group link Click The link And Join Whatsapp New Groups, Dating, Business promositions Groups

    ReplyDelete
  14. Nice tips. Happy I've found this page.

    ReplyDelete

Post a Comment

Be relevant. Spammers will be banned.

Popular posts from this blog

Installing ColdFusion on IIS 7 + Configure IIS for ColdFusion in Windows Vista and Windows Server 2008

ColdFusion 9.0.1 Update Now Available