Forums de discussion

Liferay 5.2 Virtual Host (ModJK & Web Application outside tomcat)

David Latty, modifié il y a 14 années.

Liferay 5.2 Virtual Host (ModJK & Web Application outside tomcat)

Junior Member Publications: 96 Date d'inscription: 16/06/08 Publications récentes
I don't believe there is a full description on the net of the integration between apache and tomcat and liferay in order to support liferay virtual hosts. I am aware of this link, http://www.liferay.com/web/guest/community/wiki/-/wiki/Main/Virtual+Hosting+(Communities), however, this link doesn't have all the required information. Please can someone assist.

Here is my setup

  • /home/me/tomcat = base tomcat
  • /home/me/tomcat.sites/portal.usw.pnet/webapps/ROOT = base liferay
  • Note: Running on port 80 using mod_jk
  • Note: Web applications are outside of the base tomcat folder



Tomcat Configuration

<Host name="portal.usw.pnet"
appBase="/home/adm/tomcatsites/culture.usw.pnet/webapps"
unpackWARs="true" autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false">
<Listener className="org.apache.jk.config.ApacheConfig" append="true" forwardAll="false" mod_jk="/etc/httpd/modules/mod_jk.so" />
<Context path="" docBase="ROOT" debug="1" reloadable="true" />
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="/home/adm/tomcatlogs" prefix="culture_access."
suffix=".log" pattern="common" resolveHosts="false" />
</Host>


Apache Configuration

<VirtualHost *:80>
ServerName portal.usw.pnet
DocumentRoot "/home/adm/tomcatsites/culture.usw.pnet/webapps/ROOT"
ErrorLog /home/nextadm/apachelogs/culture.usw.pnet-error.log
TransferLog /home/nextadm/apachelogs/culture.usw.pnet-access.log
JKMount /* culture-worker
</VirtualHost>


Worker Property Configuration

# Definition for Ajp13 worker
worker.list=culture-worker

worker.culture-worker.port=8009
worker.culture-worker.host=portal.usw.pnet
worker.culture-worker.type=ajp13


Questions

  • Do I need an alias in apache for each liferay virtual host (e.g. ServerAlias communitya.usw.pnet)
  • For each liferay virtual host, do I need to add a host in worker.properties
  • Apache didnt seem acknowledge those virtual hosts until i set tomcat default host as the target site (i.e. portal.usw.pnet). It would simply show the default apache virtual host, until I made this tomcat configuration. I'd prefer not to have to set the default host


Tanks ~
thumbnail
Sten Martinez, modifié il y a 14 années.

RE: Liferay 5.2 Virtual Host (ModJK & Web Application outside tomcat)

New Member Publications: 8 Date d'inscription: 27/06/07 Publications récentes
you should look into name-based virtual hosting: http://httpd.apache.org/docs/2.2/vhosts/name-based.html

also, you need to set up DNS alias'es if you haven't already.

sm
David Latty, modifié il y a 14 années.

RE: Liferay 5.2 Virtual Host (ModJK & Web Application outside tomcat)

Junior Member Publications: 96 Date d'inscription: 16/06/08 Publications récentes
This is already known, as shown in the apache configuration above. Thanks for the reply, but this doesn't in any way answer my question.

Can someone please help here.
thumbnail
Sten Martinez, modifié il y a 14 années.

RE: Liferay 5.2 Virtual Host (ModJK & Web Application outside tomcat)

New Member Publications: 8 Date d'inscription: 27/06/07 Publications récentes
unless you need special apache configs per virtual host, just use DNS aliases and let liferay do the virtual hosting. Liferay allows one to set up a new portal instance via virtual hosts, or even use them to map to communities.
thumbnail
Lisa Simpson, modifié il y a 14 années.

RE: Liferay 5.2 Virtual Host (ModJK & Web Application outside tomcat)

Liferay Legend Publications: 2034 Date d'inscription: 05/03/09 Publications récentes
Do I need an alias in apache for each liferay virtual host (e.g. ServerAlias communitya.usw.pnet) - Yes

For each liferay virtual host, do I need to add a host in worker.properties - Yes

Apache didnt seem acknowledge those virtual hosts until i set tomcat default host as the target site (i.e. portal.usw.pnet). It would simply show the default apache virtual host, until I made this tomcat configuration. I'd prefer not to have to set the default host - You have to give it something to point to. That's the difference between tellig your dog "fetch" and "fetch me a beer". If you say "Fetch", he's going to bring you slippers, paper, or something else - maybe the cat. If you want a beer, you have to say so.