Solved

Web Server Strategy (Sun One WebServer)

Posted on 2009-05-11
15
482 Views
Last Modified: 2013-11-21
Hi,

I currently have a problem that I need all of yours' opinions to solve.

We have a website that has a lot of services that are implemented using BEA WebLogic with combination of ColdFusion and other technologies. On top of that, we have Sun One WebServer playing the role as the webserver to manage the traffic to both BEA as well as ColdFusion server from the public.

Now, i have a requirement to implement a program in the webserver to check whether the BEA or CF pages that public requested are available or not upon clicking on the URL. If yes, proceed with the URL, if not, show some generic error message. Is there any mechanism in webserver (maybe not Sun One WebServer) to trigger Servlet execution if any of the URL is executed by public?

If you have a similar suggestion for non-J2EE, I am also okay. At this point, i just want to get more inputs for this :).

Thanks
David
0
Comment
Question by:suprapto45
  • 7
  • 4
  • 4
15 Comments
 
LVL 92

Expert Comment

by:objects
ID: 24360575
can you setup a custom 404 page to handle when its not there?

0
 
LVL 16

Author Comment

by:suprapto45
ID: 24360624
Hi objects,

Thanks. Unfortunately, no.

I am in charge of some BEA WebLogic apps so let me explain it in the BEA context. When Sun One redirect to the JSP pages that are not available in BEA, BEA will report 404. However, Sun One will think that the redirection is successful and will not be able to get this 404 error. But you are right, there is a 404 catch in Sun One.

If I want to do this in BEA apps, it is also tricky. We have like 40-50 small to medium projects deployed to WebLogic and to tackle 404, AFAIK, we have to implement this in every single apps. Am I right?

Thanks.
David
0
 
LVL 92

Assisted Solution

by:objects
objects earned 100 total points
ID: 24360778
> Am I right?

not sure (we don't use BEA). If all the apps are running in the one BEA instance then you might be able to set a global 404, no idea how or if its possible.

Other than that I don't see any options that avoid Sun1 making an extra request to BEA to see if its available or not.

0
 
LVL 16

Author Comment

by:suprapto45
ID: 24360873
Hi objects,

Thanks. I will keep this thread open for a while to see if anybody else has other opinions. In the meantime, I am also googling.

Thanks again.
David
0
 
LVL 20

Expert Comment

by:ChristoferDutz
ID: 24361837
Well how about implementing some sort of proxy component on the Sun One server. When clicking a link (you could prefix all links that should be checked with "/check"). the Sun One then uses the Apache HTTPClient to check if the resource (without the "/check") is available and if it is, it sends back a html page with a META refresh redirect to the url without the "/check" prefix. The browser then loads the page directly. If a page is not available, you send an error page.

I know this is a sort of hacky approach, but I think I got from your post, that you have a lot of applications running and you want to add this feature for one special application. Am I correct?
0
 
LVL 16

Author Comment

by:suprapto45
ID: 24362126
Hi ChristoferDutz,

Thanks.

>>"Am I correct?"
Unfortunately no, i need to apply this to all applications. But I am open to any suggestions. So, if using your approach, i have to change all my URLs to append it with /check in order for them to be checked. Am I right?

Thanks
David
0
 
LVL 20

Accepted Solution

by:
ChristoferDutz earned 300 total points
ID: 24362171
Or you do it the other way around ... redirect all "/checked" and check only URLs with no "/checked" prefix. But I'd really suggest not doing this, because It would really stress your Sun One server with tons of requests it has to check.
0
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
LVL 16

Author Comment

by:suprapto45
ID: 24362212
>>"Or you do it the other way around ... redirect all "/checked" and check only URLs with no "/checked" prefix"
Hey, interesting point! I will explore that further.

Thanks
David
0
 
LVL 16

Author Comment

by:suprapto45
ID: 24362224
Hi ChristoferDutz,

By the way, what is the approach that you propose for checking the URL using HttpClient? Using Servlet's Filter or any other thing that you have in mind in Sun One?

Thanks
David
0
 
LVL 92

Expert Comment

by:objects
ID: 24362572
its still going to involve two requests as I mentioned earlier.

0
 
LVL 20

Assisted Solution

by:ChristoferDutz
ChristoferDutz earned 300 total points
ID: 24362728
HttpClient is a JavaBased HTTP client from Apache. But I would really suggest not to do this check, if ALL requests have to got through this mechanism. You would really get into performance problems and you would have to refactor your code if you also want to extend this mechanism for resources (Which would be really bad).

You would start double stressing the backend servers.

But I have to admit, that it's sort of strange, that the Sun One doesn't proxy the error pages as error pages. Usually they are served with the response code in hte header and there is no reason for the Sun One to forward a 404 as 200. Are you sure you have configured the redirection correctly?
0
 
LVL 20

Expert Comment

by:ChristoferDutz
ID: 24362743
Ok ... I read your post once again ... your company wants to have unified error pages?
No matter whar resource is requested, no application specific error page is sent, this is replaced by the universal error page, preventing exposure of application details? Or am I on the wrong track here?
0
 
LVL 16

Author Comment

by:suprapto45
ID: 24370883
Thanks.

objects >> i agree with you on that.

ChristoferDutz >> Yes you are right. The error page will be unified and there will be no application-specific error page.

>>"But I have to admit, that it's sort of strange, that the Sun One doesn.....redirection correctly?"
Me too. I am still googling out as I believe that this is the problem in the WebLogic plugin. As I have informed objects before, when BEA reported 404, Sun one was not be able to catch this 404 and I find this is very strange. Additionally, when I check the access.log and it showed that the HTTP status is correct i.e. 404 instead of 200 but Sun One simply could not get it. Anyway, if the 404 occurred at Sun One side (JSP resides at Sun One) not BEA WebLogic, the error redirection works fine.

For now, I think that if I can catch the 404 in BEA WebLogic from Sun One, this will be solved. I am still trying and let you all know if i find the solution.

Thanks
David
0
 
LVL 92

Expert Comment

by:objects
ID: 24370888
if its a redirect then its the browser sending the request to WL, not Sun One
0
 
LVL 16

Author Comment

by:suprapto45
ID: 24419907
Ok, found the solution.

http://forums.sun.com/thread.jspa?threadID=5381736&start=0&tstart=0

After that, my SunOne is able to get the 404 from WebLogic. I am going to split the points anyway as both of your views are very helpful.

Thanks again.
David
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Periodically we have to update or add SSL certificates for customers. Depending upon your hosting plan you may be responsible for the installation and/or key generation. In the wake of Heartbleed many sites were forced to re-key. We will concen…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now