Contact Us
  
 
 
    SearchSearch   RegisterRegister   Log inLog in 

how to restrict IP in tomcat

how to restrict IP in tomcat

 
Post new topic   Reply to topic     Forum Index -> Tomcat Installation Problems
View previous topic :: View next topic  
Author Message
admin
Site Admin


Joined: 24 Aug 2006
Posts: 30

PostPosted: Sun Jul 20, 2008 11:58 am    Post subject: how to restrict IP in tomcat Reply with quote

Tomcat having facility to restrict IP easily.
Back to top
View user's profile Send private message Send e-mail
seniormember
Site Admin


Joined: 20 Jul 2008
Posts: 77

PostPosted: Wed Aug 13, 2008 4:43 pm    Post subject: Reply with quote

Blocking IP in tomcat can be done in context.xml file of config folder of tomcat.
You can do in this file with tomcat package RemoteAddrValve with deny ip range of our.
context.xml
Code:

<Context reloadable="true" privileged="true" >

    <WatchedResource>WEB-INF/web.xml</WatchedResource>
   
   <Valve className="org.apache.catalina.valves.RemoteAddrValve" deny="123.236.52.9"/>

</Context>


Can also use wild cards to deny or allow ip range

After this done restart tomcat again check open this from 123.236.52.9 ip
It will restrict ip access of tomcat. This will throw exception of 403 forbidden access

Output
Code:

HTTP Status 403 -

type Status report

message

description Access to the specified resource () has been forbidden.
Apache Tomcat/6.0.14
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Tomcat Installation Problems All times are GMT
Page 1 of 1

 
Jump to:  
  Quick Post a Reply Topic
     
  Name (required)  
     
  Email Address (will not be published) (required)  
     
  Subject of topic (required)  
     
   
     
   
     
  Advertisement  
     
 
     


  More Links  
 
JSP Introduction
JSP Setup
Simple JSP Example
JSP Variable
Array Declaration in JSP
JSP Forms and User Input
Form Validation
JSP Cookies
JSP Session Object
Loop, content collection, iterator, conditional check in JSP
JSP Application Object
JSP Include
JSP Response Object
JSP Request Object
JSP Error Handling
JSP File Handling Object
JSP Action Tag
JSP Implicit Objects
JSP Declaration
JSP Directive
JDBC Introduction
JDBC Driver
JDBC Connection
JDBC Prepared/Statement
JDBC ResultSet
JDBC Close Connection object
JDBC Insert
JDBC Display Records
JDBC Update
JDBC Delete
JDBC Sorting
JDBC Query
JDBC Exception
JDBC Add Batch
JDBC Transaction/RollBack