Client access control is done before the apache2.4 version, which is accessed with the Allow Deny Order directive, and the usage in version 2.4 is different from the previous version, as follows
- ################################################
- Configuration on the 2.2
- Order Deny,allow
- Deny from all
- Configuration on the 2.4
- Require all denied
- ################################################
- Configuration on the 2.2
- Order Allow,deny
- Allow from all
- Configuration on the 2.4
- Require all granted
- #################################################
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Here are a few examples of configurations on version 2.4
1. Allow only hosts with IP 192.168.1.1 access
- <requireall>
- Require all granted
- Require IP 192.168.1.1
- </requireall>
2. Allow only host access to the 192.168.0.0/24 network
- <requireall>
- Require all granted
- Require IP 192.168.1.0/24
- </requireall>
3. Prohibit 192.168.1.2 host access, others are allowed to access,
- <requireall>
- Require all granted
- Require not IP 192.168.1.2
- </requireall>
4. Allow all Access,
- Require all granted
- Note, this can not be added container <RequireAll> ... </RequireAll>
- Directly, written in the <directory "" > .....</directory> inside is OK
5. Deny all Access,
- Require all denied
Official Document Http://httpd.apache.org/docs/2.4/howto/access.html
Client access control is done before the apache2.4 version, which is accessed using the Allow Deny Order command.