Install Theatre Manager Server

The TM server functions for both web server (using NGINX) and web services. If you have not already done so, please follow the instructions for:
  • downloading and installing TM server for Macintosh or Windows
  • starting the second generation Theatre Manager server for with purposes on the appropriate platform. Theatre Manager server can be configured later:

Only install TM Server ONCE on a machine. Once installed, TM Server will auto update itself.
TM Server should be installed on machines with multiple processors.

For best results, if it is to be used as a:

  • web server - use at least a dual core machine with hyper threading.
  • web services machine - use at least a 4 core machine with hyper threading.

TM Server for OSX

You normally need only install the Theatre Manager server ONCE on a machine per the instructions below. TM server will auto update itself.
In recent versions of OSX, you may need to make a temporary change in System Preferences after downloading the installer and before the installer will work.
Reinstalling TM Server can be done at any time.

Only if you are VERY stuck, you may need to type the following command in terminal prior to re-running the installer.

sudo launchctl unload /Library/LaunchDaemons/com.artsman.theatremanagerserver.plist
Step Action
Step 1 Download and extract the installers for Macintosh.
Step 2 Start the installer and click Continue.

Step 3 Click Continue

Step 4 Read the licence and click 'Agree'

Step 5 Enter your admin password or use your finger if your machine has 'touch id'

Step 6

Step 7 Click Close

Step 8 Turn off all power saving and performance degrading features
Step 9 Turn off Airplay Mirroring in since that has a conflict port port 5000 used by Theatre Manager. This problem seems to have begun in Monterey.
Step 10 Proceed to the Steps to configure the server for the purpose you want to use it for

Starting the NGINX server

Use terminal Start or Stop the Theatre Manager Server on OSX.

Step Action
Step 1 Open Terminal on your computer
Step 2 To completely stop and restart the server (note: it should have already been stopped during the install process), you will need
sudo launchctl unload /Library/LaunchDaemons/com.artsman.theatremanagerserver.plist
sudo chown -R root:wheel /Library/Application\ Support/TheatreManager/
sudo chown root:wheel /Library/LaunchDaemons/com.artsman.theatremanagerserver.plist
sudo launchctl load /Library/LaunchDaemons/com.artsman.theatremanagerserver.plist
Step 3 Use the Director to configure the second generation server for the first time.
Step 4 Disable all Power Saving options on OSX so that the server doesn't go to sleep - its not a good idea for it to so so for web sales. In addition, please read the note below.

on OSX, a user must be AUTO-0logged in to run TM server (classic services) on mac. In most version of OSX, the screen can be locked, but sometimes not. Make the user autologin is set.

~~~ Troubleshooting

You can test and troubleshoot the Theatre Manager Server on OSX using any of the following tools.
Make sure you have disabled all power saving settings by reviewing the installation steps on power saving managment.

Note: if you bring up this web page on the nginx server, the links below should work directly by clicking in them. If not, substitute your web server IP address for 127.0.0.1 in all links below.

Tool Action
Director Use the Director web page to verify the second generation server management process is running.

You can use the console log to verify errors on start up.

  • If you see that it cannot connect to the database, then verify that you put the IP address and Database name into the right fields in the director window
  • If you see a console message that says the schema is incorrect versions, the second gen listener should download the latest and install it. if it does not, manually stop and start the second gen listener via the terminal
  • if you get a message that indicates trouble with editing json preferences, you may need to use the following command in terminal to remove the preferences file and start again.

    sudo rm "/var/root/Library/Application Support/Theatre Manager Server/config.json"

Activity Monitor In Activity Monitor, if you view the list of processes, you should see a number that are named 'Theatre Manager Server' if it started properly.
Virtual Host Test You can test for a direct response to retrieving a page on the virtual server.. If the Theatre Manager Server is on 127.0.0.1, then the link below should elicit a response that shows a page that has not been merged. If you get Page Not Found or some other error, then the virtual host is not set up correctly.

http://127.0.0.1:8111/1/WebPagesEN/tmTickets.html

External Probe If you want to check the general health periodically of the second gen server, then use the following url to ask for the time from the second generation listener. (replace /1/ with your outlet number).

http://127.0.0.1/TheatreManager/1/time

If you want to query through the second generation listener to see if a classic listener is running, then add '&force_proxy' to the url. This talks through the second generation to the classic and, in effect, tests both at the same time:

http://127.0.0.1/TheatreManager/1/time&force_proxy

TM Server for Windows

Do not use Windows 10 or Windows 10 Pro for the TM web services. If at all possible use windows 7, 8, 8.1 or any windows server version. At this time, windows 10 interferes with simple file renaming and affects auto-updating of services.
You normally need only install the Theatre Manager server ONCE on a machine per the instructions below. TM server will auto update itself.
make sure to implement the key performance, similar to that of postgres server, especially turning off windows defender on windows 10 pro if you are having issues with auto-updating.
When installing Theatre Manager Server on a Windows machine, log into the computer as the local administrator. This ensures the proper permissions are assigned to the service.
You must not install or enable Microsoft's IIS server on the same machine as TM server configured for web services.
Step Action
Step 1 Download and extract the installers for Windows. The installer will automatically determine wether you have a 32 bit or 64 bit operating system and install the correct version.
Step 2 Start the installer and click 'Next'

Step 3 Click 'Next'

Step 4 Make sure that the right version (32 or 64 bit) is being installed and click 'Yes'.

Step 5 The installer will place the Theatre Manager Server in 'C:\Program Files' or where ever the standard program files directory is located.

Step 6 Click Done to complete the installation process. By default the Theatre Manager Service will start.
Step 7 Proceed to the Steps on configuring the server

Starting the Server

Use the Windows Services Manager to Start or Stop the Theatre Manager Server.

Step Action
Step 1 Open the Services Administrative tool through Start >> Control Panel >> Administrative Tools >> Services.
Step 2 Locate the 'Theatre Manager Server' item in the list.

It should be set as 'Started'. If it is not, please start it.

Step 3 Double click to edit the service settings to make sure that it will auto-restart. Click on the recovery tab and make it look like the window below. You will need to set the following:
  • First failure to 'Restart the Service'
  • Second failure to 'Restart the Service'
  • Subsequent failures to 'Restart the Service'
  • Restart service after '0' minutes.

Step 4 If the database server and the second generation listener are on the same machine, you will need to delay start of the Second Generation listener until a few system services start. This can be done in one of two ways:
  • Startup setting on the server (windows 2008 server and later) should be set to Automatic. Never set to Automatic (Delay) as it has been found to cause problems.
  • Adding dependancies to the service via the command line (all versions of windows server)

Using Delayed Startup

Make the startup settings as per the diagram.

Adding Service Dependancies

You may want to add a dependancy to the second generation server so that it will not start up until after Postgres and the event log starts.

To do this, you will need to know the name of the postgres service and type a command in at the command prompt. You can find it by looking at the service and examining the service name. It might look something like one of: postgresql-9.5 -or- postgresql-x64-9.5 depending if you are using 32 bit or 64 bit postgres and which version.

An example of the command when running on a 64 bit windows server using postgres 9.5 (note there is a space after the depend= which you must include)

sc config tmserver depend= eventlog/postgresql-x64-9.5

An example of the command when running on a 32 bit windows server using postgres 9.5

sc config tmserver depend= eventlog/postgresql-9.5

When done, check the dependancy tab on the tmserver service and it should show two lines: event log and postgres

Step 5 Also, once everything has been verified to run properly, make sure that the service start up type is changed from 'Manual' to 'Automatic' so that it will start each time the machine is rebooted.
  • Right click on the Theatre Manager Service.
  • Select Properties.
  • From the Startup Type drop down, choose Automatic.
  • Click the Apply button.
Step 6 Use the Director to configure the second generation server for the first time.

~~~ Troubleshooting

You can test and troubleshoot the Theatre Manager Server on Windows using any of the following tools.

Note: if you bring up this web page on the apache server, the links below should work directly by clicking in them. If not, substitute your web server IP address for 127.0.0.1 in all links below.

Tool Action
Task Manager In Task Manager, if you view the list of processes, you should see a number that are named 'Theatre Manager Server' if it started properly.
Director Use the Director to verify the second generation server management process is running.
Event Viewer Test You can look to see if the services start up properly by looking at the event viewer. If you can stop and start the service and you see that it starts listener services on port 5001, then you are likely ok.
Virtual Host Test You can test for a direct response to retrieving a page on the virtual server.. If the Theatre Manager Server is on 127.0.0.1, then the link below should elicit a response that shows a page that has not been merged. If you get Page Not Found or some other error, then the virtual host is not set up correctly.

http://127.0.0.1:8111/1/WebPagesEN/tmTickets.html

Preferences If the second generation listener is having trouble starting and/or keeps stopping, you may want to delete the system profile second gen preferences file and start the configuration process over again
External Probe If you want to check the general health periodically of the second gen server, then use the following url to ask for the time from the second generation listener. (replace /1/ with your outlet number).

http://127.0.0.1/TheatreManager/1/time

If you want to query through the second generation listener to see if a classic listener is running, then add '&force_proxy' to the url. This talks through the second generation to the classic and, in effect, tests both at the same time:

http://127.0.0.1/TheatreManager/1/time&force_proxy

TM Server preference file location

The TM Server configuration or preferences file can be found in the locations described below. If you run into a situation where a TM Server will not start up, you can delete the preferences file and start over.

Windows

  • Navigate to the directory: C:\Windows\system32\config\systemprofile\AppData\Local\Arts Management Systems\Theatre Manager Server
  • Delete the config.json

Macintosh

  • Open Terminal and type:
  • cd ~/Library/Application Support/Theatre Manager Server
  • rm -rf config.json

Special note: for classic listeners run and managed by the TM Server on OSX. There is a temporary file created in /var/root/Library/Caches/Theatre\ Manager\ Server/TheatreManagerRunTime/Libraries that tells the classic listener how to startup. It cannot be edited or changed by a user - it is re-created each time the classic listener starts.

For reference, this link has the location of the Theatre Manager desktop preference file.