richard.herbert
11/29/2022, 2:18 PMLoadModule proxy_module lib/httpd/modules/mod_proxy.so
LoadModule proxy_html_module lib/httpd/modules/mod_proxy_html.so
LoadModule proxy_http_module lib/httpd/modules/mod_proxy_http.so
LoadModule proxy_ajp_module lib/httpd/modules/mod_proxy_ajp.so
LoadModule modcfml_module lib/httpd/modules/mod_cfml.so
CFMLHandlers ".cfm .cfc .cfml"
ModCFML_SharedKey "mySharedKey"
For each of the sites I have:
<VirtualHost *:80>
ServerName mySite1
ProxyPreserveHost On
ProxyPass / <http://localhost:8500/> nocanon
ProxyPassReverse / <http://localhost:8500/>
ProxyPassMatch ^/(.+\.cf[cm])(/.*)?$ <ajp://localhost:8009/$1$2>
</VirtualHost>
Where the ServerName
changes and the ProxyPass
and ProxyPassReverse
port numbers increment by 1 each time.
For each of the sites I have a similar server.json
{
"name":"mySite1",
"web":{
"host":"mySite1,
"http":{
"port":"8500"
},
"rewrites":{
"enable":"true"
},
"ajp":{
"enable":"true",
"port":"8009"
}
},
"app":{
"cfengine":"lucee@5.3.4+77"
},
"modcfml":{
"enable":"true",
"sharedKey":"mySharedKey"
}
}
Where the values of name/host
and port
change in sync with the Apache settings.
If I start up CommandBox and start my “base” server on localhost:8500 it come up and I can also access the Lucee admin but I don’t see any of the other contexts in the foot of the Admin Overview page.
What am I missing?bdw429s
11/29/2022, 3:11 PMrichard.herbert
11/29/2022, 3:13 PMbdw429s
11/29/2022, 3:15 PMbdw429s
11/29/2022, 3:15 PMrichard.herbert
11/29/2022, 3:16 PMbdw429s
11/29/2022, 3:17 PMbdw429s
11/29/2022, 3:17 PMbdw429s
11/29/2022, 3:17 PMbdw429s
11/29/2022, 3:17 PMbdw429s
11/29/2022, 3:19 PMrichard.herbert
11/29/2022, 3:22 PMModCFML
section in my server.json
So let’s back up a bit. Would you say that my Apache config looks right?bdw429s
11/29/2022, 3:32 PMbdw429s
11/29/2022, 3:32 PMrichard.herbert
11/29/2022, 3:32 PMThey are created automatically as traffic hits the Lucee sever from each webrootSo how do I direct traffic to the one instance of Lucee from each of the webroots is, I guess, the part I’m missing? I’m guessing this line from each vhost is forwarding the request onto AJP on port 8009…
ProxyPassMatch ^/(.+\.cf[cm])(/.*)?$ <ajp://localhost:8009/$1$2>
…and tis section from the one instance of Lucee that is running on CommandBox should be listerning for that request and creating the context on the fly?
"ajp":{
"enable":"true",
"port":"8009"
}
bdw429s
11/29/2022, 3:34 PMbdw429s
11/29/2022, 3:34 PMrichard.herbert
11/29/2022, 3:35 PMNo, not if each virtual host is proxying to a different port, lolSo this should be the same on every vhost?
ProxyPass / <http://localhost:8500/> nocanon
ProxyPassReverse / <http://localhost:8500>
Rather than each be on a different port?richard.herbert
11/29/2022, 3:53 PMProxyPass / <http://localhost:8500/> nocanon
ProxyPassReverse / <http://localhost:8500/>
…now gets all the sites to render the running Lucee instance webroot.
How do I get each context to point to their respective webroot?
I assume I have to control that in the single server.json
but I’ve not seen any setting before that controls that kind of setting?bdw429s
11/29/2022, 4:05 PMbdw429s
11/29/2022, 4:06 PMbdw429s
11/29/2022, 4:06 PMbdw429s
11/29/2022, 4:07 PMbdw429s
11/29/2022, 4:08 PMbdw429s
11/29/2022, 4:10 PMrichard.herbert
11/29/2022, 4:18 PM<VirtualHost *:80>
ServerName mySite1
ProxyPreserveHost On
ProxyPass / <http://localhost:8009/> nocanon
ProxyPassReverse / <http://localhost:8009/>
ProxyPassMatch ^/(.+\.cf[cm])(/.*)?$ <ajp://localhost:8009/$1$2>
</VirtualHost>
Or remove the ProxyPass
and ProxyPassReverse
entries?
Regarding the logging, should I be doing server start --debug --console
to see those headers in flight?bdw429s
11/29/2022, 4:22 PMbdw429s
11/29/2022, 4:22 PMbdw429s
11/29/2022, 4:23 PMrichard.herbert
11/29/2022, 4:30 PMSo it’s possible you’re doing way too much work thereI think you might be right but I’m really flapping around trying to work this thing out. My mental model of waht happening is very poor! So setting…
ProxyPass / <http://localhost:8009/> nocanon
ProxyPassReverse / <http://localhost:8009/>
…produced…
Proxy Error
The proxy server received an invalid response from an upstream server.
The proxy server could not handle the request
Reason: Error reading from remote server
…and removing those entries completely render the default Apache webroot…
It works!
…so that’s not a good idea 😞
So I don’t know how to address your advice…
Are you trying to proxy traffic over 8500 (http) or 8009 (ajp), because it doesn’t make sense to have both
richard.herbert
11/29/2022, 4:51 PM<VirtualHost *:80>
ServerName mySite1
DocumentRoot /path/to/this/sites/webroot/
ProxyPreserveHost On
ProxyPassMatch ^/(.+\.cf[cm])(/.*)?$ <ajp://localhost:8009/$1$2>
</VirtualHost>
I seem to be seeing the right webroot contents but there are still some issues but I’m moving forward!bdw429s
11/29/2022, 6:52 PMbdw429s
11/29/2022, 6:52 PMrichard.herbert
11/30/2022, 10:44 AMrichard.herbert
01/09/2023, 6:19 PM