组合视图 统一视图 树状图
讨论主题 [ 上一个 | 下一个 ]
toggle
Shivansh Sharma
How can we mantain 2 liferay code base within single tomcat
2009年5月5日 上午7:01
答复

Shivansh Sharma

等级: New Member

帖子: 16

加入日期: 2009年2月8日

最近的帖子

Hi EveryOne,
Can it possible to mantain 2 liferay code base with in a single tomcat.

Wheather we can hosted seperately within a tomcat. (May be treating the two different website).

Or it may possible of cloning of portlets. (like deploy as seperate war file).

Or it is possible through virtual hosting.

Or it is possible through extension environment.

Thanks & Regards,
Shivansh Sharma
Olaf Kock
RE: How can we mantain 2 liferay code base within single tomcat
2009年5月5日 上午10:16
答复

Olaf Kock

LIFERAY STAFF

等级: Liferay Legend

帖子: 3523

加入日期: 2008年9月23日

最近的帖子

What's the rationale behind wanting that? Is it to operate different versions, separate databases, separate live/staging/testing?

I'd guess that different versions on the same tomcat don't work as liferay uses several shared libraries that are not necessarily the same version for different releases.

To separate databases (e.g. for multiple customers) you could try "database sharding" which is just in development for 5.2.3 as I understand. Search the Wiki or the forum for "database sharding" to get more info.

If somehow possible, make your life easier and install two tomcats with one liferay each. Edit all port="xxxx" attributes in conf/server.xml - I have an installation like this (different liferay versions even) without problems, all on the same machine.

Additional benefit is that you can restart each instance separately and have independent downtimes. Should one need to restart, the other can continue to run.
stefanie radtke
RE: How can we mantain 2 liferay code base within single tomcat
2009年11月2日 上午2:27
答复

stefanie radtke

等级: Regular Member

帖子: 103

加入日期: 2009年3月19日

最近的帖子

Olaf Kock:


If somehow possible, make your life easier and install two tomcats with one liferay each. Edit all port="xxxx" attributes in conf/server.xml - I have an installation like this (different liferay versions even) without problems, all on the same machine.



I tried this solution and copied an existing liferay bundle (it runs at the moment on a different machine) on a server where another liferay installation is allready running. I copied the complete directory with liferay and tomcat, exported the existing database and change the port numbers in the server.xml file in the copied bundle from 8xxx to 9xxx. When I start the copied server I get following Error.

 1
 208:42:55,434 INFO  [PluginPackageUtil:1148] Reloading repositories
 308:42:55,470 ERROR [LDAPImportJob:65] com.liferay.portal.SystemException: com.liferay.portal.kernel.xml.DocumentException: Error on line 1 of document  : XML document structures must start and end within the same entity. Nested exception: XML document structures must start and end within the same entity.
 4com.liferay.portal.SystemException: com.liferay.portal.kernel.xml.DocumentException: Error on line 1 of document  : XML document structures must start and end within the same entity. Nested exception: XML document structures must start and end within the same entity.
 5        at com.liferay.portlet.PortletPreferencesSerializer.fromDefaultXML(PortletPreferencesSerializer.java:103)
 6        at com.liferay.portlet.PortletPreferencesSerializer.fromXML(PortletPreferencesSerializer.java:113)
 7        at com.liferay.portal.service.impl.PortletPreferencesLocalServiceImpl.getPreferences(PortletPreferencesLocalServiceImpl.java:197)
 8        at com.liferay.portal.service.impl.PortletPreferencesLocalServiceImpl.getPreferences(PortletPreferencesLocalServiceImpl.java:146)
 9        at sun.reflect.GeneratedMethodAccessor69.invoke(Unknown Source)
10        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
11        at java.lang.reflect.Method.invoke(Method.java:597)
12        at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
13.
14.
15.


Do you have an idea what problem this can be?
Lisa Simpson
RE: How can we mantain 2 liferay code base within single tomcat
2009年11月2日 上午6:44
答复

Lisa Simpson

等级: Liferay Legend

帖子: 2034

加入日期: 2009年3月5日

最近的帖子

You will need to change the Root Context on at least one of them in order to make it work...
stefanie radtke
RE: How can we mantain 2 liferay code base within single tomcat
2009年11月3日 下午11:45
答复

stefanie radtke

等级: Regular Member

帖子: 103

加入日期: 2009年3月19日

最近的帖子

I solved the problem I wrote. The database was incorrect exportet. The two systems are running but I guess I must login more often in the two systems.

@Lisa Simson - Thanks for your reply what must I change in Root Context. I guess you mean the ROOT.xml.

@Olaf Kock - Is this kind of installation adaptive for a live running system?
Olaf Kock
RE: How can we mantain 2 liferay code base within single tomcat
2009年11月10日 下午1:51
答复

Olaf Kock

LIFERAY STAFF

等级: Liferay Legend

帖子: 3523

加入日期: 2008年9月23日

最近的帖子

stefanie radtke:
@Lisa Simson - Thanks for your reply what must I change in Root Context. I guess you mean the ROOT.xml.


it's ROOT.xml, webapps/ROOT/ and an entry in portal-ext.properties (from memory: portal.ctx - you should verify this...)

stefanie radtke:
@Olaf Kock - Is this kind of installation adaptive for a live running system?


I hope to understand the question correctly - I have an installation of 5.2.2 and 5.2.3 on the same box on two different tomcats (I've installed both bundles). I've changed the ports tomcat uses on both installations, as there's an additional third tomcat installed that uses the default ports. All portals are served through a frontend apache, mod_jk, so that no port issues are reflected on the front end.
stefanie radtke
RE: How can we mantain 2 liferay code base within single tomcat
2009年11月12日 下午11:45
答复

stefanie radtke

等级: Regular Member

帖子: 103

加入日期: 2009年3月19日

最近的帖子

I have an installation of 5.2.2 and 5.2.3 on the same box on two different tomcats (I've installed both bundles). I've changed the ports tomcat uses on both installations, as there's an additional third tomcat installed that uses the default ports.


I have 5.2.2 and 5.2.3 on the same box to. Every installation has it's own tomcat. Just installed the two bundle packs. On one installation I changed the ports in server.xml.

it's ROOT.xml, webapps/ROOT/ and an entry in portal-ext.properties (from memory: portal.ctx - you should verify this...)


What do you mean with portal.ctx and memory can you give me an detailed example?

Thanks allot for your help!
Olaf Kock
RE: How can we mantain 2 liferay code base within single tomcat
2009年11月13日 上午12:58
答复

Olaf Kock

LIFERAY STAFF

等级: Liferay Legend

帖子: 3523

加入日期: 2008年9月23日

最近的帖子

stefanie radtke:
What do you mean with portal.ctx and memory can you give me an detailed example?


When I answered your question I had no access to the installation, so the "memory" was my personal memory.

My memory served me well, "portal.ctx" is the option that you use in portal-ext.properties to name the context you deploy liferay as. I have installed both bundles under different context names, e.g. I've changed webapps/ROOT to webapps/app1, thus set "portal.ctx=/app1" as opposed to the default "/". The URLs to this installations all (except themes and additional portlets) start with app1, e.g. http://www.example.com/app1/web/guest/home.

If you don't change the context name, you don't need this option. As I have the habit of using mod_jk to couple apache and tomcat, I like to have the ability to specify the URL roots that tomcat serves, so I usually don't deploy tomcat's root context to apache.

Hope this helps.