Development site - hostname - basics

Hopefully someone can lead me by the hand a bit.

I’m having trouble trying to figure out how to do this, it seems like the limited information found it would be simple enough, but it doesn’t work as slick as the video and posts.

I am wanting to work locally on my Windows machine using AFC 2016 and want to use a hostname like website.local instead of ip address with port number (127.0.0.1:xxxx)

Here is what I do and the outcome never changes

I run powershell as administrator

I go to the root directory of the website

box

server start port=80 host=website.local cfengine=adobe@2016

** it flashes by quickly, but there is a red error message that says something like "you requested port [80] … (I can’t read it all before it disapears)

When it loads, it opens up website.local:xxxx (adding the port) which loads up the page up fine … if I try to remove the port it throws a 500 internal error message.

Any idea/suggestions?

Thanks
Paul

I did find Brad Wood’s post on configuring listeners in IIS but that is something I’m not sure how to do either - its probably the solution.

Install the command host update from forge box and it should work that way. Also make sure you’re running box as admin or sudo for ports under 1024.

https://www.forgebox.io/view/commandbox-hostupdater

Yes using hostupdater and running box as administrator

Because we can’t see the full error, I’m pretty confident this error only happens on two occasions… you’re not running that terminal session with admin privileges or that port is already in use.

But since you say ur running as administrator, it’s probably the latter.

run your command again with debug flag so you can see the full error

server start port=80 host=website.local cfengine=adobe@2016 --debug

also, troubleshoot the possible port conflict. It’s been awhile since i did this on windows so for your reference…https://stackoverflow.com/questions/48198/how-can-you-find-out-which-process-is-listening-on-a-port-on-windows

Yes, like Adrian said run with --debug to see the full error. It sounds like port 80 is already bound on your machine and CommandBox is choosing a random port for you. The host updater module specifically is required to automatically edit your hosts file. I will warn you to be careful of the TLD local as some browsers have special behaviors. If my prod URL is www.mysite.com I prefer to use a dev URL of devwww.mysite.com so it’s more consistent and avoids “fake” TLDs that can cause issues.

So it looks like port 80 is already in use error below:

You asked for port [80] in your start params but it’s already in use so I’m ignoring it and choosing a random one for you.

How do I get around this (sorry if basic question).

Paul

Use netstat to as your OS what process has port 80 bound. On Windows, it should be something like

netstat -bano

This will filter to port 80, but Windows stupidly spans multiple lines with the output so you can’t see the process name

netstat -bano | find “80”

It’s probably IIS, which binds to all addresses by default. If you aren’t using IIS, disable it. If you are using IIS, then change the default site (or all the sites) to bind only to 127.0.0.1 specifically and then install the host updater module in CommandBox. It will use a different localhost address for every site 127.127.0.1, 127.127.0.2, etc and then separate processes can bind the same port on different addresses.

Perfect … basically uninstalled IIS and now everything works as it should.

I’m sure I will have other questions

Thank you!