« 返回到 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

0 附件
60883 查看
平均 (2 票)
满分为 5,平均得分为 4.5。
评论
讨论主题回复 作者 日期
Thanks Jonas. Is there anyone willing to share... C Emerson 2009年11月19日 上午6:43
Thanks a lot Jonas for this article. Has been... Gaurav K Barot 2010年2月3日 上午10:43
Hey Jonas, What the files at... Thiago Leão Moreira 2010年5月4日 上午8:46
HI Thiago, thanks. The exe is coming from Apache. Jonas Yuan 2010年7月9日 下午12:16
Thanks Jonas, By the way, Apache has an... Christopher Lui 2010年5月17日 上午11:41
Thanks, Christopher. It is better to use Apache... Jonas Yuan 2010年7月9日 下午12:17
Hey Jonas, Is this instruction obsolete? I... Erik Wetterberg 2011年1月5日 上午12:34
These instructions were written for Liferay 5.1... Christopher Lui 2011年1月13日 上午11:34
Are there any additional considerations for... Mark Cummings 2011年1月12日 下午12:36
Hello! I followed your suggestions and still... Sonnie Hook 2011年10月26日 下午7:32

Thanks Jonas.
Is there anyone willing to share their experience with a Windows 2003 Server 64-bit OS install of Liferay as well?
在 09-11-19 上午6: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 !!!!
在 10-2-3 上午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
在 10-5-4 上午8: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/
在 10-5-17 上午11:41 发帖。
HI Thiago, thanks. The exe is coming from Apache.
在 10-7-9 下午12:16 发帖以回复 Thiago Leão Moreira
Thanks, Christopher. It is better to use Apache official Tomcat 64 bit binaries.
在 10-7-9 下午12:17 发帖以回复 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??
在 11-1-5 上午12: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.
在 11-1-12 下午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
在 11-1-13 上午11:34 发帖以回复 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.
在 11-10-26 下午7:32 发帖。