« Retour - Custom Deployments

Tomcat 6 as a Windows Service

You may need to run Liferay Tomcat bundle (for both Portal and Social Office) as Windows services. Right?

Best practices#

Best combination should be

  • 1) Window server 2008 64-bit, 64-bit JDK 1.6 and Tomcat 64-bit.
  • 2) Window server 2003 32-bit, 32-bit JDK 1.6 and Tomcat 32-bit.

Limitation for 2) - only 1024MB (JVM parameter) is available.

Current installation: Window server 2008 64-bit, 64-bit JDK 1.6 and Tomcat 32-bit. This is the reason that

a) Tomcat as a Windows service does not work; b) staring time is longer.

Solution: using 1) Window server 2008 64-bit, 64-bit JDK 1.6 and Tomcat 64-bit.

Then we should get:

a) Tomcat as a windows service, JVM can be set as 2048MB or bigger

b) Staring time should be shorter.

How to achieve it?#

The following are sample steps to achieve the goal: Window server 2008 64-bit, 64-bit JDK 1.6 and Tomcat 64-bit.

1) Install Windows Server 2008 (64-bit)

2) Install 64-bit JDK and set $JAVA_HOME

3) Install Liferay-Tomcat 6 bundle

4) Set $JAVA_HOME in $TOMCAT_AS_DIR/bin/setenv.bat

5) Rename tomcat6.exe and tomcat6w.exe at $TOMCAT_AS_DIR/bin/ to a whatsoever names.

6) Download tomcat6.exe and tomcat6w.exe from

Tomcat 6 x64

(for latest 64 bit binaries, refer to http://tomcat.apache.org/download-60.cgi)

And drop them to $TOMCAT_AS_DIR/bin/

7) Start service.bat install tomcat6;

8) Use >tomcat6w.exe ES tomcat6

9) Append these in Java Options:

-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}}}

10) set both Initial and Maximum memory pool to 2048 or bigger;

11) Click on General tab;

12) Click start;

That’s it.

Reference#

Tomcat 6 in Windows 64bit and a 64-JDK 1.6 - JVM -Xmx2048MB

Moyenne (2 Voter)
L'estimation moyenne est de 4.5 étoiles sur 5.
Commentaires
Réponses Auteur Données
Thanks Jonas. Is there anyone willing to share... C Emerson 19 novembre 2009 06:43
Thanks a lot Jonas for this article. Has been... Gaurav K Barot 3 février 2010 10:43
Hey Jonas, What the files at... Thiago Leão Moreira 4 mai 2010 08:46
HI Thiago, thanks. The exe is coming from Apache. Jonas Yuan 9 juillet 2010 12:16
Thanks Jonas, By the way, Apache has an... Christopher Lui 17 mai 2010 11:41
Thanks, Christopher. It is better to use Apache... Jonas Yuan 9 juillet 2010 12:17
Hey Jonas, Is this instruction obsolete? I... Erik Wetterberg 5 janvier 2011 00:34
These instructions were written for Liferay 5.1... Christopher Lui 13 janvier 2011 11:34
Are there any additional considerations for... Mark Cummings 12 janvier 2011 12:36
Hello! I followed your suggestions and still... Sonnie Hook 26 octobre 2011 19:32

Thanks Jonas.
Is there anyone willing to share their experience with a Windows 2003 Server 64-bit OS install of Liferay as well?
Publié le 19/11/09 06:43.
Thanks a lot Jonas for this article. Has been really helpful solving the service related issue !! I had problem with installing Tomcat as a service on Windows 2008 64bit-OS. The wiki has been really helpful and Jonas has helped personally to resolve the issue !! You're a legend mate !!!!
Publié le 03/02/10 10:43.
Hey Jonas,

What the files at http://liferay.cignex.com/palm_tree/book/tomcat6x64 are?? Where did you get them? I'm little worried because they are pre-compiled exe files. Do you have their source code?

Thanks
Publié le 04/05/10 08:46.
Thanks Jonas,

By the way, Apache has an official Tomcat 64bit binaries now on their SVN Repository.

http://svn.apache.org/repos/asf/tomcat/tc6.0.x/tags/TOMCAT_6_0_20/res­/procrun/
Publié le 17/05/10 11:41.
HI Thiago, thanks. The exe is coming from Apache.
Publié le 09/07/10 12:16 en réponse à Thiago Leão Moreira.
Thanks, Christopher. It is better to use Apache official Tomcat 64 bit binaries.
Publié le 09/07/10 12:17 en réponse à Christopher Lui.
Hey Jonas,

Is this instruction obsolete? I have installed the Liferay-Tomcat 6 bundle. I have also (on another port) Tomcat (without Liferay) running as a service. When I try to follow your instructions I cant find Tomcat6.exe or Tomcat6w.exe anywhere in the Liferay-Tomcat 6 bundle. I also can not find service.bat.

What about adding Liferay to my existing Tomcat installation. Is there any instruction for that??
Publié le 05/01/11 00:34.
Are there any additional considerations for upgrading from 5.2.3 to 6.0.x when running Tomcat as a service? All I have seen so far seems to point to doing the upgrades using the standard "batch file" method of running Tomcat. I used this article to help get the Tomcat running as a service so maybe someone reading here may have some experience with upgrading it when it is running as a service. Thanks in advance.
Publié le 12/01/11 12:36.
These instructions were written for Liferay 5.1 and 5.2

Apparently, Liferay 6 bundle doesn't have these files as you've stated. You can download the 5.2 bundle to look at the service.bat.
For the tomcat.exe, please see my comment above to download Apache's official binaries.

As for installing Liferay on an existing Tomcat, there are lots of instructions.
You can find it in the Liferay Admin Guide 4th Edition:http://cdn.docs.liferay.com/portal/6.0/official/liferay-administrator-gu­ide-6.0.pdf

Or http://www.liferay.com/community/wiki/-/wiki/1071674/Installing+6.0+WAR+on+Tomca­t+6/maximized
Publié le 13/01/11 11:34 en réponse à Erik Wetterberg.
Hello! I followed your suggestions and still tomcat6 startups with something wrong.
In stdout:
ERROR [PortalBeanLocatorUtil:42] BeanLocator is null tomcat

in catalina:
Error listenerStart

The whole package is copied from a windows 2003, which is still working good.
Publié le 26/10/11 19:32.