解决jeesite打开 druid 连接池监控报错 Sorry, you are not permitted to view this page.

解决jeesite打开 druid 连接池监控报错 Sorry, you are not permitted to view this page.

一、问题描述
1、在使用 阿里的 Druid 连接池的时候,遇到一个奇怪的问题,在本地(localhost)可以直接打开 Druid连接池监控,在其他机器上打开会报错: Sorry, you are not permitted to view this page.

解决jeesite打开 druid 连接池监控报错 Sorry, you are not permitted to view this page._第1张图片

二、解决办法
在web.xml中可以看到如下代码配置:

<servlet>
        <servlet-name>DruidStatViewservlet-name>
        <servlet-class>com.alibaba.druid.support.http.StatViewServletservlet-class>
        <init-param>
            <param-name>allowparam-name>
            <param-value>127.0.0.1param-value>
        init-param>
    servlet>

意思应该是: 允许访问连接池监控 地址设定。 设置为: 127.0.0.1 ,只允许项目部署的那台机器可以访问连接池监控。
解决办法: 去掉 “init-param” 标签即可,任意地址访问连接池监控。

补充:若要设置多个ip可以访问连接池监控 ,需要用 逗号分开,即可。
如: 192.168.1.2,10.4.23.66,60.205.221.22

参考资料:http://blog.csdn.net/sina_wjz/article/details/53812239

你可能感兴趣的:(Bug/Exception)