Get Started with Service Setup on a Server

A single Windows OS can host many instances of Moxie.Build, these steps will guide you through the setup process.


Windows OS Basics

  1. Moxie.Build in production is compatible with all versions of Windows Server Standard and Data Center that are themselves currently supported by Microsoft
    • At the time of writing, this includes Windows Server 2012R2, 2016, 2019, and 2022
    • Newer versions of Windows Server are in most cases more stable and more secure than older versions, and we encourage you to stay as current as possible
    • The instructions on this page assume the Desktop Experience is running and therefore WoW64 is also installed
      • For those experienced with Server Core installations, note that the Desktop Experience is not required for Moxie.Build to run, but WoW64 is required
  2. If hMailServer will be installed (a lightweight production mail server for outbound connectivity only that works well with SendGrid), first install .Net 3.5 now using the Windows Features app before installing hMailServer
  3. Ensure that all Windows Updates are installed
  4. Follow your company's policies for hardening (securing) a Windows Server and any required management tools


Recommended Folder Structure

The drive letter of C here is just the default; any other fixed drive may be used. Having these folders directly off the root is not required but is recommended to maximize the available file path without creating backup and management tools issues.


Moxies Security Group

  1. Right-click on Start and choose Computer Management
    1. Navigate to System Tools / Local Users and Groups / Groups
    2. Create a New Group named Moxies with a description of Moxie.Build Services
    3. Keep Computer Management open; it will be used below
  2. Click on Start and type Local Security Policy and then open it
    1. Navigate to Local Policies / User Rights Assignment
    2. Add the Moxies group to each of the following Policies. When adding a Group to a Policy, you must click on the Object Types button and check Groups each time
      1. Deny access to this computer from the network
      2. Deny log on as a batch job
      3. Deny log on locally
      4. Deny log on through Remote Desktop Services
      5. Log on as a service


Moxie.Build Instance Users

  1. Return to Computer Management
    1. Navigate to System Tools / Local Users and Groups / Users
    2. Create New Users
      1. The User name of MOX-ABC with ABC being an abbreviation or short name for the Moxie.Build instance you are creating this user for
      2. The description should be the same name used for the folder name of this Moxie.Build instance
      3. The password should conform to your company's policies for Windows Service users
      4. Uncheck User must change password at next logon
      5. Check User cannot change password
      6. Check Password never expires
      7. Click Create
      8. Repeat above for each Moxie.Build instance you are setting up
    3. Add new users to the Moxies Group
      1. (If installing a local security certificate below instead of using the recommended Cloudflare Tunnel, skip this step for now and complete it after the local security certificate is installed)
      2. Open each user created above and navigate to the Member Of tab
      3. Remove Users
      4. Add Moxies
      5. Click Ok
      6. Repeat above for each Moxie.Build instance you are setting up


Apply Folder Security

For each Moxie.Build folder/instance, perform the following steps

  1. Navigate to the folder for that instance and right click and choose Properties of that folder
  2. Navigate to the Security tab
  3. Click the Advanced button
  4. Click Disable inheritance
  5. Choose Convert inherited permissions into explicit permissions on this object.
  6. Click on Ok
  7. Click on the Edit button
  8. Remove Creator Owner
  9. Remove the Users group
  10. Add the Moxie.Build Instance User for this folder and allow Full control
  11. Confirm that the only Group or user names listed are:
    1. System
    2. Your own personal account, and any other personal admin users who should have access to this folder
    3. The Moxie.Build Instance User you added above
    4. Administrators group
  12. Click on Ok
  13. Click on Ok


Inbound Connectivity

The recommended inbound connectivity option is to use Cloudflared Tunnel. This exposes applications running on your local web server on any network with an internet connection with an outbound tunnel that connects directly to Cloudflare's edge network without the need to configure inbound firewall rules.

Alternatively, you can configure inbound firewall rules to allow traffic to arrive from Cloudflare or another web application firewall. If using Cloudflare, they will provide you with a free edge certificate as well as a free local security certificate (origin server). If using another certificate provider, the installation instructions provided under the Cloudflare Origin Certificates topic are the same after the certificate is created.


Installing the Service(s)

For each Moxie.Build folder/instance, perform the following steps

  1. Navigate to the folder for that instance and right-click on Moxie.exe and choose Run as administrator
  2. If using Clouflared Tunnel, you most likely should leave the Listen IP Address set to (Private).
    • Otherwise, select the IP address you have configured with your inbound firewall rules for this instance
    • Selecting All addresses should only be done if there will only ever be one Moxie.Build instance on this server and it will be the only web server on this server
  3. If using Cloudflared Tunnel, set the HTTP port to the same unique port number you choose when configuring the tunnel, found in your Cloudflared/cfg/config.yml file
    • Otherwise, use port 80 in most cases, and also use port 443
      • The Certificate Name should be filled in already from the above local security certificate installation steps
  4. Name of Service should be "Moxie ABC" with ABC being an abbreviation or short name for this Moxie.Build instance
  5. Run Service as this User should be MOX-ABC
  6. If using Cloudflared Tunnel, or just Cloudflare in general, manual edits to the Moxie.cfg file are needed
    1. Close the Moxie.Build Server Setup window
    2. Open the Moxie.cfg file in a text editor
    3. AltIPInfo = CF-Connecting-IP
    4. CountryInfo = CF-IPCountry
    5. Save the Moxie.cfg file and close the text editor
    6. Right-click on Moxie.exe and choose Run as administrator
  7. Click the green [+] Install Service button
  8. Enter the password you set when you created the MOX-ABC user, and confirm it
  9. Click the [>] play button under Moxie.Build Service State to start the service for the first time
  10. If using Cloudflared Tunnel and it is configured correctly, the secondary service for Cloudflared will be installed and you should click on the [>] play button to start it as well
  11. Return to Computer Management and navigate to Services and Applications / Services
    1. Find the service named "Moxie ABC" and open it
    2. Navigate to the Recovery tab
    3. Set all three failure actions to "Restart the Service"
    4. Set Restart service after to 0 minutes
    5. Click on Ok
    6. Repeat the above for "Moxie ABC Cloudflared" if you are using the Cloudflared Tunnel