留言板

How can we mantain 2 liferay code base within single tomcat

thumbnail
Shivansh Sharma,修改在14 年前。

How can we mantain 2 liferay code base within single tomcat

New Member 帖子: 16 加入日期: 09-2-9 最近的帖子
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
thumbnail
Olaf Kock,修改在14 年前。

RE: How can we mantain 2 liferay code base within single tomcat

Liferay Legend 帖子: 6403 加入日期: 08-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,修改在14 年前。

RE: How can we mantain 2 liferay code base within single tomcat

Regular Member 帖子: 103 加入日期: 09-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.


08:42:55,434 INFO  [PluginPackageUtil:1148] Reloading repositories
08: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.
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.
        at com.liferay.portlet.PortletPreferencesSerializer.fromDefaultXML(PortletPreferencesSerializer.java:103)
        at com.liferay.portlet.PortletPreferencesSerializer.fromXML(PortletPreferencesSerializer.java:113)
        at com.liferay.portal.service.impl.PortletPreferencesLocalServiceImpl.getPreferences(PortletPreferencesLocalServiceImpl.java:197)
        at com.liferay.portal.service.impl.PortletPreferencesLocalServiceImpl.getPreferences(PortletPreferencesLocalServiceImpl.java:146)
        at sun.reflect.GeneratedMethodAccessor69.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
.
.
.


Do you have an idea what problem this can be?
thumbnail
Lisa Simpson,修改在14 年前。

RE: How can we mantain 2 liferay code base within single tomcat

Liferay Legend 帖子: 2034 加入日期: 09-3-5 最近的帖子
You will need to change the Root Context on at least one of them in order to make it work...
stefanie radtke,修改在14 年前。

RE: How can we mantain 2 liferay code base within single tomcat

Regular Member 帖子: 103 加入日期: 09-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?
thumbnail
Olaf Kock,修改在14 年前。

RE: How can we mantain 2 liferay code base within single tomcat

Liferay Legend 帖子: 6403 加入日期: 08-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,修改在14 年前。

RE: How can we mantain 2 liferay code base within single tomcat

Regular Member 帖子: 103 加入日期: 09-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!
thumbnail
Olaf Kock,修改在14 年前。

RE: How can we mantain 2 liferay code base within single tomcat

Liferay Legend 帖子: 6403 加入日期: 08-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.