Does anyone know if Tomcat can restrict access to certain application by IP address (like Apache's .htaccess
)?
相关问题
- Stop .htaccess redirect with query string
- Tomcat and SSL Client certificate
- .htaccess rule, redirecting old unexistent address
- How to deploy a web application Aurelia in an Apac
- Apache Directory Studio not opening
相关文章
- Tomcat的User信息可以存储到数据库中吗?
- tomcat的server.xml支持从Oracle中获取数据吗?
- web项目,Resonse Header发生解析错误,请大牛帮忙看看究竟是哪里的问题?
- Apache+Tomcat+JK实现的集群,如果Apache挂了,是不是整个服务就挂了?
- linux环境部署jpress,创建数据库时提提示连接失败
- WebService 启动调试后,能成功调用函数,但断点进不去任何方法
- How reliable is HTTP_HOST?
- Making a two way SSL authentication between apache
This is an example:
in \apache-tomcat-7.0.33\conf\server.xml:
To set up access restriction to your web-application for the certain IP addresses, add the following strings to /opt/tomcat/webapps/ROOT/META-INF/context.xml file:
Here is the instruction how to do this via Jelastic panel.
You add a
Valve
to theContext
incontext.xml
(specifically,org.apache.catalina.valves.RemoteAddrValve
). See the docs on Remote Host Filters.In Tomcat 7, you can configure it in the
web.xml
.If it's for all web apps, you can configure it in
tomcat7/conf/web.xml
, if it is just for one web app, you can configure it in thetomcat7/webapps/$(WEB_APP)/WEB-INF/web.xml
, it's very convenient.The configuration uses a
RemoteAddrFilter
filter, there is an example in Container Provided Filters.