INFO 2480-61: Website Database Implementation
  • Syllabus
  • Welcome Letter
  • Week 1: Software and Setup
    • Folder Structure
    • Git: Getting Started
      • Installing a Git Client
      • Creating a Local Repository
      • Making Changes and Merging them
      • Git Wrap Up
    • Git: Github
      • Creating a New Account
      • Creating a Repo on Github
      • Cloning and Forking
      • Cloning a Repo from Github
      • Pushing Changes to Github.com
      • Github: Adding a Collaborator
    • Command Box
      • Downloading the Software
      • Unzipping and Running the Software for the first time
      • Using CommandBox And Installing the UML-Info package.
      • Setting Up Your Local Server
      • Last Step
    • IDE ( Integrated Development Environment )
      • VS Code
      • IntelliJ
    • Journal
  • Week 2: Review of HTML and CSS
    • Making Point In Time and Working Branches
    • Opening our Project from Week 1 and Starting our BoxLang server
    • HTTP Calls and Requests
    • Making a Static Website Dynamic
    • Creating The Management Index.bxm
    • Creating An HTML Form with Bootstrap
    • Last Steps
  • Week 3: Working Forms and our First Table
    • Data Types
    • Case Types and Naming Conventions
    • Database Tools and Your First DB
      • Installing MySql WorkBench
      • Connecting to your MySQL database
      • Creating Your First Table
    • Working Forms
      • Separation of Concerns
      • Configuring Our Site To Use Our Database
      • Capturing Your Form Data
      • Creating Our Server Side Logic
  • Week 5: SQL and Modelling
    • Our Project And Its Users
    • Introduction to SQL
    • Completing our Articles page.
      • Adapting manageArticles.bxm to display existing articles in the database
      • Completing ManageArticles.bxm to Edit Existing Articles.
      • Making Active Articles Appear On The Public Page
  • Week 6: Managing Books
    • Introduction To Modelling
    • Our Data Models
    • Adapting Our Management Page To Be Multi-Tool
    • Creating The Manage Books Page
    • Adding Search To Our Front Index Page
  • Week 7: Working with Selects, Files, WYSIWYG and more.
    • Adding WYSIWYG Capabilities
    • Adding WYSIWYG to the Manage Books Tool
    • Adding Images To Our Store
    • Creating Our Publisher Select Control
  • Week 9: Joins and Better Searching
    • Displaying Our Publisher
    • Searching By Publisher
    • Creating a Browse by Genre
      • Adapting Our Database
      • Building our Queries: Part 1
      • Assigning Genres to a Book in our AddEdit.bxm page
      • Building our Queries: Part 2
      • Building the GenreNav.bxm
      • Adapting The Details.bxm Page to Search By Genre
  • End of Project Checkllist
Powered by GitBook
On this page
  • Starting a Server
  • Configuring The Server
  1. Week 1: Software and Setup
  2. Command Box

Setting Up Your Local Server

Goal: By the end of this document you'll have started a web server and BoxLang scripting engine on your local machine.

PreviousUsing CommandBox And Installing the UML-Info package.NextLast Step

Last updated 4 months ago

Starting a Server

  1. From Commandbox and inside the ongoingWork folder, type server start. Wait a minute while the web server and the BoxLang server are configured. A browser will open and you’ll see the main page of a website.

  2. Pay close attention to the address in the address bar. It will look something like :#####/. This means that the page is being served off of a web server on your machine over the IP address 127.0.0.1, which always refers to the local machine no matter what, and can be viewed over port ##### (a number). This is very important to include. If you just type in , you will not get this site. You might want to bookmark this address or simply remember that you can go back to CommandBox to type server open to open the browser again.

  3. You can stop the server by typing server stop and enter in CommandBox from the same folder in which you started the server. This last part is important. If you type server start in a different folder, a new server will start on a different port and you will have two running at the same time. This is very handy if done deliberately but can be confusing if it isn't.

Configuring The Server

In the same folder, there is a file named server.json which has information about this particular server. Since 127.0.0.1:#### can be difficult to remember, let's adapt the server configuration to use an easier to remember address. To do that we will need to run CommandBox as an administrator.

  1. Close CommandBox by either typing exit from the prompt or clicking the X on the window.

  2. Re-open CommandBox but this time, do it running as the Administrator. On Windows, right click on the box.exe file and choose Run As Administrator. On a Mac, this might mean opening terminal, navigating to where you unzipped the box application and then typing sudo box . You might need to install your Admin password after doing that.

  3. We need to install another package that is actually for CommandBox itself, not our app specifically. Type install commandbox-hostupdater.

  4. Once that installs we are going to make some settings changes. Think of a domain name that you'll remember like webclass.local or something like that. It can literally be anything. I just use the .local to remind myself that it is on my computer and not on the web. Type server set web.host=webclass.local. Then type server restart. If you get an error, try server restart again. Sometimes the hostupdater needs to navigate some permissions and it errors.

  5. Once the server restarts, type server open to open the browser to the new address. It should say webclass.local:######. We've changed the address in the nav bar, but not the port.

  6. Go back to CommandBox and type server set web.http.port=80 and type server restart then server open after the server restarts. You should see webclass.local in the address bar.

  7. If you are done working on this for now, type server stop.

That’s it. You can read more about CommandBox in the online documentation at

IMPORTANT: The installation we did with CommandBox is on YOUR computer and can not be seen by anyone else without additional configuration.

http://127.0.0.1
http://127.0.0.1
https://commandbox.ortusbooks.com/