The Source for Java Technology Collaboration

Home » java.net Forums » GlassFish » GlassFish

Thread: configuring check-passthrough with sun webserver loadbalancer.xml

Welcome, Guest Help
Login Login
Guest Settings Guest Settings
This question is not answered. Helpful answers available: 2. Correct answers available: 1.

Reply to this Thread Reply to this Thread Search Forum Search Forum Back to Thread List Back to Thread List

Permlink Replies: 2 - Last Post: Aug 27, 2008 5:07 AM by: Pankaj Jairath
narirag

Posts: 3
configuring check-passthrough with sun webserver loadbalancer.xml
Posted: Aug 27, 2008 12:48 AM
 
  Click to reply to this thread Reply

Hello Everyone !!!

I am using the Sun Webserver 6.1 sp6 with loadbalancer plugin to route the traffic to the Sun application server 8.1. Currently the webserver is directing all the requests (both static and dynamic) succesfully to the Application servers listed in the loadbalancer.xml file. I would like to configure the Webserver to serve all the static content like html,css,gifs,png etc and forward the request to appserver in case the requested resource is not available on webserver.

It was mentioned in the sun documentation to use the check-passthrough directive for this requirement, But I am not able to configure this directive successfully. Did someone implemented this directive successfully to serve the static content from webserver and forward only those resource requests which does not present on the webserver.

Here is the snippet of obj.conf I was using..

<Object name="lbplugin">
ObjectType fn="force-type" type="magnus-internal/lbplugin"
ObjectType fn="check-passthrough" type="magnus-internal/passthrough"
PathCheck fn="deny-existence" path="/WEB-INF/"
Service type="magnus-internal/lbplugin" fn="service-passthrough"
Error reason="Bad Gateway" fn="send-error" uri="$docroot/badgateway.html"
</Object>

The lbplugin will be mapped to the location of the loadbalancer.xml file on the webserver.

I already tried several combinations with no luck and below was one of them.

<Object name="lbplugin">
ObjectType fn="check-passthrough" type="magnus-internal/passthrough"
Service type="magnus-internal/passthrough" fn="service-passthrough"
Error reason="Bad Gateway" fn="send-error" uri="$docroot/badgateway.html"
</Object>


-Thanks

kshitiz_saxena

Posts: 57
Re: configuring check-passthrough with sun webserver loadbalancer.xml
Posted: Aug 27, 2008 1:27 AM   in response to: narirag
 
  Click to reply to this thread Reply

Hi,

You can use web-server <Client> directive to solve this problem to certain extent. Please modify obj.conf as follows :

From :
NameTrans fn="name-trans-passthrough" name="lbplugin" config-file="loadbalancer.xml"

To :
<Client uri="(*.jsp|*.do)">
NameTrans fn="name-trans-passthrough" name="lbplugin" config-file="loadbalancer.xml"
</Client>

This directive will force web-server to forward requests only for *.jsp and *.do files to application-server. All other requests will be served locally from doc-root.

For more details on this directive please refer to link : http://docs.sun.com/app/docs/doc/820-1643/abvau?l=en&a=view&q=%3CClient%3E+web+server

However this is active filtering of request, rather than trying to send requests to application-server if and only if web-server is not able to service the request.

Thanks,
Kshitiz

Pankaj Jairath
Re: configuring check-passthrough with sun webserver loadbalancer.xml
Posted: Aug 27, 2008 5:07 AM   in response to: narirag
  Click to reply to this thread Reply

Hello,

If you really want to achieve something like a first attempt with
WebServer (say docroot ) and if that does not succeed then try another
load balancing to application server tier;

you can then build a customized NameTrans SAF, that would be able
determine whether you can map the URL internally if not then, you allow
it to proceed such that WebServer would try other NameTrans directives
in default object. In this case you should add your customized SAF prior
to loadbalancer NameTrans directive.

so something like

<Object name=default>
..
NameTrans fn=<your_SAF> name=<your-object>
NameTrans fn="name-trans-passthrough" name="lbplugin"
config-file="loadbalancer.xml"

...
<Object name=<your-object"
..
</O

You can also refer to NSAPI programmer guide on how to create custom
SAFs - http://docs.sun.com/app/docs/doc/819-6515
regards
Pankaj

glassfish@javadesktop.org wrote:
> Hello Everyone !!!
>
> I am using the Sun Webserver 6.1 sp6 with loadbalancer plugin to route the traffic to the Sun application server 8.1. Currently the webserver is directing all the requests (both static and dynamic) succesfully to the Application servers listed in the loadbalancer.xml file. I would like to configure the Webserver to serve all the static content like html,css,gifs,png etc and forward the request to appserver in case the requested resource is not available on webserver.
>
> It was mentioned in the sun documentation to use the check-passthrough directive for this requirement, But I am not able to configure this directive successfully. Did someone implemented this directive successfully to serve the static content from webserver and forward only those resource requests which does not present on the webserver.
>
> Here is the snippet of obj.conf I was using..
>
> <Object name="lbplugin">
> ObjectType fn="force-type" type="magnus-internal/lbplugin"
> ObjectType fn="check-passthrough" type="magnus-internal/passthrough"
> PathCheck fn="deny-existence" path="/WEB-INF/"
> Service type="magnus-internal/lbplugin" fn="service-passthrough"
> Error reason="Bad Gateway" fn="send-error" uri="$docroot/badgateway.html"
> </Object>
>
> The lbplugin will be mapped to the location of the loadbalancer.xml file on the webserver.
>
> I already tried several combinations with no luck and below was one of them.
>
> <Object name="lbplugin">
> ObjectType fn="check-passthrough" type="magnus-internal/passthrough"
> Service type="magnus-internal/passthrough" fn="service-passthrough"
> Error reason="Bad Gateway" fn="send-error" uri="$docroot/badgateway.html"
> </Object>
>
>
> -Thanks
> [Message sent by forum member 'narirag' (narirag)]
>
> http://forums.java.net/jive/thread.jspa?messageID=295550
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: users-help@glassfish.dev.java.net
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net





 XML java.net RSS