In a Windows Environment
Perform the following procedure to run Code Insight as a Windows service.
To run Code Insight as a Windows service, do the following:
-
Using the command prompt, navigate to this location:
<CODE_INSIGHT_ROOT_DIR>\tomcat\bin -
Stop the Tomcat server. See Enabling Secure HTTP Over SSL.
-
Open the
service.batfile with a text editor. -
Set the
JRE_HOMEandCATALINA_HOMEenvironment variables by adding these lines to the beginning of the file. (You can copy these the variable values from thecatalina.batfile.)set CATALINA_HOME= <CODE_INSIGHT_ROOT>\tomcatset JRE_HOME= <CODE_INSIGHT_ROOT>\jreReplace
<CODE_INSIGHT_ROOT>with the directory path where Code Insight is installed. -
Locate the following variable definition, which sets the minimum size of the Tomcat JVM heap:
"%JvmMs%" == "" set JvmMs=128Replace 128 with 12288:
"%JvmMs%" == "" set JvmMs=12288 -
Locate the
JvmMxvariable definition (just after theJvmMsdefinition). This definition sets the maximum size of Tomcat JVM heap.if "%JvmMx%" == "" set JvmMx=256Replace 256 with 26079 (which is the minimum amount of RAM required for Code Insight on a 32 GB instance).
if "%JvmMx%" == "" set JvmMx=26079noteThe maximum heap size should be no greater than 80 percent of your available memory.
-
Under the
%EXECUTABLE%" //IS//%SERVICE_NAME% ^section, update the following parameters with the highlighted values:-
--Description "``CodeInsight``" ^ -
--DisplayName "``CodeInsight``" ^
-
-
Locate the
--JvmOptionsparameter under the%EXECUTABLE%" //IS//%SERVICE_NAME% ^section, and edit it as follows:-
Locate the
%JvmArgs%option in the--JvmOptionsparameter:--JvmOptions "-Dcatalina.home=%CATALINA_HOME%;-Dcatalina.base=%CATALINA_BASE%;-D%ENDORSED_PROP%=%CATALINA_HOME%\endorsed;-Djava.io.tmpdir=%CATALINA_BASE%\temp;-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager;-Djava.util.logging.config.file=%CATALINA_BASE%\conf\logging.properties;`%JvmArgs%`" ^
Replace
%JvmArgs%with the following two options:-
-Dcodeinsight.ssl=<true/false>—If Code Insight is configured for SSL, configure this option astrue. Otherwise, leave the value asfalse(the default). This value must match the value configured for-Dcodeinsight.sslin the<CODEINSIGHT_ROOT_DIR>\tomcat\bin\catalina.batfile, used to configure Code Insight for HTTPS. See Enabling Secure HTTP Over SSL for details. -
-DcodeinsightInstallPath=<CODE_INSIGHT_ROOT>—Replace<CODE_INSIGHT_ROOT>with the directory path where Code Insight is installed.
noteBe sure to separate the options from each other with a semi-colon (;).
The following is an example:
--JvmOptions "-Dcatalina.home=%CATALINA_HOME%;-Dcatalina.base=%CATALINA_BASE%;-D%ENDORSED_PROP%=%CATALINA_HOME%\endorsed;-Djava.io.tmpdir=%CATALINA_BASE%\temp;-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager;-Djava.util.logging.config.file=%CATALINA_BASE%\conf\logging.properties; -Dcodeinsight.ssl=false; -DcodeinsightInstallPath=D:\codeinsight-0.00.0-00" ^- If Code Insight uses a proxy server, add the following options to the -
JvmOptionsparameter. These options are used to run the proxy server as a service.
noteBe sure to separate the options from each other with a semi-colon (;).
Proxy option In the option, replace... -Dhttps.proxyHost=<HOST> <HOST>with the IP address or hostname for the proxy server.-Dhttps.proxyPort=<PORT> <PORT>with the port used by the proxy server.-Dhttps.proxyUser=<UNAME> <UNAME>with user ID used to log into the proxy server.-Dhttps.proxyPassword=<PWD> <PWD>with the password used to log into the proxy server:
- If you have configured Tomcat Vault to encrypt the proxy password, enter the password alias defined in the vault configuration.
- If you have not configured Tomcat Vault to encrypt the password, enter the plain-text password.
For information about configuring Tomcat Vault to encrypt the password, refer to Configuring a Proxy Connection Using an Encrypted Password.-Djdk.http.auth.tunneling. disabledSchemes Nothing. Specify as is. -
-
Save the
service.batfile and exit the text editor. -
At a command prompt, enter the following command to add a system environment variable with the name
CODEINSIGHT_ROOT. In the command, replace C:\<CODE_INSIGHT_ROOT>with the path of your Code Insight installation directory.
setx CODEINSIGHT_ROOT "C:\<CODE_INSIGHT_ROOT>"
-
Execute the
service.bat installcommand to install the Apache Tomcat Windows service. -
When the service is installed, open Windows Services and search for the Display name you specified in step 7 (in this case, CodeInsight).
-
Right-click the CodeInsight service and select Start.