Apache module mod_access

Source: Internet
Author: User

Includes two main functions

1. IP addresses allowed to access the website

Description: controls which hosts can access a region of the server.
Syntax: Allow from all | host | env = env-variable [host | env = env-variable]...
Context: Directory,. htaccess
Coverage: Limit
Status: Base
Module: mod_access

Instance

SetEnvIf User-Agent ^ KnockKnock/2.0 let_me_in
<Directory/docroot>
Order Deny, Allow
Deny from all
Allow from env = let_me_in
</Directory>

Second, prohibit access to the IP address of the network.

Control which hosts are prohibited from accessing the server
Syntax: Deny from all | host | env = env-variable [host | env = env-variable]...
Context: Directory,. htaccess
Coverage: Limit
Status: Base
Module: mod_access

This command allows you to restrict access to the server based on the host name, IP address, or environment variable. The parameter settings of the Deny Command are identical to those of the Allow command.


Order Command
Note: control the default access status and the order in which the Allow and Deny commands are evaluated.
Syntax: Order ordering
Default value: Order Deny, Allow
Context: Directory,. htaccess
Coverage: Limit
Status: Base
Module: mod_access

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>

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.