I'm looking to use CommandBox as my webserver in p...
# box-products
d
I'm looking to use CommandBox as my webserver in production but not front it with IIS or Apache. How do I get CommandBox to listen for the incoming domain name like example.com ? Setting web.host in the server.json doesn't seem to do it? And what if I wanted to listen for more than one domain - example.net - and what if I wanted to listen for a static site - example.org with no cfml just a front-end framework like React as well at the same time? So I guess I'm asking, how do I use CommandBox as a complete replacement for IIS?
p
Use NGINX 😎 and do a simple reverse proxy to your commandbox
d
Yes, I know I can use IIS / Apache / NGINX as a proxy but @bdw429s keeps promoting CommandBox as a complete web server replacement and I want to try that.
t
read about the hosts file and what it does
b
@dick It's not clear from your question if you are testing the new multi-site mode in CommandBox 6, or just starting a single site
In single site (how CommandBox has traditionally worked) there is no concept of host header checking as all HTTP requests coming in your HTTP/S port is just directed to the only site to exist.
So, in that mode, CommandBox itself doesn't really need to know or care what the domain(s) are. You just tell CommandBox what IP:port the to bind to and it does its thing
Now, if you're asking how to make your BROWSER resolve example.com to a local address, that's a different question entirely. I would recommend looking at the
commandbox-hostudpater
module for that, but it's just for local development, not for production deploys.
what if I wanted to listen for a static site - example.org with no cfml just a front-end framework like React as well at the same time?
Again, here I'm not quite sure if you're trying to setup multi-site or just a separate standalone server on its own port. CommandBox can do either, it's just not clear what you're looking for. To start a site with no CF Engine, run
Copy code
start cfengine=none
https://commandbox.ortusbooks.com/embedded-server/start-html-server
d
@bdw429s Is CommandBox 6 available for production yet? Has the number of sites the free version will support been decided yet? So CommandBox 5 only supports a single site? All requests received by the server get funnelled to the one IP/host combination? I guess I'm asking about multi-site support, and that's only with CommandBox 6?
b
Is CommandBox 6 available for production yet?
I'm winding down the release at this point and asking people to test. Whether you want to use it on production now is up to you 🙂
Has the number of sites the free version will support been decided ye
Unlimited for non-production servers. 2 free sites for production. A CommandBox Pro license also comes with a bunch of add-ons like ForgeBox and cache licenses.
So CommandBox 5 only supports a single site?
A single site PER SERVER. So you can start up as many servers (separate Java processes) as you like. CommandBox 5 also has native ModCFML support, so you can technically have more than one site, but it's limited and needs a web server in front to send the special ModCFML headers.
All requests received by the server get funnelled to the one IP/host combination?
Funneled from the IP:_port_ combination. If you have more than one server, they can be listening on different IPs/ports.
I guess I'm asking about multi-site support, and that's only with CommandBox 6?
The complete docs for multi-site is next on my list. Right now, you can check out this slide deck from Into The Box https://twitter.com/bdw429s/status/1659262788135518208 And I've also created this huge repo of example that basically demonstrates all the possible configurations of Multi-site and more. Check out the readme files in each folder. These should all be more/less runnable examples you can test locally. https://github.com/Ortus-Solutions/commandbox-tests
d
All understood, thank you.
b
👍 Please do ask any more questions you may have. I know without the full docs it may not be completely clear. Especially if you're not 100% familiar with CommandBox already.
I would recommend a new thread for new questions just since you're more likely to get other people to jump in an answer 🙂
👍 1