When I issue the CommandBox directive: server start, I have no way of firing up a browser and go to http://127.0.0.1:34745/
Well, if you’re SSHing into a remote machine that has no GUI, then you obviously can’t open a browser on that machine. Unless, of course, you intend to open the browser on your own machine. In which case, I would recommend you double click the icon for your browser app. Of course, it won’t be 127.0.0.1 from your machine, but that depends on a lot of networking details you left out of your question above. If you’re simply wanting to test that the server is up from the Linux box, you can use curl
.
(34745 is the port number CommandBox assigns every time I start the server)
To be clear, CommandBox may have randomly chosen that port the first time, but you can set any port you like for your CommandBox servers. Find the docs here: Legacy Port & Host syntax | 6.0.0 | CommandBox : CLI, Package Manager, REPL & More
The CentOS server has a static IP address 39.106.193.68 and a domain name, but http://39.106.193.68:34745 gives an page not found error.
Hold on, there’s a lot of pieces you just glossed over. In order for you to hit the URL you showed above
- CommandBox must be bound to an external IP. If you’re just doing a vanilla out-of-the-box
server start
with no other settings, it’s going to bind to 127.0.0.1 which isn’t accessible externally. It’s wizarding law.
- The HTTP port must not be blocked by a firewall. If there is a firewall either on the CentOS box or “in front” of it that only allows standard ports through, you may not be able to reach that specific port. This is something you’ll need to verify in your networking setup.
- What exactly is this “page not found” error? Can you provide a screenshot or something? Is your browser saying it can’t connect? Are you hitting something that’s returning a web server error? Are you getting a status code or a connection failure?
So, I don’t know how to go any further.
Start with the questions above. Binding to the external port is most likely at least one of your problems. The quick fix for it is to set the host to 0.0.0.0 which binds to all IPs.
If you could give me a few pointers, it would be great.
Read through the entire “Embedded Server” section of those docs and it will likely answer a lot of your questions.