Apache的Weblogic的404配置 [英] Apache-Weblogic 404 configuration

查看:2889
本文介绍了Apache的Weblogic的404配置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我四处寻找这个颇有几分发现了类似的问题,但不完全一样,但尽管如此我道歉,如果这是一个重复的问题。

I've searched around for this quite a bit and found similar questions but not exactly the same, but nonetheless I apologize if this is a duplicate question.

基本上,我试图来处理HTTP错误响应(即404)与自定义错误页(即404.html)时,我的应用程序已关闭,但weblogic的仍上涨。

Basically, I am trying to handle HTTP error responses (i.e. 404) with a custom error page (i.e. 404.html) when my application is down, but weblogic is still up.

我使用的Apache 2.2与WebLogic模块。我已经为Apache的ErrorDocument指令以及块内的参数的errorPage。

I am using Apache 2.2 with the weblogic module. I have set the ErrorDocument directive for Apache as well as the ErrorPage parameter within the block.

我还设置位置我的web.xml我的应用程序中,但这个问题是当应用程序了。

I have also set the location within my web.xml for my application, but this question is for when the application is down.

目前,当应用程序已关闭和WebLogic运行时我收到的WebLogic默认的404页面。如何强制Apache和/或weblogic的使用我的自定义页面?

Currently, when the app is down and weblogic is running I am getting the weblogic default 404 page. How can I force apache and/or weblogic to use my custom page?

下面是我试过的配置的一个变体的样本。

Here is a sample of one variation of the config that I have tried.

 <IfModule mod_weblogic.c>
    WebLogicCluster host:port,host:port
    KeepAliveEnabled ON
    WLProxySSL OFF
    Debug ALL
    ErrorPage http://host:port/errors/errorSystem.html
</IfModule>

我可以直接访问错误页,但交通是永远不会转发错误。

I can access the error page directly, but traffic is never forwarded on error.

我也试着到的errorPage设置为相对URL这是理想的解决方案。

I've also tried to set the ErrorPage to a relative url which is the ideal solution.

推荐答案

根据WebLogic文档,用的errorPage参数的插件重定向到一个错误页面时,后端服务器返回一个HTTP 503 /服务不可用响应,并有故障转移没有服务器。的。

According to WebLogic documentation, with ErrorPage parameter, "The plug-in redirects to an error page when the back-end server returns an HTTP 503/Service Unavailable response and there are no servers for failover.".

从的WebLogic所以404错误会的不可以被重定向到的errorPage参数中指定我们的自定义错误页。

So 404 error from WebLogic will not be redirected to our custom error page specified with ErrorPage parameter.

解决方法是创建一个简单的Web应用程序,并将其部署到您的WebLogic。在这个Web应用程序:

The workaround is to create a simple webapp and deploy it onto your WebLogic. In this webapp:


  1. 在[的web.xml ] Specifiy自定义错误code和页面的映射,例如:

  1. in [web.xml] Specifiy your custom error code and page mappings, e.g.:

&LT;错误页>结果
&NBSP;&NBSP;&LT;无差错code> 404 LT; /无差错code>结果
&NBSP;&NBSP;&LT;位置> /errors/404.html</location>结果
&LT; /错误页>

<error-page>
  <error-code>404</error-code>
  <location>/errors/404.html</location>
</error-page>

在[ weblogic.xml中]国家,你的上下文根为/:

in [weblogic.xml] State that your context-root is '/':

&LT; WebLogic的web应用程序的xmlns =htt​​p://www.bea.com/ns/weblogic/90的xmlns:XSI =htt​​p://www.w3.org/2001/XMLSchema-instance >结果
&NBSP;&NBSP; &LT;上下文根> /&LT; /上下文根> 结果
&LT; / WebLogic的web应用程序>

<weblogic-web-app xmlns="http://www.bea.com/ns/weblogic/90" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <context-root>/</context-root>
</weblogic-web-app>

您需要有到位的错误页面,如/错误'你的web应用的文件夹中。

Your need to have error pages in place such as in '/errors' folder of you webapp.

注意'的 FMW欢迎页面应用程序的'可能已部署在WebLogic域中使用'/'作为上下文根。如果是这样的话,我相信它是安全的,取消其部署或untarget,但建议您提出一个SR产品支持询问是否是hardful这样做。

Note that the 'FMW Welcome Page Application' might have already been deployed and using '/' as context-root in your WebLogic domain. If that is the case, I believe it is safe to undeploy it or untarget it, but you are advised to raise a SR to product support asking whether it is hardful to do so.

这篇关于Apache的Weblogic的404配置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆