Hosting Multi-context Lucee with CommandBox and ModCFML

Getting to know you …

  • Host on Windows?
    • IIS?
    • Apache httpd?
    • nginx?
  • Host on Linux?
  • Develop on macOS?
  • Who has little or no experience of CommandBox?

  • Richard Herbert MSc - [email protected]
  • Originally started in architecture and engineering
  • Got into computing via structural analysis
  • Moved into IT management
  • Registered my first domain in 1995
  • Been a freelance web developer since 2001
  • Also worked as a dedicated Scrum Master
  • Currently working for Gumtree Motors
  • Played basketball for England schoolboys
  • Now play Masters basketball

  • Joined Gumtree Motors - Jun 2022
  • Over 30 CFML sites across 8 prod & 4 pre-prod servers
    • Internally facing
    • Feed processing
    • Dealer backoffice stock management + white label sites
  • The "Heritage" estate
    • Lucee 5.2.x
    • Adobe ColdFusion 8 Standard
    • BlueDragon 7
  • Move to Multi-host CommandBox Lucee 5.4.x 6.0 ?

  • What are we going to look at today?
    • Step 1 - Set up some websites with IIS
    • Step 2 - Install and configure BonCode
    • Step 3 - Install and configure CommandBox
    • Step 4 - Connect Lucee and IIS together with BonCode/AJP/ModCFML
    • Extending CommandBox
    • CommandBox Service Manager
    • CommandBox 6 / Pro

  • Step 1 - Setup IIS
    • Create websites
      • Primary server context
      • Secondary web contexts
    • .NET version
    • Server defaults
    • web.config or .htaccess

  • Step 2 - Install BonCode AJP Connector
    • .NET Framework 4.5
    • localhost and 8009 port
    • Disable Remote Access to Apache Tomcat
    • Enable Header Data Support
    • Enable Client Remote IP detection
    • Let me choose specific sites
    • Select Default Web Site
    • Deselect JSP and select CFM/CFC
    • Select Configure Application Pool Permissions for Virtual Directory Access
    • Install - this can take some time, quite some time!

  • Step 4 - Configure ModCFML
    • What is ModCFML?
    • Missing link to join Tomcat/Lucee to IIS via BonCode supported by CommandBox
    • For Windows, it's included in BonCode
    • For macOS, download or build from mod_CFML
    • Choose a secret
      • Add it to BonCodeAJP13.settings
      • Add it to httpd.conf (Apache)
      • Add it to server.json
    • server stop
    • server start --verbose

  • Extending CommandBox - 1
    • Engine and version
    • JVM version
      • server set jvm.javaVersion=
        "openjdk11_jdk_11.0.19+7"
    • Runwar args
      • server set runwar.args=
        "--case-senstive-web-server=false"

  • Extending CommandBox - 2
    • Environment Variables
      • server set dotenvFile=../.env
        • PROFILE=development
        • DB-PASSWORD=myPassword123
        • BOX_SERVER_MODCFML_SHAREDKEY=
          wrong-password
        • WEB-CONTEXT-1-WEBROOT=
          C:/websites/web-context-1.localhost

  • Extending CommandBox - 3a
    • CFConfig & ModCFML Support for Lucee Contexts
      • Create .cfconfig.json
      • Create .cfconfig.web-context-1.json
      • Create .cfconfig.web-context-2.json
      • Populate with {"sessionTimeout":"1,0,0,0"}
        {"sessionTimeout":"0,1,0,0"}
        {"sessionTimeout":"0,0,1,0"}

Extending CommandBox - 3b


	server set cfconfig.server=
	        .cfconfig.json
	server set cfconfig.web-${WEB-CONTEXT-1-WEBROOT}=
	        .cfconfig.web-context-1.json
	server set cfconfig.web-C:/websites/web-context-2.localhost=
	        .cfconfig.web-context-2.json

The last example won't work because of the :

  • Extending CommandBox - 4
    • CommandBox Service Manager setup
      • server set service.name=
        "Lucee CommandBox"
      • server set service.displayname=
        "Lucee CommandBox Service"
      • server set service.servicename=
        "lucee-commandbox"

  • CommandBox 6 / Pro

Questions?

Feedback?

Comments?