Running Liferay 6 Tomcat 6 as windows service
It is a very common scenario wherein, when you deploy liferay on Windows environment , you need to run tomcat as windows service. In this blog, i will list the steps to run tomcat as windows service.
- Windows Server 2008 RC2 – 64 Bit
- Liferay 6EE SP2 – tomcat 6.0.32
- Sun JDK 64 bit
- LIFERAY_HOME is reffered as location where liferay bundle in unzipped.
1) Setting up JAVA
- set JAVA_HOME variable
- Copy the folder JAVA_HOME/jre/bin/server, rename the new copy of the folder as jre/bin/client.
- So you JAVA_HOME/jre/bin will have 2 folder of same file
2)Download tomcat 64 bit installables.
- You can get the desired version of Apache Tomcat 32 bit/64 bit from Apache tomcat archive site http://archive.apache.org/dist/tomcat/tomcat-6/
- In my case i am doing for Liferay 6EE SP2 which comes with tomcat 6.0.32 so I downloaded following version of 64 bit tomcat.
- Unzip the above archive
- go to apache-tomcat-$VERSION\bin
- copy tomcat6.exe, tomcat6w.exe, service.bat from above in to LIFRAY_HOME\tomcat\bin
- Please take back up of above files in LIFRAY_HOME\tomcat\bin if they already exist.
3)Setting Up the service
a) Open the commad prompt (Make sure you have admin rights or run the command prompt as administrator)
b) In Command Prompt go to LIFERAY_HOME\tomcat\bin
c) Execute the following command
service.bat install tomcat6
This will install the tomcat6 service in windows. Please see the image below for reference
d) Now execute following commond to setup additional configuration for the services
tomcat6w.exe ES tomcat6
You will see the following window -
e) Set the following in General Tab:
- Display Name:
- Startup Type:Automatic
f) Go to Java Tab of above window (Please see the attached image below
g)Set Initial Memory Pool, Maximum Memory Pool.
h) Append Following in Java Options text box
-XX:MaxPermSize=512m -Dfile.encoding=UTF8 -Duser.timezone=GMT -Djava.security.auth.login.config="%CATALINA_HOME%/conf/jaas.config" -Dorg.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES=false
4) Starting the Service
Once all the set up is done. Go to Startup menu -> Run -> type services.msc
It will open all the windows services. you can select your one and perform operations like start, stop etc
In case of any doubt, feel free to shoot me any questions through comment box.