Question

I am trying to integrate the liferay tomcat with apache web server.I successfully integrate the liferay with web server.

Condition:

Life ray deployed on ip say : 10.10.10.70

Apache web server on ip say: 10.10.10.80

I provided all the requirement virtual host requirement in httpd.conf file..and provided the web.server.host in portal-ext.properties file.

Problem: When i run liferay portal i can open it on ip: 10.10.10.70 but when i click on any page link (let say /home)that is present in my portal it moved the request to 10.10.10.80:8080/home instead of 10.10.10.70:8080/home

I want to know how to handle this condition.

Because i dont have any page resource on web server doc folder only contain static css..

Was it helpful?

Solution

You might be a bit more precise what "all the required virtual host settings" are, e.g. what did you configure?

Note that by explicitly configuring hostnames/IP-addresses, you're explicitly overriding the autodetected settings from the request - no matter how you get to your portal, Liferay will generate URLs based on the explicitly configured hostname/port.

What's the point in having an Apache in front and then trying to reach tomcat through the non-apache IP/Port? Typically you might have static resources, rewrites, caches on Apache, so that you'll get different results when you alternatively access tomcat through both URLs.

If you configure Apache to "properly" handle the requests before tomcat sees them, you'll typically not need to configure Liferay at all, because Apache will make the actual hostname that it's requested under available to Tomcat. I'm typically using mod_jk for this and it beautifully handles all the configuration with almost no need to explicitly configure tomcat/liferay. If you don't like this, keep in mind that you're explicitly configuring Liferay for the virtual host setup - naturally this explicitly configured name is what Liferay uses. It would be weird if the explicit value would not be used, right?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top