Starting iServer/iPortal/iEdge in the way of the Windows service

Feedback


Starting iServer/iPortal/iEdge in the way of the Windows system service can be achieved by the service.bat script, or the command provided by Tomcat. These two ways need presetting the environment variable.

The following SuperMap iServer example (the same applies to SuperMap iPortal, SuperMap iEdge product), describes how to set up to Windows system services to start. It is recommended that we run cmd.exe as the administrator when operating below:

Deleting Existing SuperMap iServer System Services

If the Windows system service has previous versions of SuperMap iServer services, then you need to remove it at first with the following methods:

Open cmd.exe and then input the following command:

sc delete iServer8C

Open cmd.exe, navigate to [SuperMap iServer_HOME]\bin, and then enter the following command:

service.bat remove

Navigate to [SuperMap iServer_HOME]\bin, and then enter the following command:

tomcat8 //DS//iServer8C

Notice:, if there are old versions iServer in the Windows system service, we should find the service name in the Windows service, then delete it, first method is recommended. e.g.: service name of SuperMap iServer is"iServer8C";so the deleting order is:sc delete iServer8C.

 

Registering a Service

iServer can be registered as the system service in the way of service.bat or Tomcat. service.bat is recommended for the registration.

The service.bat script sets common parameters and values recommended by the Java Virtual Machine, so other settings will not be needed after this script is registered. locates at [SuperMap iServer_HOME]\bin which can perform registering/deleting the service (install/). For instance, open the cmd as an administrator, locates at [SuperMap iServer_HOME]\bin, and then input the install command as follows:

service.bat install

In which, when starting multiple iServer services on a machine, you need modifying the service name of service.bat (i.e., "SERVICE_NAME") so as to avoid the"same name"error of the services as follows:

set SERVICE_NAME=iServer11i(2023)

set PR_DISPLAYNAME=SuperMap iServer 11i(2023)

You can register the "iServer11i(2023)" service by the IS command provided by Tomcat. The string after "// ​​IS//" is the name of the service, which can be modified to your desired name. Navigate to [SuperMapiServer_HOME]\bin, and then enter the following command:

tomcat8 //IS//iServer11i(2023) --DisplayName="SuperMap iServer 11i(2023)" --Install="[SuperMapiServer_HOME]\bin\tomcat8.exe" --Jvm=auto --StartMode=jvm --StopMode=jvm --StartClass=org.apache.catalina.startup.Bootstrap --StartParams=start --StopClass=org.apache.catalina.startup.Bootstrap --StopParams=stop --Classpath="[SuperMapiServer_HOME]\bin\bootstrap.jar; [SuperMapiServer_HOME]\bin\tomcat-juli.jar" --Environment path='%UGO_HOME%\bin;%path%;'

If it is iPortal, change the above - Environment path = '% UGO_HOME% \ bin;% path%;' to - environment path = '% UGO_HOME% \ bin;% path%;'; iPortal = 'true '. If it is iEdge, you need change into --Environment path='[iEdge_Home]\support\SuperMap_License;%path%;';iEdge='true' . [iEdge_Home] represents the iEdge root path, you need replace [iEdge_Home] with the root directory where iEdge is located.

Start/Stop Service

There are 3 ways to starting/stopping the iServer service:

You can see the SuperMap iServer service in the Windows system services after the registration is completed, which can be manually started/stopped or set up to auto-start.

You can start/stop the "iServer 11i(2023)" service with RS/SS provided by Tomcat, or TS which starts the service in the way of debugging. Navigate at [SuperMap iServer_HOME]\bin, and then enter the following command:

tomcat8 //RS//iServer11i(2023)

tomcat8 //SS//iServer11i(2023)

tomcat8 //TS//iServer11i(2023)

You can use the sc start/sc stop command to start/stop the service. Type the following commands in cmd:

sc start iServer11i(2023)

sc stop iServer11i(2023)

Modify Parameters of Virtual Machine

SuperMap iServer presets the recommended values of parameters of virtual machine, which doesn't need setting when the service.bat script is used for registering the service. But it must be set when the Tomcat7 command is used.

Two ways as follows can be used for modifying the parameters of Java virtual machine and other properties of the"IServer11i(2021)"service:

Navigate to [SuperMapiServer_HOME]\bin, enter the following command to start the property about tomcat8w.exe editing the "iServer11i(2021)" service:

tomcat8w.exe //ES//iServer11i(2023)

Click the Java tab to modify memory parameters of the Java virtual machine as shown in the figure below:

In which, -XX: MaxPermSize = 192m as is a separate line, with no spaces before and after.

Click the Startup and Shutdown tab to set the work directory as [SuperMapiServer_HOME]\bin in order to ensure that the log file "iserver.log" specified by a relative path in [SuperMapiServer_HOME]\webapps\iserver\WEB-INF\iserver-log4j.properties is stored in [SuperMapiServer_HOME]\logs.

You can use the //US// command of Tomcat8 to directly update the above parameters. Navigate to SuperMapiServer_HOME]\bin, and then enter the following command to update the property configuration of the "iServer11i(2021)" service:

tomcat8 //US//iServer11i(2022) --JvmMs 256 --JvmMx 512 --JvmSs 512 --JvmOptions="-Dcatalina.base=[SuperMapiServer_HOME];-Dcatalina.home=[SuperMapiServer_HOME];-Djava.endorsed.dirs=[SuperMapiServer_HOME]\endorsed;-Djava.io.tmpdir=[SuperMapiServer_HOME]\temp;-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager;-Djava.util.logging.config.file=[SuperMapiServer_HOME]\conf\logging.properties;-XX:MaxPermSize=192m"  --StartPath="[SuperMapiServer_HOME]\bin" --StopPath="[SuperMapiServer_HOME]\bin"