0
votes

I want two liferay instance in a single tomcat server. To achieve this I have done the following things.

  • Replicated the ROOT folder as app1 and app2 within webapps. The content of app1 and app2 folder is exactly the same as that of liferay ROOT folder.
  • Replaced the ROOT folder with a normal tomcat(non-liferay) ROOT content
  • Within apache-tomcat-7.0.65 > conf > Catalina > localhost Replicated the ROOT.xml as app1.xml and app2.xml and changed. The content of app1.xml and app2.xml is given below
  • app1.xml - <Context path="/app1" crossContext="true"> </Context>
  • app2.xml - <Context path="/app2" crossContext="true"> </Context>

I need the liferay instance to be accessed like as shown below

app1 on http://localhost:8080/app1
app2 on http://localhost:8080/app2

When I remove app2, then app1 is working fine and I am able to access the liferay instance using http://localhost:8080/app1.

apache-tomcat-7.0.65 > webapps

enter image description here

apache-tomcat-7.0.65 > conf > Catalina > localhost

enter image description here

Can anyone please tell me some solution for this

2

2 Answers

1
votes

It won't work: Liferay monitors other applications that are deployed to tomcat (that's the crossContext="true" in your context.xml) and picks them up: That's the way you deploy plugins to Liferay - and you couldn't target plugins to one or the other Liferay otherwise, or they'd be initialized twice.

If you need two different Liferay installations, you'll need two different tomcats running. You can combine them with the distinction between CATALINA_HOME and CATALINA_BASE and make them share the same code base, but have different configurations and deployed webapps.

1
votes

Wouldn't be enough to have one installation of Liferay portal in a single Tomcat (e.g. standard installation) and use Liferay instances/companies instead? See Control Panel -> Portal Instances -> Add. You can also use different address of each instance by setting proper virtual host: