MYOFB Email Scams
Home | Computer Protection | Privacy | Viruses | Spam | Email Scams | Scams | TechNotes | Computer Jobs | Archive | Email Scam Blog

Creating an Apache 2.0 Connector for ColdFusion MX 6.1 on RHE4

By Wesley Warren

Trying to create an apache connector for cold fusion mx on RHE4 linux can be maddening. Kind of like banging your head against a motherboard for 5 or 6 hours. Hopefully this doc will make it easier.

This document is specific to RHE4 and was built using a mashup of documents noted below. This is a default RHE installation on a new Linux RHE4 server at The Planet (formerly EV1 Servers, formerly RackShack) not running Ensim. (Althouh it should work on an ensim/plesk box too) It is specific to Apache 2.0

Editor: WW - 08/20/08
Mind Your Own F*ing Business


Apache 2.0* ColdFusion connector manual creation for RHE4

Author: Wesley Warren vexcom.com
04/05/07

If you have installed Coldfusion MX 6.1 on RHE4 and CF will note create an apache connector you will have to do the following. Refer to the links at the bottom for more information.
  1. Make sure the CF connector dir exists
    • dir /opt/coldfusionmx/runtime/lib/wsconfig/1/
    • if not make it and permission it 777
    • mkdir /opt/coldfusionmx/runtime/lib/wsconfig/1
    • chmod 777 /opt/coldfusionmx/runtime/lib/wsconfig/1


  2. Edit the CF runtime xml document (you can use nano or pico RHE text editors) Note [ = < LT HTML Tags in example:
    • nano /opt/coldfusionmx/runtime/servers/default/SERVER-INF/jrun.xml
    • Find the entry labeled ProxyService.
    • Add [attribute name="deactivated"]false[/attribute].
    • Save the file.
    • Restart the ColdFusion Application Server.


  3. Create a file named wsconfig.properties in /opt/coldfusionmx/runtime/lib/wsconfig/
    • nano /opt/coldfusionmx/runtime/lib/wsconfig/wsconfig.properties
    • Copy in the following date:
      #JRun Web Server Configuration File
      #Fri May 23 10:19:20 EDT 2003
      1=Apache,/opt/apache/2.0.47/conf,"","",""
      1 .srv=localhost,"default"
    • *Use "coldfusion" instead of "default" for ColdFusion MX 7.


  4. Configure Apache
    • Create a file called jrunserver.store in the wsconfig dir
    • nano /opt/coldfusionmx/runtime/lib/wsconfig/jrunserver.store
    • Copy in the following data:
      proxyservers=127.0.0.1:51010

      #*use proxyservers=127.0.0.1:51011 for CFMX7


  5. Make the jrun so file
    • mod_jrun20.so - Extract the appropriate file for your operating system fromcf_root untimelibwsconfig.jar
    • unzip /opt/coldfusion/runtime/lib/wsconfig.jar
    • unzip /opt/coldfusionmx/runtime/connectors/src/ApacheModule.zip
    • run the following commands
      [root@plain ~]# export CFMX=/opt/coldfusionmx
      [root@plain ~]# export APACHE_PATH=/etc/httpd/conf
      [root@plain ~]# export APACHE_BIN=/usr/sbin
      [root@plain ~]# export CFMX_CONNECTOR=$CFMX/runtime/lib/wsconfig/1
      [root@plain ~]# /etc/rc.d/init.d/httpd stop
      [root@plain ~]# ${APACHE_BIN}/apxs -c -Wc,-w -n jrun20 .S LIBEXECDIR=${CFMX_CONNECTOR} mod_jrun20.c jrun_maptable_impl.c jrun_property.c jrun_session.c platform.c jrun_mutex.c jrun_proxy.c
      jrun_ssl.c
      [root@plain ~]# ${APACHE_BIN}/apxs -i -n jrun20 -S LIBEXECDIR=${CFMX_CONNECTOR} mod_jrun20.la
      [root@plain ~]# strip $CFMX_CONNECTOR/mod_jrun20.so
      
  6. Update the Apache config
    • nano /etc/httpd/conf/httpd.conf
    • Add the following code at the bottom of the file under this section:*Substitute > GT/LT HTML tags for the square [] brackets in the example
      # ErrorDocument 500 /error/HTTP_INTERNAL_SERVER_ERROR.html.var
      # ErrorDocument 501 /error/HTTP_NOT_IMPLEMENTED.html.var
      # ErrorDocument 502 /error/HTTP_BAD_GATEWAY.html.var
      # ErrorDocument 503 /error/HTTP_SERVICE_UNAVAILABLE.html.var
      # ErrorDocument 506 /error/HTTP_VARIANT_ALSO_VARIES.html.var
      [/IfModule]
      [/IfModule]
      
    • Copy and paste the following data into the httpd.conf: *Substitute > GT/LT HTML tags for the square [] brackets in the example
      # JRun Settings
      LoadModule jrun_module /opt/coldfusionmx/runtime/lib/wsconfig/1/mod_jrun20.so
      [IfModule mod_jrun20.c]
      JRunConfig Verbose false
      JRunConfig Apialloc false
      JRunConfig Ssl false
      JRunConfig Ignoresuffixmap false
      JRunConfig Serverstore /opt/coldfusionmx/runtime/lib/wsconfig/1/jrunserver.$
      JRunConfig Bootstrap 127.0.0.1:51010
      #JRunConfig Errorurl 
      AddHandler jrun-handler .jsp .jws .cfm .cfml .cfc
      [/IfModule]
      
    • Next update the DirectoryIndex directive in httpd.conf about 5 pages into the conf file you will find:
      # The index.html.var file (a type-map) is used to deliver content-
      # negotiated documents. The MultiViews Option can be used for the
      # same purpose, but it is much slower.
      #
      DirectoryIndex index.html index.html.var index.cfm
      

    • Here you add index.cfm after the index.html.var


  7. [root@plain ~]# /etc/rc.d/init.d/httpd start

    Apache should start - you can upload a test document into /var/www/html/ to see if it works - create a test CFML document in a text editor on your desktop (or you can use nano if your feeling frisky)

    Create a file "test.cfm" enter the following code:

    *Substitute > GT/LT HTML tags for the square [] brackets in the example
    [html]
    [head][title]Untitled[/title]
    [/head]
    [body]
    [cfset var = "test"]
    [cfoutput]#var#[/cfoutput]
    [/body]
    [/html]
    

  8. Upload it into /var/www/html/

  9. Test view it in a web browser: http://your_ip_address/test.cfm
    Note: http://your_ip_address/ should show the default apache index page!
    You should see "test" if it worked

Reference Documents:
  • http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=tn_19575
  • http://www.houseoffusion.com/groups/cf-server/thread.cfm/threadid:1472
  • http://www.talkingtree.com/blog/index.cfm/2006/12/6/Running-ColdFusion-MX-7-on-Fedora-Core-6-Linux
  • http://www.activsoftware.com/apache/apache2cfmx.cfm
  • http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=tn_18748
  • http://httpd.apache.org/docs/2.0/programs/apxs.html



  • Related MYOFB Articles:



    Creating an Apache 2.0 Connector for ColdFusion MX 6.1 on RHE4

    by: Wesley Warren

    Article: Source Link
    CEO/CTO Wesley Warren - Vexcom.com






    Google


    Freelance Designers | Event Planners | Freelance Services | My City Guide | Web Design Jobs


    © Copyright 2003,2004,2005,2006,2007 All Rights Reserved.