1

URL (https://xyz.abc.com/cc) when load balancer see /cc it will forward request to WebSeal (Revers Proxy server).

WebSeal add/set (Header Host : xyz.abc.com) and forward request to Apache2 (web server). In web seal we have standard junction (/cc) which will process the request from LB.

When request comes to Apache2 it loosing HOST header value (xyz.abc.com) and reset it to Apache2 server name (xyzapacheweb1)

Now finally request pass from apache2 to Liferay Portal (6.2) and it showing URL (xyzapacheweb1) instead of (xyz.abc.com)

Liferay need HOST name when web server fronting so we have to hard code URL (in property file or in apache2)

We want to remove Hard-Code value and pass dynamic host name so we can use multiple URLs for individual applications.

Note : When we don't have WebSeal in picture it preserve the HOST name. i.e. Apache2 show actual domain name (xyz.abc.com)

Can you please help me to resolve this problem?

Let me know if you need more info.

Varun Shah
  • 11
  • 4

2 Answers2

0

If you're using mod_proxy to forward from apache to tomcat you're missing the option

ProxyPreserveHost On

This is because of forwarding through http. If you're using ajp this is automatically taken care of for you by the protocol.

I'm not sure of the equivalent option for webseal though, maybe the apache one helps you to find it

Olaf Kock
  • 46,930
  • 8
  • 59
  • 90
  • Thanks Olaf for your reply. Some how I am not able to get host name (xyz.abc.com) in Apache2 (web server) from web seal so not able to set/pass from apache to Liferay (tomcat). I will post my apache settings tomorrow from workplace. – Varun Shah Aug 28 '15 at 06:46
  • As I said: I'm not sure on webseal - never administered it. From quick googling it looks like it forwards the Host header that you specified when you created a junction. Naturally, the Apache option doesn't help you if the header already gets lost before, e.g. on webseal. You might want to try a new junction (however that's created) and give the expected host name with it. Should be a standard operation for a component like webseal, as that's exactly what it's built for. – Olaf Kock Aug 28 '15 at 07:06
0

I came up with two solutions.

  1. Temporary :

    • Set custom header attribute in request from WebSeal i.e. domain-host-name. From LB -> WebSeal set the host value to this variable.
    • Apache web server is able to retrieve this value because it's not default request header. Based on the domain-host-name value Set Header HOST value from Apache webserver for Liferay.
    • remove web.server.host.name property in Liferay it will automatically get the HOST value (which was set by Apache).

      Set xyz.abc.com if domain-host-name is set to xyz.abc.com

      SetEnvIf domain-host xyz.abc.com HAVE_MyRequestHeader RequestHeader set Host xyz.abc.com env=HAVE_MyRequestHeader

      Set abc.xyz.com if domain-host-name is set to abc.xyz.com

      SetEnvIf domain-host abc.xyz.com HAVE_MyRequestHeader_1 RequestHeader set Host abc.xyz.com env=HAVE_MyRequestHeader_1

This is a temporary solution because here we have to hardcode host name check in Apache. So if there is new URL then you have to configure it in Apache.

  1. Permanent :

    • WebSeal has Virtual Junction concept. Where webseal can be configure to play virtual hosting role.

Please refer : http://www-01.ibm.com/support/knowledgecenter/SSPREK_6.1.1/com.ibm.itame.doc_6.1.1/am611_webseal_admin642.htm%23vhost-scenario1?lang=en

Let me know if you are facing similar type issue I can help to resolve it.

Varun Shah
  • 11
  • 4