Trying to use IIS as a reverse proxy to CommandBox...
# box-products
r
Trying to use IIS as a reverse proxy to CommandBox for the first time (I’m not a Windows person and this isn’t my computer) and I don’t understand this message…
Copy code
Generic Connector Communication Error:

Please check and adjust your setup:
Ensure that Tomcat is running on given host and port.
If this is a timeout error consider adjusting IIS timeout by changing executionTimeout attribute in web.config (see manual).

The source was not found, but some or all event logs could not be searched.  Inaccessible logs: Security, State.    at System.Diagnostics.EventLog.FindSourceRegistration(String source, String machineName, Boolean readOnly, Boolean wantToCreate)
   at System.Diagnostics.EventLog.SourceExists(String source, String machineName, Boolean wantToCreate)
   at System.Diagnostics.EventLog.SourceExists(String source)
   at BonCodeIIS.BonCodeCallHandler.RecordSysEvent(String message, EventLogEntryType eType)
   at BonCodeIIS.BonCodeCallHandler.ProcessRequest(HttpContext context)
Does CommandBox use BonCode behind the scenes?
Where should I start to look to try and resolve this?
d
Here probably: https://commandbox.ortusbooks.com/embedded-server/external-web-server There is a four year old screencast on IIS and the boncode connector:

https://www.youtube.com/watch?v=8q7sSZ7gK3E

Brad says all you should need to know.
I can imagine the missing piece is setting up your webserver to have AJP protocol enabled an have an AJP protocol.
r
Cracking Dom, thanks, just watched the video and that looks like the issue. I’ll have a play later 👍
b
@richard.herbert That message just means BonCode can't connect to the host and port that it's trying to connect to. There a number of issues that may be present • Boncode is configured to connect to the wrong host/port • CommandBox is configured to listen on the wrong host/port • The CommandBox server simply isn't running • There are other network connectivity issues (especially if IIS and CommandBox are on different machines) You'll need to review how you expect the two to be connecting and then check the configuration to see if that's what you've got set up.
Also, ignore the mentions of "Tomcat" in the error message. That's a poor assumption BonCode makes-- thinking that Tomcat is the only AJP-capable servlet container that it will ever be used with eye roll
Now, once you've gotten the host and ports straightened out-- it's worth noting the video Dom pointed out is still all true, but quite outdated. Since the release of that video, CommandBox has added proper first class support for ModCFML into its core, which means you DON'T need a separate CommandBox server instance for every IIS site. instead, you can have a single CommandBox server and simply enable ModCFML and it will work for as many sites as you like. (when Boncode is installed globally)
r
Thanks @bdw429s, @domwatson had is right, I was missing the whole BonCode part of using IIS as a proxy to CommandBox. I’m more used to Apache where this is a non-issue. So I followed the video and found out several things like I need to have a
JAVA_HOME
defined but I’m still being faced with a Tomcat looking error…
Copy code
Server Error in '/' Application.
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: Could not load file or assembly 'BonCodeAJP13' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.

Source Error:


Line 57:                 <add assembly="System.EnterpriseServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
Line 58:                 <add assembly="System.Web.Mobile, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
Line 59:                 <add assembly="*"/>
Line 60:                 <add assembly="System.Runtime.Serialization, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL"/>
Line 61:                 <add assembly="System.IdentityModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL"/>

Source File: C:\Windows\<http://Microsoft.NET|Microsoft.NET>\Framework\v2.0.50727\Config\web.config    Line: 59

Assembly Load Trace: The following information can be helpful to determine why the assembly 'BonCodeAJP13' could not be loaded.


WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

Version Information: Microsoft .NET Framework Version:2.0.50727.8964; <http://ASP.NET|ASP.NET> Version:2.0.50727.8962
My current worry is that this IIS has BlueDragon install (don’t judge me, I’ve inherited this pile) and I’m wondering if this is what complaining somewhere in the background? (How do I install BD from one site on an IIS install where BD is installed at the server level?) I will be having several sites on this box so should I park this and invest in learning ModCFML?
b
To be clear, you don't HAVE to use BonCode. You can also just install the IIS ARR module and set up a basic reverse proxy
👍 1
But BonCode is the easier way to do it IMO
r
I did start with IIS ARR but hit issues there too so was hoping the BonCode would be the silver bullet.
b
I’m more used to Apache where this is a non-issue.
Not sure what you mean-- most people use the mod_cfml module for Apache which is basically just the same thing as BonCode/IIS, but for Apache, lol
r
Not sure what you mean-- most people use the mod_cfml module for Apache which is basically just the same thing as BonCode/IIS, but for Apache, lol
Setting up a reverse proxy
b
So I followed the video and found out several things like I need to have a
JAVA_HOME
defined but I’m still being faced with a Tomcat looking error…
I have no idea what that means. If this is on Windows, java_home probably has nothing to do with anything.
My current worry is that this IIS has BlueDragon install
I have no idea how that is setup, but if you want some sites to proxy to BD and some to proxy to CommandBox, then you'll need to ensure the BD config isn't global (for all sites) in IIS
learning ModCFML
If you're wanting to have CommandBox serve more than one web root, then yes you'll want to use ModCFML, but there's not much to "learn" per se. You just enable it and set the secret and it pretty much does its thing
r
I have no idea what that means. If this is on Windows, java_home probably has nothing to do with anything.
I was getting some error (lost in the mists of my terminal session) that was looking for java.exe but when I set a JAVA_HOME it went away. I guess I could revert that and give you the error message?
I have no idea how that is setup, but if you want some sites to proxy to BD and some to proxy to CommandBox, then you’ll need to ensure the BD config isn’t global (for all sites) in IIS
Likewise, I’ve never used it. I’m transitioning this server/sites to Lucee so it’s going to be a evolution rather than revolution. Maybe I should tap @carehart who used to do a lot with New Atlanta / BD?
If you’re wanting to have CommandBox serve more than one web root, then yes you’ll want to use ModCFML, but there’s not much to “learn” per se. You just enable it and set the secret and it pretty much does its thing
Yes, this is the way I want to go so maybe I should refocus there and try IIS ARR again, it may sidestep the possible BonCode conflict with BD? Anyway, thanks Brad for your time and thoughts
c
@richard.herbert First, I'd concur with Brad @bdw429s on his contention that global install of the DB web server config could be an issue.
Second I would argue that if you are trying to get all this working on some prod box, you should really think twice. This is all WAY to fiddly to be tweaking and trying things. Either create a different machine or VM that mimics how things are setup, or create a snapshot of course if it's already a vm. I realize you may say neither is an option, in which case you proceed into that swamp without a boat and at your own grave risk. But this is life on some servers, for some people.
Third and finally, as for tapping my experience with BlueDragon, I'll just note that I left New Atlanta (makers of BD) in March 2006. You mentioned things from earlier today that you "lost in the mists of [your] terminal session". I'll lean on that same claim if I've lost some BD details to the mists of almost 17 years ago. 🙂
b
I don't think ARR is going to avoid any sort of DB connector issues in an way that BonCode won't. EIther way, you'll probably need to adjust how DB is installed to make anything else work with it.
I don't know how BD's connector is set up or how it works so I can't help much, but basically you need it to be on a per-site level, not global. Then you can have each site proxy to the backend you want.
c
I'd think getting ARR working (to do simple port-forward proxying vs use of AJP) might work better. It can for some situations. It's sad that IIS has no simple port-forwarding without it. It's rather a piggish install for such a modest feature. But perhaps you mean that web.config issues could remain, despite trying to use it, and that's certainly true.
b
getting ARR working ... might work better
I'd still recommend BonCode to be honest if he wants more than one site. ARR has no real benefits and actually several detriments. I'd say setting up BonCode is probalbly only marginally more work by comparison and he's going to need to tip toe around the BD config regardless
c
with respect to Commandbox and Lucee, sure, fair enough.
r
Thank you Charlie, you’re the only name I know what has any recent (2006) experience of BD 🙂 I am staring at the swamp without a boat but maybe I need to have a word with the swamp master to see about getting a boat! Thank you both for your thoughts. I may have more questions that answers than when I started but at least those questions are better informed 🙂 Now, where did I put that paddle…
c
Yep, BD (and the New Atlanta site for it) seem rather frozen in time from about 10+ years ago. There are still some folks using it. I hear from them occasionally, or see mention of it in the community (as you are). It had its place and I represented it with pride from 2003-2006, but sadly time and circumstances have passed it by.