Charles Robertson
01/06/2023, 3:50 PMC:\domains\<http://acf-lucee.com|acf-lucee.com>\wwwroot\
The reason why it has to use the same system path is because when the application was built, someone hardcoded a system path for many of the mappings in the Application.cfc
[yes I know. It is legacy code hell 😱]
The system path root is:
D:\wwwroot
I have had to use mklink
to create a Junction on this folder, so that it points to:
C:\domains\<http://acf-lucee.com|acf-lucee.com>\wwwroot\
So, if I have two different engines powering this codebase, both must point to the same physical address.
I can see some of the problems here. How can I make the:
server.json
In the the webroot, fire up two different engines?
This might work, if I can call `server.json`:
server-lucee.json
server-acf.json
Is this possible?
In my recipe, how do I tell CommandBox to look for something other than server.json
cfsimplicity
01/06/2023, 3:57 PM{
"app": {
"cfengine": "lucee@5"
},
"name": "lucee"
}
cfsimplicity
01/06/2023, 3:57 PM{
"app": {
"cfengine": "adobe@2021"
},
"name": "acf"
}
Charles Robertson
01/06/2023, 4:05 PMcd C:\domains\<http://cg-acf-lucee5-3-9_166.com|cg-acf-lucee5-3-9_166.com>\wwwroot\la-api
server set web.http.port=8080
server show web.http.port
server start cfengine=adobe@11.0.19+314546
Will look for server.json
in _C:\domains\cg-acf-lucee5-3-9_166.com\wwwroot\la-api_
But, I want to change the name of server.json
to s`erver-lucee.json`
How would I reference server-lucee.json
in the recipecfsimplicity
01/06/2023, 4:11 PMCharles Robertson
01/06/2023, 4:16 PMbdw429s
01/06/2023, 4:34 PMserverConfigFile
is what you want
server start serverCOnfigFile=/path/to/my-server.json
or, it can be passed as the name
parameter as a shortcut
server start /path/to/my-server.json
Or, if the server's have already been defined, just by name
server start myServer
bdw429s
01/06/2023, 4:35 PMserver start name=foo
then CommandBox will create a foo-server.json
instead of a server.json
bdw429s
01/06/2023, 4:56 PMbdw429s
01/06/2023, 4:56 PMbdw429s
01/06/2023, 4:56 PMCharles Robertson
01/06/2023, 4:57 PMbdw429s
01/06/2023, 4:57 PMbdw429s
01/06/2023, 4:57 PMCharles Robertson
01/06/2023, 4:57 PMCharles Robertson
01/06/2023, 4:57 PMbdw429s
01/06/2023, 4:57 PMbdw429s
01/06/2023, 4:58 PMbdw429s
01/06/2023, 4:58 PMbdw429s
01/06/2023, 4:58 PMCharles Robertson
01/06/2023, 4:58 PMBonCodeAJP13.settings
bdw429s
01/06/2023, 4:59 PMbdw429s
01/06/2023, 4:59 PMCharles Robertson
01/06/2023, 5:00 PMI'm actually not entirely sure if you can do what you need toThat's fair enough
bdw429s
01/06/2023, 5:00 PMI installed AJP initially and then I just copy the folder and changeYou're missing what I'm saying. Boncode has TWO ways you can install it • global mode • per-site modeBonCodeAJP13.settings
bdw429s
01/06/2023, 5:00 PMCharles Robertson
01/06/2023, 5:01 PMBonCodeAJP13.settings
bdw429s
01/06/2023, 5:02 PMbdw429s
01/06/2023, 5:02 PMCharles Robertson
01/06/2023, 5:02 PMbdw429s
01/06/2023, 5:02 PMCharles Robertson
01/06/2023, 5:03 PMbdw429s
01/06/2023, 5:03 PMbdw429s
01/06/2023, 5:03 PMbdw429s
01/06/2023, 5:04 PMbdw429s
01/06/2023, 5:05 PMbdw429s
01/06/2023, 5:06 PMCharles Robertson
01/06/2023, 5:07 PMbdw429s
01/06/2023, 5:07 PMbdw429s
01/06/2023, 5:07 PMCharles Robertson
01/06/2023, 5:08 PMbdw429s
01/06/2023, 5:08 PMbdw429s
01/06/2023, 5:10 PMbdw429s
01/06/2023, 5:13 PMCharles Robertson
01/06/2023, 5:14 PMbdw429s
01/06/2023, 5:16 PMCharles Robertson
01/06/2023, 10:52 PMUsing sub applications
You can achieve a similar outcome with a combination of virtual directories and sub application inside one IIS site. Inside your main site, create web-application as in above link. This will automatically create directories and assign BIN references. You can add the DLL files and Setting files manually, the installer will not copy them for you for sub-applications and manage the connections.
For example
c:\mysite\customer1\BIN
c:\mysite\customer2\BIN
Inside each of sub applications, create virtual path to point to your code:
c:\mysite\customer1\code
c:\mysite\customer2\code
point to
c:\mysite\shared\code
What I don’t understand, is when CommandBox hits:
c:\mysite\customer1\server.json
How does it know how to hit:
c:\mysite\customer1\code -> c:\mysite\shared\code
There are no CFML files in:
c:\mysite\customer1\
Directory structure:
c:\mysite\customer1\
|_server.json
|_BIN
|_code -> c:\mysite\shared\code
I know how to set up the virtual directory reference in server.json, but is there another setting that tells CommandBox to hit the virtual directory c:\mysite\customer1\code
, automatically?Charles Robertson
01/06/2023, 10:57 PMindex.cfm
As far as I remember, if there are no default CFML files in the webroot, it just shows a list of directories, in the browser?bdw429s
01/06/2023, 10:59 PMbdw429s
01/06/2023, 11:00 PMserver.json
lives in unless you've configured a web.webroot
setting in the server.json to point elsewhere.Charles Robertson
01/07/2023, 12:15 AMc:\mysite\customer1\
|_server.json
|_BIN
|_code -> c:\mysite\shared\code
Because there is no index.cfm
, what does CommandBox open?
I see there is a server.json
property called openBrowserURL
Maybe I could set it to:
"openBrowserURL" : "<http://mysite.local/code>",
bdw429s
01/07/2023, 12:52 AMmysite.local
is what CommandBox needs to be servingbdw429s
01/07/2023, 12:53 AMBecause there is noCommandBox will show a directory listing if there is no welcome file, unless dir listings are disabled, in which case it will return a forbidden page, what does CommandBox open?index.cfm
bdw429s
01/07/2023, 12:53 AMbdw429s
01/07/2023, 12:54 AMCharles Robertson
01/07/2023, 8:10 AMc:\mysite\acf\
|_server.json
|_BIN
|_code -> c:\mysite\shared\code
c:\mysite\lucee\
|_server.json
|_BIN
|_code -> c:\mysite\shared\code
c:\mysite\shared\code
Prod:
http://mysite.com
I actually use a similar system on my non work laptop.
I put all my production websites in a single wwwroot folder and then navigate to the subfolder.
It has never caused a problem.Charles Robertson
01/07/2023, 9:31 AMbdw429s
01/08/2023, 2:33 AMbdw429s
01/09/2023, 7:55 PMExpandPath(".")
is supposed to return, but I've never used that and I don't recommend you use it either. Generally .
represents the current working directory of a process, but that's not something your CF code should ever be dependent on.bdw429s
01/09/2023, 7:55 PMexpandPath( '/' )
should resolve to the web root base pathCharles Robertson
01/09/2023, 9:15 PMCharles Robertson
01/11/2023, 8:58 AMCharles Robertson
01/11/2023, 9:10 AMweb.webroot
property to server.json is probably what allows this set-up to work?
Anyway, I am going to test this approach, by setting this up again, without the virtual directory.
Currently [this works]:
server.json:
{
"name":"system_learningassistant_acf",
"web":{
"http":{
"port":"8081"
},
"rewrites":{
"enable":"true"
},
"ajp":{
"enable":"true",
"port":"8029"
},
"host":"system.learningassistant.local",
"aliases":{
"/acf-code":"C:\\domains\\acf-lucee-shared\\shared\\la\\Code"
},
"webroot": "C:\\domains\\acf-lucee-shared\\shared\\la\\Code"
},
"openBrowserURL":"<http://system.learningassistant.local:8081>",
"app":{
"cfengine":"adobe@11.0.19+314546"
},
"jvm":{
"javaVersion":"openjdk8_jdk"
}
}
But I am going to try a version without the web.aliases
property.bdw429s
01/11/2023, 6:08 PMbdw429s
01/11/2023, 6:08 PMbdw429s
01/12/2023, 7:35 PM