留言板

Install 2 Liferay on a server

L'Hostis Eric,修改在14 年前。

Install 2 Liferay on a server

Junior Member 帖子: 39 加入日期: 08-11-20 最近的帖子
Hi,

I need to install 2 "instances" of Liferay on my server.
Is it possible ?

My first instance works good since 1 year.
I've tried to copy the second instance like a new APP in tomcat.

In the server.xml, i have added an APP :


<host name="www.secondapp.com" appbase="secondapp" unpackwars="true" autodeploy="true" xmlvalidation="false" xmlnamespaceaware="false">
      </host>



Then, I have copied all the file in the secondapp directory.

When I launch tomcat, I have a lot of error :


org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateMBeanExporter' defined in class path resource [META-INF/hibernate-spring.xml]: Invocation of init method failed; nested exception is org.springframework.jmx.export.UnableToRegisterMBeanException: Unable to register MBean [com.liferay.portal.dao.orm.hibernate.jmx.HibernateStatisticsService@1690d7a] with key 'Hibernate:name=statistics'; nested exception is javax.management.InstanceAlreadyExistsException: Hibernate:name=statistics
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1338)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)
at com.liferay.portal.spring.context.PortalContextLoaderListener.contextInitialized(PortalContextLoaderListener.java:49)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4342)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:926)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:889)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1149)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:516)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: org.springframework.jmx.export.UnableToRegisterMBeanException: Unable to register MBean [com.liferay.portal.dao.orm.hibernate.jmx.HibernateStatisticsService@1690d7a] with key 'Hibernate:name=statistics'; nested exception is javax.management.InstanceAlreadyExistsException: Hibernate:name=statistics
at org.springframework.jmx.export.MBeanExporter.registerBeanNameOrInstance(MBeanExporter.java:625)
at org.springframework.jmx.export.MBeanExporter.registerBeans(MBeanExporter.java:541)
at org.springframework.jmx.export.MBeanExporter.afterPropertiesSet(MBeanExporter.java:428)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1369)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335)
... 40 more
Caused by: javax.management.InstanceAlreadyExistsException: Hibernate:name=statistics
at com.sun.jmx.mbeanserver.Repository.addMBean(Repository.java:453)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.internal_addObject(DefaultMBeanServerInterceptor.java:1484)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerDynamicMBean(DefaultMBeanServerInterceptor.java:963)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerObject(DefaultMBeanServerInterceptor.java:917)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(DefaultMBeanServerInterceptor.java:312)
at com.sun.jmx.mbeanserver.JmxMBeanServer.registerMBean(JmxMBeanServer.java:482)
at org.springframework.jmx.support.MBeanRegistrationSupport.doRegister(MBeanRegistrationSupport.java:171)
at org.springframework.jmx.export.MBeanExporter.registerBeanInstance(MBeanExporter.java:670)
at org.springframework.jmx.export.MBeanExporter.registerBeanNameOrInstance(MBeanExporter.java:615)
... 44 more
1 févr. 2010 13:05:48 org.apache.catalina.core.StandardContext start
GRAVE: Error listenerStart
1 févr. 2010 13:05:48 org.apache.catalina.core.StandardContext start
GRAVE: Erreur de d�marrage du contexte [] suite aux erreurs pr�c�dentes
1 févr. 2010 13:05:48 org.apache.catalina.loader.WebappClassLoader loadClass
INFO: Illegal access: this web application instance has been stopped already. Could not load com.liferay.portal.servlet.filters.secure.SecureFilter. The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact.
java.lang.IllegalStateException
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1273)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
at com.liferay.portal.kernel.servlet.PortalClassLoaderFilter.portalInit(PortalClassLoaderFilter.java:103)
at com.liferay.portal.kernel.util.PortalInitableUtil.init(PortalInitableUtil.java:48)
at com.liferay.portal.kernel.servlet.PortalClassLoaderFilter.init(PortalClassLoaderFilter.java:88)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:275)
at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:397)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:108)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3709)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4363)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:926)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:889)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1149)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:516)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
1 févr. 2010 13:05:48 org.apache.catalina.loader.WebappClassLoader loadClass
INFO: Illegal access: this web application instance has been stopped already. Could not load javax.servlet.FilterConfig. The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact.
java.lang.IllegalStateException
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1273)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:316)
at com.liferay.portal.servlet.filters.secure.SecureFilter.init(SecureFilter.java:68)
at com.liferay.portal.kernel.servlet.PortalClassLoaderFilter.portalInit(PortalClassLoaderFilter.java:105)
at com.liferay.portal.kernel.util.PortalInitableUtil.init(PortalInitableUtil.java:48)
at com.liferay.portal.kernel.servlet.PortalClassLoaderFilter.init(PortalClassLoaderFilter.java:88)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:275)
at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:397)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:108)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3709)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4363)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:926)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:889)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1149)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:516)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)



And more ...

Any idea ?
Arun Kumar,修改在14 年前。

RE: Install 2 Liferay on a server

New Member 帖子: 15 加入日期: 10-2-1 最近的帖子
Just forget it , it wont work. You can make two instances of liferay run on same tomcat using virtual hosting , I have tried it. But seriously lot of problems came up later after that.
The liferay tends to scan the webapps folder for every theme or portlet, in this case you wont be able to identify onto which instance of the liferay portal the portlet / theme has been actually deployed onto.

Apart from that , there were some problems loading themes on the portal instances. Changing theme on one instance reflected the change on the other instance.
L&#039;Hostis Eric,修改在14 年前。

RE: Install 2 Liferay on a server

Junior Member 帖子: 39 加入日期: 08-11-20 最近的帖子
Ok, I forget it emoticon

And how can I make two instances of liferay ?

I have read some doc but I don't succeed to create a second instance.

I have created a second instance with the admin portlet. When I go to the second url, I have always the same page of the first instance.
thumbnail
steve rieger,修改在14 年前。

RE: Install 2 Liferay on a server

Expert 帖子: 436 加入日期: 06-9-11 最近的帖子
use communities for virt host
thumbnail
steve rieger,修改在14 年前。

RE: Install 2 Liferay on a server

Expert 帖子: 436 加入日期: 06-9-11 最近的帖子
use communities for virt host
bhaskar apparao varada,修改在14 年前。

RE: Install 2 Liferay on a server

New Member 帖子: 16 加入日期: 09-5-5 最近的帖子
Hi ,

You can create new Instance with the admin portlet by placing a virtual host and after that you need to do some changes in the portal for the theme.

let me know which version of liferay u r using.
L&#039;Hostis Eric,修改在14 年前。

RE: Install 2 Liferay on a server

Junior Member 帖子: 39 加入日期: 08-11-20 最近的帖子
I use the 5.2.3 version.

I have created a new Instance with the admin portlet.
But, then, I don't know/understand what I have to do.

The 2 url go to the IP of my server.

I have tried to add this virtual host in /etc/hosts file like I have read. I restart apache, I have this message :

VirtualHost www.vivremonquartier.com:0 overlaps with VirtualHost localhost:0, the first has precedence, perhaps you need a NameVirtualHost directive


And the 2 url go to the same website.


I have also other Java app, I have declared them in the
server.xml file like that :

<host name="midlet.smartouch.fr" appbase="appHTTP" unpackwars="true" autodeploy="true" xmlvalidation="false" xmlnamespaceaware="false">
      </host>


And it works good. Maybe I have to update this file ?
Poti 67,修改在14 年前。

RE: Install 2 Liferay on a server

Junior Member 帖子: 72 加入日期: 09-3-13 最近的帖子
you can also use 2 different tomcats
L&#039;Hostis Eric,修改在14 年前。

RE: Install 2 Liferay on a server

Junior Member 帖子: 39 加入日期: 08-11-20 最近的帖子
Poti 67:
you can also use 2 different tomcats


THANKS ! I don't know we can do that. And I don't know why I thought that, there is no reason emoticon

I have installed 2 TOMCAT with Liferay and mod_jk. A great link to understand how doing that : Configuring Tomcat5 and Apache2 with Virtual Hosts using mod_jk

I make it and it works good.

Thanks for your help.
Arun Kumar,修改在14 年前。

RE: Install 2 Liferay on a server

New Member 帖子: 15 加入日期: 10-2-1 最近的帖子
Make sure that both of the tomcat instances are referring to different databases emoticon
L&#039;Hostis Eric,修改在14 年前。

RE: Install 2 Liferay on a server

Junior Member 帖子: 39 加入日期: 08-11-20 最近的帖子
Arun Kumar:
Make sure that both of the tomcat instances are referring to different databases emoticon


Of course ! emoticon
Arun Kumar,修改在14 年前。

RE: Install 2 Liferay on a server

New Member 帖子: 15 加入日期: 10-2-1 最近的帖子
Make sure you have 2 entries in your hosts file
ex
127.0.0.1 www.firstapp.com
127.0.0.1 www.secondapp.com

Make an entry for the virtual host setting on liferay for these two instances.
By default, the friendly url for the default instance would be localhost, change that as well...

You can make the virtual host settings by going to Control Panel--> Setting --> Portal Instances -->