Context/Host Question

59 views
Skip to first unread message

Brook Davies

unread,
Feb 16, 2012, 3:33:41 AM2/16/12
to ra...@googlegroups.com
Hello,

Okay, so hours in and I can't figure this one out. I have a two Railo servers  setup on windows 2008 with IIS7.5, and they hosts just one website (and the admin site):

I've added the entry to server.xml for my site

<Host name="analytics.mywebsite.com" appBase="webapps">
         <Context path="" docBase="C:\inetpub\wwwroot\LF-MYWEBSITE\" />
         <Alias>89.34.199.13</Alias> <!--- this is the real server ip -->
         <Alias>89.34.199.57</Alias> <!-- this is the virtual load balanced ip -->
 </Host>

Everything works great, if open a browser and go to the IP or domain, I get the website as expected.

The problem is, the  load balancer (from loadbalancer.org) checks the real ip for  a response from a health monitoring script. But the loadbalancer request is getting handled differently and instead of:

C:\inetpub\wwwroot\LF-MYWEBSITE\health\monitor.cfm

its being sent to

C:\railo\tomcat\webapps\ROOT\health\monitor.cfm

But, I don't understand why, because it should be a normal http request on port 80 from the load balancer. This is what is in the log:

Page /health/monitor.cfm [C:\railo\tomcat\webapps\ROOT\health\monitor.cfm] not found
    at railo.runtime.PageSourceImpl.loadPage(PageSourceImpl.java:140):140
    at railo.runtime.PageContextImpl.doInclude(PageContextImpl.java:759):759
    at railo.runtime.listener.ModernAppListener._onRequest(ModernAppListener.java:179):179
    at railo.runtime.listener.ModernAppListener.onRequest(ModernAppListener.java:83):83
    at railo.runtime.PageContextImpl.execute(PageContextImpl.java:1991):1991
    at railo.runtime.PageContextImpl.execute(PageContextImpl.java:1958):1958
    at railo.runtime.engine.CFMLEngineImpl.serviceCFML(CFMLEngineImpl.java:297):297
    at railo.loader.servlet.CFMLServlet.service(CFMLServlet.java:32):32
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:722):722
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304):304
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210):210
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224):224
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169):169
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168):168
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100):100
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929):929
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118):118
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:405):405
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:964):964
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:515):515
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:302):302
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source):-1
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source):-1
    at java.lang.Thread.run(Unknown Source):-1

Anybody know how I might go about fixing this?

Brook


AJ Mercer

unread,
Feb 16, 2012, 3:52:40 AM2/16/12
to ra...@googlegroups.com
tra adding
<Alias> oadbalancer.org </Alias> <!-- this is the virtual load balanced by name --> 

Brook Davies

unread,
Feb 16, 2012, 1:39:28 PM2/16/12
to ra...@googlegroups.com
Really? Loadbalancer.org are the makers of the load balancer. Sorry, Maybe I didn't explain that right. The load balancer is making the request to check 69.90.199.13.

I tried chaning the appbase attribute to "C:\inetpub\wwwroot\LF-MYWEBSITE" and that actually worked, but then the application scope that the monitor.cfm page expected no longer existed.

Brook

Jordan Michaels

unread,
Feb 16, 2012, 5:56:12 PM2/16/12
to ra...@googlegroups.com
Protocol.

Tomcat's web server communicates in the HTTP protocol. If the incoming
request doesn't have typical HTTP request headers, then it's not a HTTP
request and Tomcat will not know how to resolve the request. Because
it's not a HTTP request, Tomcat will resolve it to the default host (the
same way apache would if you, for example, telnetted to Apache port 80
and didn't provide any HTTP headers).

The requests from your browser through the load balancers work because
they're communicating using the HTTP protocol. It doesn't sound like
your load balancers are communicating using HTTP.

Are your load balancers capable of performing a HTTP check that will
contain HTTP request headers? IE: a host name and a URI specifically?

Some load balancers are able to take this a step further and check the
content of a response for specific information. Vivio has load balancer
clients that use this feature and have their code run health checks when
their load balancer check point is hit. It's quite useful.

Bottom line, you need to find out exactly what kind of request your load
balancer is sending to your site. If your load balancers can perform a
HTTP check, great. If not, then you will need to configure Tomcat to
respond on the default host.

Warm Regards,
Jordan Michaels

On 02/16/2012 12:33 AM, Brook Davies wrote:
> Hello,
>
> Okay, so hours in and I can't figure this one out. I have a two Railo
> servers setup on windows 2008 with IIS7.5, and they hosts just one
> website (and the admin site):
>
> I've added the entry to server.xml for my site
>

> <Host name="analytics.mywebsite.com <http://analytics.mywebsite.com>"


> appBase="webapps">
> <Context path="" docBase="C:\inetpub\wwwroot\LF-MYWEBSITE\" />
> <Alias>89.34.199.13</Alias> <!--- this is the real server ip -->
> <Alias>89.34.199.57</Alias> <!-- this is the virtual load balanced ip -->
> </Host>
>
> Everything works great, if open a browser and go to the IP or domain, I
> get the website as expected.
>
> The problem is, the load balancer (from loadbalancer.org

> <http://loadbalancer.org>) checks the real ip for a response from a

Brook Davies

unread,
Feb 17, 2012, 2:01:11 AM2/17/12
to ra...@googlegroups.com
The load balancer does exactly that,an http request and checks the response on the page. My IIS 7.5 logs show that when I make a request, the file gets served, but when the load balancer makes a request it generates a 404. I can't figure this out. I checked for security related rules that might be filtering out the libwww-perl agent but couldn't find any in IIS..

In the log snippet below, the 2 successul attempts were from me and the others all from the load balancer.

012-02-17 06:53:44 69.90.199.12 GET /health/monitor.cfm - 80 - 69.90.199.58 libwww-perl/5.805 404 0 0 0
2012-02-17 06:54:00 69.90.199.12 GET /health/monitor.cfm - 80 - 69.90.199.59 libwww-perl/5.805 404 0 0 0
2012-02-17 06:54:23 69.90.199.12 GET /health/monitor.cfm - 80 - 69.90.199.58 libwww-perl/5.805 404 0 0 0
2012-02-17 06:54:25 69.90.199.12 GET /health/monitor.cfm - 80 - 69.90.199.58 libwww-perl/5.805 404 0 0 0
2012-02-17 06:54:41 69.90.199.12 GET /health/monitor.cfm - 80 - 69.90.199.59 libwww-perl/5.805 404 0 0 0
2012-02-17 06:54:49 69.90.199.12 GET /health/monitor.cfm - 80 - 69.90.199.12 Mozilla/5.0+(Windows+NT+6.1;+WOW64;+rv:8.0.1)+Gecko/20100101+Firefox/8.0.1 200 0 0 202
2012-02-17 06:55:03 69.90.199.12 GET /health/monitor.cfm - 80 - 69.90.199.12 Mozilla/5.0+(Windows+NT+6.1;+WOW64;+rv:8.0.1)+Gecko/20100101+Firefox/8.0.1 200 0 0 15
2012-02-17 06:55:03 69.90.199.12 GET /health/monitor.cfm - 80 - 69.90.199.58 libwww-perl/5.805 404 0 0 15
2012-02-17 06:55:05 69.90.199.12 GET /health/monitor.cfm - 80 - 69.90.199.58 libwww-perl/5.805 404 0 0 0

Are there rules restricing libwww-perl somewhere as a valid user agent?

Brook

Jordan Michaels

unread,
Feb 17, 2012, 1:41:55 PM2/17/12
to ra...@googlegroups.com
Alright, thanks for the additional information. This makes more sense now.

You said your host was setup as follows:

<Host name="analytics.mywebsite.com" appBase="webapps">


<Context path="" docBase="C:\inetpub\wwwroot\LF-MYWEBSITE\" />
<Alias>89.34.199.13</Alias>

<Alias>89.34.199.57</Alias>
</Host>

But in your logs, I see these IP's:

69.90.199.12
69.90.199.59
69.90.199.58

Is 199.13 an additional load-balanced node?

You indicated 199.57 was the LB IP, but I'm guessing you're referring to
the floating gateway IP? Your networking will be different depending on
how your LB's are set up. From your description, it sounds like you're
using the LB's for both incoming and outgoing traffic.

In this kind of a setup, the floating IP for the LB's will not be seen
by Tomcat. It's used purely for routing.

Try this host config instead.

<Host name="analytics.mywebsite.com" appBase="webapps">


<Context path="" docBase="C:\inetpub\wwwroot\LF-MYWEBSITE\" />

<Alias>89.34.199.12</Alias>
<Alias>89.34.199.13</Alias>
</Host>

... and see if you have better luck.

The values that you add to each <Alias> will be the IP's that the load
balancers hit to perform their checks.

Warm Regards,
Jordan Michaels

> <http://analytics.mywebsite.__com <http://analytics.mywebsite.com>>"
>
> appBase="webapps">
> <Context path="" docBase="C:\inetpub\wwwroot\__LF-MYWEBSITE\" />


> <Alias>89.34.199.13</Alias> <!--- this is the real server ip -->
> <Alias>89.34.199.57</Alias> <!-- this is the virtual load
> balanced ip -->
> </Host>
>
> Everything works great, if open a browser and go to the IP or
> domain, I
> get the website as expected.
>
> The problem is, the load balancer (from loadbalancer.org
> <http://loadbalancer.org>
> <http://loadbalancer.org>) checks the real ip for a response from a
>
> health monitoring script. But the loadbalancer request is getting
> handled differently and instead of:
>

> C:\inetpub\wwwroot\LF-__MYWEBSITE\health\monitor.cfm
>
> its being sent to
>
> C:\railo\tomcat\webapps\ROOT\__health\monitor.cfm


>
> But, I don't understand why, because it should be a normal http
> request
> on port 80 from the load balancer. This is what is in the log:
>
> Page /health/monitor.cfm

> [C:\railo\tomcat\webapps\ROOT\__health\monitor.cfm] not found
> at
> railo.runtime.PageSourceImpl.__loadPage(PageSourceImpl.java:__140):140
> at
> railo.runtime.PageContextImpl.__doInclude(PageContextImpl.__java:759):759
> at
> railo.runtime.listener.__ModernAppListener._onRequest(__ModernAppListener.java:179):__179
> at
> railo.runtime.listener.__ModernAppListener.onRequest(__ModernAppListener.java:83):83
> at
> railo.runtime.PageContextImpl.__execute(PageContextImpl.java:__1991):1991
> at
> railo.runtime.PageContextImpl.__execute(PageContextImpl.java:__1958):1958
> at
> railo.runtime.engine.__CFMLEngineImpl.serviceCFML(__CFMLEngineImpl.java:297):297
> at
> railo.loader.servlet.__CFMLServlet.service(__CFMLServlet.java:32):32
> at
> javax.servlet.http.__HttpServlet.service(__HttpServlet.java:722):722
> at
> org.apache.catalina.core.__ApplicationFilterChain.__internalDoFilter(__ApplicationFilterChain.java:__304):304
> at
> org.apache.catalina.core.__ApplicationFilterChain.__doFilter(__ApplicationFilterChain.java:__210):210
> at
> org.apache.catalina.core.__StandardWrapperValve.invoke(__StandardWrapperValve.java:224)__:224
> at
> org.apache.catalina.core.__StandardContextValve.invoke(__StandardContextValve.java:169)__:169
> at
> org.apache.catalina.core.__StandardHostValve.invoke(__StandardHostValve.java:168):__168
> at
> org.apache.catalina.valves.__ErrorReportValve.invoke(__ErrorReportValve.java:100):100
> at
> org.apache.catalina.valves.__AccessLogValve.invoke(__AccessLogValve.java:929):929
> at
> org.apache.catalina.core.__StandardEngineValve.invoke(__StandardEngineValve.java:118):__118
> at
> org.apache.catalina.connector.__CoyoteAdapter.service(__CoyoteAdapter.java:405):405
> at
> org.apache.coyote.http11.__AbstractHttp11Processor.__process(__AbstractHttp11Processor.java:__964):964
> at
> org.apache.coyote.__AbstractProtocol$__AbstractConnectionHandler.__process(AbstractProtocol.java:__515):515
> at
> org.apache.tomcat.util.net
> <http://org.apache.tomcat.util.net>.__JIoEndpoint$SocketProcessor.__run(JIoEndpoint.java:302):302
> at
> java.util.concurrent.__ThreadPoolExecutor$Worker.__runTask(Unknown
> Source):-1
> at
> java.util.concurrent.__ThreadPoolExecutor$Worker.run(__Unknown

Peter Amiri

unread,
Feb 17, 2012, 2:01:30 PM2/17/12
to ra...@googlegroups.com
Brook,

I'm not familiar with this brand of loadbalancer so these are just suggestions. First of all make sure the LB check is an HTTP check and not a TCP check. Next I would check to see if I can make the manual connection from the LB and another machine on the same subnet as the LBs local link. Can you actually do a curl from the LB command line to the server in question? If the LB doesn't give you access to a local command line or curl then another machine on the same subnet may be fine.

Typically when you setup a LB in front of webservers. The servers will have internal ips and the lb will have an internal link and an external link. And depending on whether your LB is terminating the connection the Gateway of the webserver will either be set to the LB or another device on the network. But in your example you only mention public IPs. Depending on how your network is configured this may very well be a routing issue.

But it seems like the request is actually getting to the webserver it's just that the webserver doesn't know how to map the inbound request to the right web context to find the requested file. So I would try to capture more information on the 404 error. If you can actually setup a custom 404 page and log or email yourself with all the cgi variables. You need to see what the host header or host name of the request is and make sure that host name is in a <Alias> block.

Anyway I hope this gives you some ideas on where to go next.

--
Peter Amiri
Founder | Alurium Cloud Computing
949-338-3862pe...@alurium.com | http://www.alurium.com
LinkedIn: http://www.linkedin.com/in/peteramiri | IM bpamiri (AIM/MSN/Y!/GTLK/SKYPE)
Reply all
Reply to author
Forward
0 new messages