0

I have following configuration:

  • Websphere ND 8.0 with some deployed applications;
  • IHS (IBM HTTP Server) 8.0;
  • Web Server Plug-ins 8.0;

All of the deployed applications has some unique root context. What I need is to change this root context for some of them. For example I have a following link - http//host:port/app1/index.jsp, where app1 is a root context. I need to make it work through the following link http//host:port/cust/app1/index.jsp. (it would be better if the old link doesn't work after such modification).

I've tried to reach this without the IHS layer. WAS do allows to change the root context, and this is pretty easy. The problem is that the deployed apps use direct mapping to the root context within their internal resources. (i.e. some app1's resources, like JS, HTML..., contains direct pointing to the /app1/...). In this case simple changing of the root context is not suitable. I need to change all such internal resources manually. I know that this is the poor implementation but that is what I have. This solution is definitely not the best, but at least it works.

I need to do the same thing (well, not the same. the result should be the same) but now with the IHS. I'm not familiar with the IHS installation\configuration. Here is my understanding of how does it works:

Client->IHS->WAS(applications)

IHS communicated with the WAS through the mod_was_ap22_http plugin, where the plugin-cfg.xml shows the URL templates to be processed. (don't know how exactly does it works)

*Basically Clent send following request - http//IHS_host:port/app1/index.jsp.

*IHS start process that request through the mod_was_ap22_http.

*If the request match to the plugin-cfg.xml rules then it goes to the WAS.

All this time the root context was the app1. Is it possible to configure IHS to change the original root context, and make that the Client works through the new root context only? As the result user should not see the http//IHS_host:port/app1/*, he should see only http//IHS_host:port/cust/app1/*

Brian Tompsett - 汤莱恩
  • 5,195
  • 62
  • 50
  • 120
Sergii_13
  • 1
  • 2

1 Answers1

1

You can use mod_rewrite with the [PT] flag to change /cust/app1 to /app1/ before the WAS WebServer Plug-in sees the request:

RewriteEngine on RewriteRule ^/cust(/app1/.*) $1 [PT]

http://publib.boulder.ibm.com/httpserv/ihsdiag/plugin_alter_uri.html

covener
  • 16,079
  • 2
  • 27
  • 40
  • Thanks for the link, but I've already seen this, and tried the described approach. But this isn't what I need. This will rewrite the provided URL to match the real URL. What I really need is to make Client sees the fake URL only. The original application is still works with the original link: `http://host:port/app1/*` what I need is to make it visible for the end user with the fake link: `http://IHS_host:port/cust/app1/*` and that "cust" should be visible for the Client. It should be smth like an alias. The real alias doesn't work too, because I don't have the mapping to the real directory. – Sergii_13 Sep 23 '13 at 12:02
  • When will the client see the "short" URL? When your application redirects to it, or in your own generated hyperlinks? The recipe is effectively identical to Alias for non-file contents. – covener Sep 23 '13 at 17:00
  • What I wanted to do is make application working through the fake URL. However I didn't think about the requests from the real application. Any link from the already opened application will use the real URL (short), and this is already what I don't need... – Sergii_13 Sep 23 '13 at 18:43
  • Am I correctly understand that the only option I have (except the manual editing all the resources with the direct usage of the root context) is to create an alias for a fake (long) URL to point the real (short) URL AND also add a rewrite that will rewrite the real (short) URL and make it fake (long)? – Sergii_13 Sep 23 '13 at 18:44
  • As I understand it should work in following way:
      - fake (long) URL came to the IHS; - IHS has an alias for the fake URL and send real URL to the WAS; - client open some link within the opened application and this cause some new real URL invocation; - real URL came to the IHS; - IHS has a rewrite rule and rewrites the real URL with the fake one, and then fake URL came to the IHS.
    Is this correct?
    – Sergii_13 Sep 23 '13 at 18:45
  • Also what do you mean as Alias for non-file contents? Does this mean that I need to provide the full URL (including protocol, host, port)? If yes then this is not working for me, since I have a cluster, and nodes are on the different machines – Sergii_13 Sep 23 '13 at 18:51