Starting Liferay as a Windows Service

Instructions #

From {tomcat_dir}/bin, type:

 service install [service_name] (i.e. service install Liferay)

That will install Liferay as the service name, and register it as "Apache Tomcat Liferay" within Windows' Service viewer.

Then to edit, again in {tomcat_dir}/bin, simply type:

 tomcat5w //ES//[service_name] (i.e. tomcat5w //ES//Liferay)

This will bring up a GUI where you can then change the service's settings. You will want to do the following:

In the Java tab:

Make sure "Use default" is unchecked. Point your Java Virtual Machine to:

 C:\Program Files\Java\jdk1.5.0_08\jre\bin\server\jvm.dll

(obviously point this to the right version JDK that you have, as installation may differ)

Add the arguments to the Java Options:

 -Dfile.encoding=UTF8
 -Duser.timezone=GMT
 -Djava.security.auth.login.config={tomcat_dir}\conf\jaas.config

replacing the {tomcat_dir} with the full directory path of your liferay installation.

Change the Initial memory pool & Maximum memory pool to 512 and 1024 respectively.

In the Startup tab: (optional)

Change the working directory to the full directory path of the bin folder from your liferay installation (ex. : C:\Program Files\Liferay\Social Office 1.0b1\bin). This is handy when liferay's HSQLDB Database (lportal.script) is already in the bin folder (the default) and we still want to use it.

HSQLDB database #

If you are using HSQLDB as your database (the default) then you will either need to set the services' working directory or you could explicitly state where the HSQLDB files are located. To do this, edit the ROOT.xml configuration file in %TOMCAT_HOME%\conf\Catalina\localhost

Modify the url line to include the path to the HSQLDB database by adding ${catalina.home}/bin/

  url="jdbc:hsqldb:**${catalina.home}/bin/**lportal"

Removing the Service #

To remove the window service for tomcat, which in this case is named 'Tomcat5'

  tomcat5 //DS//[service_name] (i.e. service //DS//Liferay)

Other options #

Alternatively it is also possible to use JavaService: http://javaservice.objectweb.org/

0 添付ファイル
47315 参照数
平均 (0 投票)
平均評価は0.0星中の5です。
コメント
コメント 作成者 日時
This does not seem to work with tomcat6 and... uwe lynen 2008/10/03 12:32
Hi Uwe, Did you figure out how to make this... Richard Becher 2008/10/10 8:45
It does not work, because -XX:MaxPermSize is... Fabian Barney 2008/11/07 5:35
I seem to have trouble with Liferay bundled... Ben L 2009/03/30 16:58
I have not managed to get this to work... justin van didden 2009/04/02 0:08
Folks, Yo uhave to visit below link for the... Chirag Suthar 2009/10/15 4:32

This does not seem to work with tomcat6 and liferay 5.1.1
Uwe
投稿日時:08/10/03 12:32
Hi Uwe,

Did you figure out how to make this work using 5.1.1 and tomcat6?

Thanks!

Richard
uwe lynenへのコメント。投稿日時:08/10/10 8:45
It does not work, because -XX:MaxPermSize is NOT set by default when running Liferay as Windows Service.

Setting this param to 128m fixed the problem and it runs without any problems until now.
投稿日時:08/11/07 5:35
I seem to have trouble with Liferay bundled with tomcat 5.2.2.

It works fine if I run the'startup.bat' but when I try to follow these instructions, the service does not start and gives this exception in the log:

23:55:27,341 ERROR [ContextLoader:215] Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.liferay.wol.service.JIRAActionLocalService.impl'........

Does this also have to do with the jvm.dll I'm pointing to? I'm pointing to the JVM that came installed with the bundle.
投稿日時:09/03/30 16:58
I have not managed to get this to work either.... has anyone got any better sugestions?
Ben Lへのコメント。投稿日時:09/04/02 0:08
Folks,
Yo uhave to visit below link for the solution.


http://www.liferay.com/web/guest/community/forums/-/message_boards/mess­age/3215420
justin van diddenへのコメント。投稿日時:09/10/15 4:32