Running Multiple Instances
Last updated 7/15/2014
- Multiple IP Addresses (one for each Instance.)
- AlwaysUp from www.coretechnologies.com. Install on the server.
- These instructions do not deal with SSL or DNS configuration.
- There are other methods besides using AlwaysUp to manage the server configurations, but none are as good as this option.
- You will have to know how to Publish your application from Alpha Five.
- There is no physical restriction on the number of Instances you can run on a particular server and they are not tied to how many CPUs you have.
- Create a folder on your server as c:\a5\config.
- Create a folder also for c:\a5\logs.
- If not already installed, install one copy of Alpha Web Application Server.
- Fire up the server.
- Look in the "system tray" right-bottom side of the Desktop.
- Click on Configure Server and go through the licensing process under the Sessions tab -- make sure your server is properly licensed at this point.
- Go to the Logging tab and change all of the folder and names for all of the logs (even if you do not check to include the log.) Use this naming structure:
- Access Log - c:\a5\logs\access.log
- Error Log - c:\a5\logs\error.log
- Raw HTTP Log - c:\a5\logs\raw.log
- Xbasic Stack Log - c:\a5\logs\stack.log
- Save and close the configuration dialog.
- Right-click on the red server icon again and select Interactive Window. Enlarge the window if necessary.
- Type "?a5_GetAppServerConfigFile()" in the Interactive Window. This will give you the path to the configuration file. Grab that full path (excluding the file name), and open the config file path.
- Copy the configuration file to c:\a5\config and rename it to Instance1.xml (or any other name such as "myapplication.xml").
- Make as many copies of this file as you need, one for each instance. Rename each to Instance2.xml, Instance3.xml, etc. or some other naming structure.
- Open each configuration file in turn and make the following edits (in order as they appear in the file):
- BindIP = "xxx.xxx.xxx.xx". (Enter a unique IP address for each instance.)
- Access_Log = "C:\a5\logs\myapp_access.log". (Make this specific for your instance.)
- Debugging.RawHttpLogfile = "C:\a5\logs\myapp_raw.log". (Make this specific for your instance.)
- Debugging.XbasicErrorStackLogfile = "C:\a5\logs\myapp_stack.log". (Make this specific for your instance.)
- DOCUMENT_ROOT = "c:\a5webroot\myapplication1". (This is an example, please see my notes on Document Root below.)
- Error_Log = "C:\a5\logs\myapp_error.log". (Make this specific for your instance.)
- Licenses = "xxxxxxxx". (Just make sure your license is entered correctly. It should already be set from the initial configuration.)
- Systray_Title = "My Application ABC". (Enter a value that identifies your instance.)
- Save each xml file.
You should now have one XML file for each instance in the c:\a5\config folder.
- Each Instance needs a separate Document Root. The Document Root is where you publish your Alpha Five web files to and typically look like this: "c:\a5webroot\myapplication1", "c:\a5webroot\myapplication2", etc.
- In your Alpha Five application you will have set up your Publishing Profile to publish the application to this folder.
- If you are hosting on ZebraHost, they look like this: "c:\a5v12\myapplication1", etc.
AlwaysUp is a 3rd party utility that runs the Alpha Web Server as a "Windows service". This means if your server reboots for any reason, the Alpha Web Server will start back up. There are alternatives to AlwaysUp such as the windows utility "srvany" but none provide the desirable extra features found in AlwaysUp.
- Start up AlwaysUp.
- Select Application > Add.
- Enter something like "My Application ABC" in the Name field, something to identify your application for this Instance.
- For the Application field, click the builder and go find your Alpha Five Web App Server EXE file, such as C:\Program Files (x86)\a5V12 ApplicationServer\A5ApplicationServer.exe.
- For the Arguments field, enter your Instance XML file in this format: -ConfigFile=C:\A5\Installs\instance1.xml
- Go to the Extras tab. You can set the Run the application on these CPU(s). But this is not supposed to be necessary, Alpha is supposed to spread instances across the available CPUs.
- Do that for all of your instances.
- There are other configuration settings you can make for AlwaysUp, but this minimal settings should suffice.
- Select Application > Start All (if not already started)
That's it. All of your instances should be running.
You need to complete the process by setting your DNS, etc.