Home Documentation Administration Running Protege Server as a Windows Service
Running Protege Server as a Windows Service PDF Print E-mail

It is important that the Essential repository server is always running and able to serve requests from its clients, so it should be configured to run as a Service on Windows server platforms. Currently, the Protege software does not include the capability to run as a native Windows service, so the Microsoft SrvAny tool from the Windows Resource Kit should be used.

Warning: The following steps include editing the Windows Registry and should be only be attempted by qualified personnel. If in any doubt, please consult your systems administrator. The Essential Project can accept no responsibility for any errors or failures resulting from editing the registry.
To use the Microsoft SrvAny tool, the Windows Resource Kit must be installed, as follows:
  • Download and run rktools.exe. This is available from Microsoft's website.
  • Install the Resource Kit to the default location, normally C:\Program Files\Windows Resource Kits\Tools
  • Open a Command Prompt.
  • At the command line enter the following commands (each on a single line)
    cd c:\Program Files\Windows Resource Kits\Tools
    instsrv.exe "Essential AM Server" "C:\Program Files\Windows Resource Kits\
    Tools\srvany.exe"

You should receive the following message: "The service was successfully added!"

If you receive the "Unable to find the file at the given path" message, then modify the drive and directory to point to the location of the srvany.exe file

Next edit the registry entry for the new service as follows:
  • Press Start->Run and type regedit
  • Locate the following subkey in your registry display:
    • HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\EssentialAM Server
  • Right-click the Essential AM Server subkey, and click New --> Key.
  • Enter the following command: Parameters
  • Right-click the Parameters subkey, and click New --> String Value.
  • Enter the following command: AppDirectory
  • Right-click the AppDirectory subkey, and click Modify.
  • Enter the following command, where C:\Program Files\Protege_3.3.1\ is the path to where you have installed Protege:
    • C:\Program Files\Protege_3.3.1\
  • Right-click the Parameters subkey, and click New --> String Value.
  • Enter the following command: Application
  • Right-click the Application subkey, and click Modify.
  • Enter the following command: run_protege_server.bat
  • Close the registry editor.

Next, open the Services panel from Start->Settings->Control Panel->Administrative Tools->Services. In the list of services, you will see "Essential AM Server". Start this service to start the Protege Server. Then, double click on this service and set it to have Startup Type set to "Automatic".

NOTE: It is normal for this to show in the list of services as not started, even when the Protege Server is actually running because the service invokes a batch file, which in turn invokes a batch file.
This solution, Windows Server 2003 Resource kit, enables a batch file to be started via a Service. Full Service-style behaviour may not operate as expected (e.g. start / stop) as the Essential server startup program is a Windows batch file that invokes 2 separate executables. To this end, a shutdown command is provided to gracefully stop the Protege server. Stopping the service from the control panel will NOT stop Protege server.

Defining Essential AM Server Service Dependencies

Where a database-based repository is used, the Essential Server will not start up correctly if it cannot establish a connection to the database that is now hosting the repository. To help with the automatic startup of the Essential Server, define a dependency between the Essential AM Server service and another service, such as your database server instance (if it is co-located with Essential) or with Tomcat (used for the Essential Viewer):

  • Start->Run->regedit32
  • Go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\EssentialAM Server
    • Click Edit -> New Multi Size String Value (REG_MULTI_SZ)
    • Value name must be 'DependOnService' [without the ' ']
    • Double click to edit its data value and a dialog asking for data values will appear.
    • Enter the name of the service that Essential depends on - 1 per line
      • For MySQL, enter MySQL
      • For Tomcat, enter Tomcat5
  • Exit from regedit
  • Check that the dependency appears correctly in the Control Panel, Services entry for the Essential AM Server.
 
Related Articles