weblogic概览下的上下文根配置_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.

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.

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.

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

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.

WebLogicCluster host:port,host:port

KeepAliveEnabled ON

WLProxySSL OFF

Debug ALL

ErrorPage http://host:port/errors/errorSystem.html

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

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

解决方案

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.".

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

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

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

404

/errors/404.html

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

/

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

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.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值