9: 1 Multiple Site Setup
10: Liferay reportedly (http://wiki.liferay.com/index.php/Virtual_hosting) supports virtual hosting.
11: When we tried that setup we got some odd errors. e.g.:
12: {code}
13: java.lang.NullPointerException
14: com.liferay.portal.struts.StrutsUtil.forward(StrutsUtil.java:72)
15: com.liferay.portal.servlet.MainServlet.service(MainServlet.java:865)
16: 07:56:27,202 ERROR [IndexConsumer:66] javax.jms.JMSException: Could not
17: create Transport. Reason:
18: javax.management.InstanceAlreadyExistsException:
19: org.apache.activemq:BrokerName=localhost,Type=Broker
20: Caused by: org.springframework.beans.factory.BeanCreationException:
21: Error creating bean with name
22: 'com.liferay.portal.service.LayoutLocalServiceFactory' defined in class
23: path resource [META-INF/portal-spring-professional.xml]: Cannot resolve
24: reference to bean
25: 'com.liferay.portal.service.LayoutLocalService.transaction' while
26: setting bean property 'service'; nested exception is
27: org.springframework.beans.factory.BeanCreationException: Error creating
28: bean with name
29: 'com.liferay.portal.service.LayoutLocalService.transaction' defined in
30: class path resource [META-INF/portal-spring-professional.xml]:
31: Invocation of init method failed; nested exception is
32: java.lang.IllegalArgumentException: interface
33: org.springframework.aop.SpringProxy is not visible from class loader
34: {code}
35: We will try following up with Liferay to see if we can resolve this problem.
36: The workaround is to run separate Liferay instances. The procedure to do this is (in shorthand) for a new domain (e.g. example.com):
37: - cp /usr/local/liferay /usr/local/liferay.example.com (assuming your original liferay install is in /usr/local/liferay
38: - edit /usr/local/liferay.example.com/webapps/ROOT/web.xml and change the company_id to example.com
39: - edit /usr/local/liferay.example.com/conf/server.xml so it listens on different ports from the other virtual hosts. e.g. for each new domain add 100 to the port number. e.g. on the third one the 8080 port should be 8280, and the 8009 port should be 8209.
40: - ln -sf /etc/init.d/liferay /etc/init.d/liferay.example.com
41: - edit /etc/init.d/liferay and 'make it work' for the separate tomcat/liferay instance.
42: - edit /etc/httpd/conf/httpd.conf and setup mod_jk2 or mod_ajp_proxy to forward requests to the tomcat instance (remember to use the correct 8?09 address (e.g. 8009 or 8109 or 8209, etc).
43: - run chkconfig --level 35 liferay.example.com
44: - run /etc/init.d/liferay.example.com start