Basic tutorial on apache IP address sealing

Source: Internet
Author: User

The Order Command controls the default access status and the Order in which the Allow and Deny commands are evaluated. Ordering is one of the following examples:

Deny, Allow
The Deny Command is evaluated before the Allow command. All accesses are allowed by default. Any customer that does not match the Deny Command or matches the Allow command is allowed to access the server.
Allow, Deny
The Allow command is evaluated before the Deny Command. By default, all accesses are prohibited. Any customer that does not match the Allow command or the Deny Command will be banned from accessing the server.
Mutual-failure
Access to a host is allowed only when it appears in the Allow List and does not appear in the Deny list. This Order has the same effect as Order Allow and Deny. I do not agree with it. Which configuration does it include.
Keywords can only be separated by commas; there cannot be spaces between them. Note that in all cases, each Allow and Deny command statement will be evaluated.

In the following example, access from all hosts in the apache.org domain is allowed, and access from any other hosts is denied.

Order Deny, Allow
Deny from all
Allow from apache.org


In the following example, all hosts in the apache.org domain are allowed to access all the hosts except those in the foo.apache.org subdomain. All hosts not in the apache.org domain are not allowed to access the server because access to the server is denied by default.

Order Allow, Deny
Allow from apache.org
Deny from foo.apache.org


On the other hand, if the Order command in the previous example is changed to Deny or Allow, access to all hosts is allowed. This is because, regardless of the actual order of commands in the configuration file, the Allow from apache.org command will be evaluated and overwritten by the previous Deny from foo.apache.org command. All hosts not in the apache.org domain are also allowed to access because the default status is changed to allow.

Even if the Allow and Deny commands are not accompanied, the existence of an Order command will also affect access to a certain part of the server, because of its impact on the default access status. For example,

<Directory/www>
Order Allow, Deny
</Directory>

In this way, all accesses to the/www directory will be prohibited.

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.