The Apache how to limit the visitor’s IP
Posted 程序小黑
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了The Apache how to limit the visitor’s IP相关的知识,希望对你有一定的参考价值。
First locate the context in the config “/etc/https/conf/httpd.conf” with “<Directory /var/www/html/></Directory>”.
If we want to deny special IP address like “192.168.1.1” visit our website,we should add the config like in under:
Options Indexes FollowSymlinks
AllowOverride None
Order Allow, Deny
Deny from 192.168.1.1
Allow from all
And if we want to deny the network subnet to visit our websit,so we can add the config like :
Options Indexes FollowSymlinks
AllowOverride None
Order Allow,Deny
Deny from 192.168.1.0/24
Allow from all
now,this is the way how to Deny the special IP address,if we should allow the special IP address visit our websit,how to do?
Either in this config file(“/etc/httpd/conf/httpd.conf”),and we can edit this config file and add the context like:
Options Indexes FollowSymlinks
AllowOverride None
Order Deny,Allow
Allow from 192.168.1.1
Deny from all
However,we can allow any other special IP address to visit our website:
Options Indexes FollowSymlinks
AllowOverride None
Order Deny,Allow
Allow from 192.168.1.0/24
Deny from all
Above is the way that how to limit the remote ip visit our website.
以上是关于The Apache how to limit the visitor’s IP的主要内容,如果未能解决你的问题,请参考以下文章
There Are Now 3 Apache Spark APIs. Here’s How to Choose the Right One
How To Size Your Apache Flink® Cluster: A Back-of-the-Envelope Calculation
How to solve the problem that Github can't visit in China?
How can you catch a process that is about to be launched, if you don’t know the PID yet?
How to use the Allow/Deny permissions policy in the existing project