I want to restrict access to a webapp running on a tomcat server by ip address.
Found out that I would have to use org.apache.catalina.valves.RemoteAddrValve and set it in a tomcat context.xml
But within my tomcat folder I have 4 of it:
\conf
\backup
\webapps\host-manager\META-INF
webapps\manager\META-INF
Where to I have to place my Rule?
You have to choose
context.xmlwhich is underTOMCAT_HOME/conf/if you want to apply this restriction to all webapps running on your tomcat.Choose
yourapp/META-INF/context.xmlif you want to keep it only for application.If the web application is packaged as a WAR then
/META-INF/context.xmlwill be copied to$TOMCAT_HOME/conf/[enginename]/[hostname]/and renamed to match the application’s context path.webapps\manager\META-INF=> if you add restriction here, yourtomcat managerwill be restricted i.e.tomcat administration.