Showing posts with label config. Show all posts
Showing posts with label config. Show all posts

Friday, October 28, 2011

To make Tomcat Webserver start automatically on system startup


·         Open <TOMCAT-HOME>\BIN\service.bat  file
·         Look for this line:

"%EXECUTABLE%" //US//%SERVICE_NAME% --JvmOptions "-Dcatalina.base=%CATALINA_BASE%;-Dcatalina.home=%CATALINA_HOME%;-Djava.endorsed.dirs=%CATALINA_HOME%\common\endorsed" --StartMode jvm --StopMode jvm
·         Replace it with something like this:

"%EXECUTABLE%" //US//%SERVICE_NAME% --JvmOptions "-Dcatalina.base=%CATALINA_BASE%;-Dcatalina.home=%CATALINA_HOME%;-Djava.endorsed.dirs=%CATALINA_HOME%\common\endorsed
;-Dfile.encoding=UTF8;-Duser.timezone=GMT;-Djava.security.auth.login.config=%CATALINA_HOME%\conf\jaas.config;" --StartMode jvm --StopMode jvm
·         Also change the maximum heap size of the JVM: (It should be at least 512)

"%EXECUTABLE%" //US//%SERVICE_NAME% ++JvmOptions "-Djava.io.tmpdir=%CATALINA_BASE%\temp" --JvmMs 128 --JvmMx
256
·         Open up a command prompt and navigate to tomcat/bin:

tomcat/bin>service.bat install
·         Type the command services.msc in Start -> Run window
·         Start the Apache Tomcat service and make its startup type as Automatic.

Sunday, March 27, 2011

Tomcat Service is consuming 100% CPU memory

Update the server.xml (tomcatRoot\conf) as follows: 

Existing Settings:

<!-- Define an AJP 1.3 Connector on port 8009 -->
<Connector port="8009"
    enableLookups="false"  redirectPort="8443"  protocol="AJP/1.3"/>


Proposed Settings:

<!-- Define an AJP 1.3 Connector on port 8009 -->
<Connector port="8009"
      enableLookups="false"  redirectPort="8443"  protocol="AJP/1.3"
      maxThreads="50"  minSpareThreads="5"  maxSpareThreads="20"
      acceptCount="100"  connectionTimeout="2000"/>