Topic
4 replies Latest Post - ‏2012-11-05T14:11:07Z by Sunit
SystemAdmin
SystemAdmin
3908 Posts
ACCEPTED ANSWER

Pinned topic Name based virtual host and WebSpherePluginConfig

‏2012-10-15T14:46:33Z |
scenario is:

There is an IHS instance(we want to use only one instance to route the requests) and two different hostname point to the IHS's 80 port

We want to use name based virtual host to route the requests from different hostname onto different WAS application

here is the virtual host configuration fragment

<VirtualHost *:80>
ServerAdmin liangx8892@163.com
DocumentRoot "C:/IBM/HTTPServer7/htdocs"
ServerName www.example1.com
ServerAlias www.example1.com
WebSpherePluginConfig "C:\IBM\HTTPServer7\Plugins\config\webserver1\plugin-cfg-example1.xml"
ErrorLog "logs/example1-error_log"
CustomLog "logs/example1-access_log" common
</VirtualHost>

<VirtualHost *:80>
ServerAdmin liangx8892@163.com
DocumentRoot "C:/IBM/HTTPServer7/htdocs"
ServerName www.example2.com
ServerAlias www.example2.com
WebSpherePluginConfig "C:\IBM\HTTPServer7\Plugins\config\webserver1\plugin-cfg-example2.xml"
ErrorLog "logs/example2-error_log"
CustomLog "logs/example2-access_log" common
</VirtualHost>

I expected that
when user access www.example1.com/app/index.html,the request can be routed onto WAS server configurated in plugin-cfg-example1.xml
when user access www.example2.com/app/index.html,the request can be routed onto WAS server configurated in plugin-cfg-example2.xml

But the actual result was:
access both www.example1.com/app/index.html and www.example2.com/app/index.html,the requests were routed onto WAS server configurated in plugin-cfg-example2.xml

Seems that the httpd.conf can have only one active WebSpherePluginConfig directive,and the last one will replace the previous

Is there any alternative approach to achieve this(do not start two instances with different httpd.conf)?

Any help will be appreciated
Updated on 2012-11-05T14:11:07Z at 2012-11-05T14:11:07Z by Sunit
  • SystemAdmin
    SystemAdmin
    3908 Posts
    ACCEPTED ANSWER

    Re: Name based virtual host and WebSpherePluginConfig

    ‏2012-10-15T15:15:44Z  in response to SystemAdmin
    Not possible, it should be rejected in virtualhost context but isn't.

    If you want it vhost-aware, you have to deploy to specific host aliases in WAS and re-gen a single plugin-cfg.xml
  • Sunit
    Sunit
    176 Posts
    ACCEPTED ANSWER

    Re: Name based virtual host and WebSpherePluginConfig

    ‏2012-10-15T17:19:14Z  in response to SystemAdmin
    Try the following:

    1. In WAS admin console when you bind the application to virtual_host instead of binding it to *:80 or *:443 bind it to www.example1.com:443 and www.example1.com:443 for the first app and do the same thing for second app with the second hostname and IP address.

    Regenerate the plugin-cfg.xml and restart everything

    • Sunit
    • SystemAdmin
      SystemAdmin
      3908 Posts
      ACCEPTED ANSWER

      Re: Name based virtual host and WebSpherePluginConfig

      ‏2012-10-16T09:06:45Z  in response to Sunit
      Hi Sunit,thanks for the help
      I did what you said,bind www.example1.com in virtual_host in the WAS1 console and did the same thing to WAS2,
      regen plugin on both server,replace the plugin configuration file,finally restart WAS1,WAS2 and IHS server,

      But I could not access the app on both WAS1 and WAS2 through hostname www.example1.com & www.example2.com
      • Sunit
        Sunit
        176 Posts
        ACCEPTED ANSWER

        Re: Name based virtual host and WebSpherePluginConfig

        ‏2012-11-05T14:11:07Z  in response to SystemAdmin
        Change the loglevel in plugin-cfg.xml to debug and restart IHS. Try accessing the apps again and then look at the logs generated. They should point ou to where the problem lies.

        • sunit