configure virtual directory mappings

OK so I have not done much with CommandBox except spin up cfdocs.org, so I am very new to how to configure it. When I open box.exe and run it, i see in my users/name folder there is a .CommandBox. THis includes a servers.json file…i don’t think this is the file I need to use to update for virtual directories.

So, when the docs say webRoot for server.json, is that my path say c:\inetpub\wwwroot\testApp
if this is the case, am i creating a new server.json file in that path and it will be seen and read when i do server start in that path?

what is the servers.json file in .CommandBox and is it different from server.json?

So now, i want to create virtual directory mapping like i use in IIS…how and where do i do this? I think it is an alias, but I am not sure how to create it, and then get the server to read it.

Hope this makes sense and someone can give me some simple info.

thanks
Dan

Hi Dan, I’ recommend giving the docs a good read to start. Here’s the start of the section on server.json
https://ortus.gitbooks.io/commandbox-documentation/content/embedded_server/serverJSON/serverjson.html

And here’s the page speific to aliases:
https://ortus.gitbooks.io/commandbox-documentation/content/embedded_server/aliases.html

And to answer your questions categorically;

> THis includes a servers.json file…i don’t think this is the file I need to use to update for virtual directories.

nope, you can ignore that servers.json file. It’s an internal file used by CommandBox to keep track of all the servers you’ve started in the past and what settings you started them with. It’s used for commands like “server info” but you should never need to touch it yourself.

> So, when the docs say webRoot for server.json, is that my path say c:\inetpub\wwwroot\testApp

By default it’s the web root of your server. So if that path above is the web root, then yes that’s where the server.json would go. The first time you start a server and specify at least one parameter to the start command, we’ll create the server.json file automatically for you. Note you can have as many servers in as many directories as you like and they can each have their own server.json fie.

> what is the servers.json file in .CommandBox and is it different from server.json?

The servers.json in the CommandBox home is an internal file to track the servers you have. Ignore that file. The optional server.json in your web root is used to default settings for that server and will automatically get picked up when you run the “start” command.

> So now, i want to create virtual directory mapping like i use in IIS…how and where do i do this?

Read the docs above :slight_smile:

> I think it is an alias, but I am not sure how to create it, and then get the server to read it.

Yep, we call them aliases (like Apache and Tomcat do). Create the config in your server.json and it will get picked up the next time you start the server

Thanks!

~Brad

ColdBox/CommandBox Developer Advocate
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

Thanks a lot Brad…i tried to figure that out from the docs, but something was not clicking…i thought webroot would be like the one I put in this message…now I have to figure out what is going on for me, but this info will push me in the right direction.

Dan

> i thought webroot would be like the one I put in this message

Not sure what you mean by that. The web root can be ANY folder. Remember, CommandBox isn’t like a standard CF install where you configure a single web root for the entire server. CommandBox servers can be started ad-hoc in any folder on your entire hard drive, as many as you want and as often as you want. So if you run the "server start’ command in C:\foo\bar\baz, then that’s now the web root of a new server. Furthermore, if a server.json exists in that folder, it will get picked up and used automatically by the start command.

Thanks!

~Brad

ColdBox/CommandBox Developer Advocate
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

so i found out if you use the newest version of CommandBox things start to work better…now just gotta get the aliases thing to work with my path…but now that i am on a new version of CB, the docs will probably help more.

Dan