Tomcat configures IP address access restrictions and permits (server. XML)

Source: Internet
Author: User

Server. xml configuration file:

In
<Engine name = "Catalina" defaulthost = "localhost">
<Valve className = "org. apache. catalina. valves. RemoteAddrValve" allow = "" deny = "10.130.14.142, 10.130.14.49"/>

Note: access to the Tomcat server from 10.130.14.142 and 10.130.14.49IP addresses is denied.

<! -- For clustering, please take a look at documentation:
/Docs/cluster-howto.html (simple how)
/Docs/config/cluster.html (reference documentation) -->
<! --
<Cluster classname = "org. Apache. Catalina. Ha. tcp. simpletcpcluster"/>
-->

<! -- The request dumper valve dumps useful debugging information about
The request and response data were ed and sent by Tomcat.
Documentation at:/docs/config/valve.html -->
<! --
<Valve className = "org. apache. catalina. valves. RequestDumperValve"/>
-->

<! -- This Realm uses the UserDatabase configured in the global JNDI
Resources under the key "UserDatabase". Any edits
That are saved med against this UserDatabase are immediately
Available for use by the Realm. -->
<Realm className = "org. apache. catalina. realm. UserDatabaseRealm"
ResourceName = "UserDatabase"/>

<! -- Define the default virtual host
Note: The XML Schema validation will not work with Xerces 2.2.
-->
<Host name = "localhost" appBase = "webapps"
UnpackWARs = "true" autoDeploy = "true"
XmlValidation = "false" xmlNamespaceAware = "false">

<! -- SingleSignOn valve, share authentication between web applications
Documentation at:/docs/config/valve.html -->
<! --
<Valve className = "org. apache. catalina. authenticator. SingleSignOn"/>
-->

<! -- Access log processes all example.
Documentation at:/docs/config/valve.html -->
<! --
<Valve className = "org. apache. catalina. valves. AccessLogValve" directory = "logs"
Prefix = "localhost_access_log." suffix = ". txt" pattern = "common" resolveHosts = "false"/>
-->

</Host>
</Engine>

 

From: http://hi.baidu.com/dd_taiyangxue/blog/item/f6b205df379bf854ccbf1a86.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.