server.json port and host are ignored

I’m trying to set the host and port in my server.json file.

I did the following:

server set web.host=mytestsite.local server set web.http.port=8080

The json file looks fine when I look at it:

{ "web":{ "host":"mytestsite.local", "http":{ "port":"8081" } } }

When I start up the server, it is started on 127.0.0.1 and it is assigning a random port.

If I then assign a port at startup - e.g. start port=8082 - it will use that port (and will remember it on subsequent starts). But it still ignores the port in the server.json…

I’m running CommandBox 3.3.0+00482.

Am I doing something wrong?

  • Seb

Seth,

What version of Commandbox are you running ( box version )? Also, if you change the host to use 127.0.0.1 does that help. I believe the host needs to be an IP binding as it allows you to listen on a specific IP.

Jon

Hi Jon,

I’m running 3.3.0+00482.

127.0.0.1 is the default that is used, and is what I am trying to get away from. The idea of setting a host name is exactly this, that you can use a hostname (which resolves to 127.0.0.1) instead of the IP…

The main issue is that nothing in my server.json file seems to be used by CommandBox.

  • Seb

OK, so I’m not sure what the issue was…

But I did a complete uninstall/reinstall of CommandBox and everything now seems to be working as expected.

  • Seb