網路城邦
上一篇 回創作列表 下一篇   字體:
[心得]怎麼讓apache阻擋某些IP的訪客?
2005/10/09 13:59:56瀏覽2784|回應1|推薦3
本站之前疑似遇到駭客攻擊...
看到一些方法來預防...
其中我覺得很有效的就是直接在apache中設定組態,阻擋某些IP進入自己的網站
設定方法如下:


1.打開apache的httpd.conf
2.找到以下的敘述,並加入紅色的程式碼:

#
# Aliases: Add here as many aliases as you need (with no limit). The format is
# Alias fakename realname
#


#
# Note that if you include a trailing / on fakename then the server will
# require it to be present in the URL. So "/icons" isn't aliased in this
# example, only "/icons/". If the fakename is slash-terminated, then the
# realname must also be slash terminated, and if the fakename omits the
# trailing slash, the realname must also omit it.
#
Alias /icons/ "C:/AppServ/Apache/icons/"


Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all


#
# ScriptAlias: This controls which directories contain server scripts.
# ScriptAliases are essentially the same as Aliases, except that
# documents in the realname directory are treated as applications and
# run by the server when requested rather than as documents sent to the client.
# The same rules about trailing "/" apply to ScriptAlias directives as to
# Alias.
#
ScriptAlias /cgi-bin/ "C:/AppServ/www/cgi-bin/"

#
# "C:/Apache/cgi-bin" should be changed to whatever your ScriptAliased
# CGI directory exists, if you have that configured.
#

AllowOverride None
Options None
Order allow,deny
Allow from all




Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
Deny from 140.113.150.66
Deny from 140.113.150




# End of aliases.

3.解說:
Deny from 140.113.150.66 代表阻擋來自140.113.150.66這個IP的訪客
Deny from 140.113.150 代表阻擋來自140.113.150.1~140.113.150.254這些IP的訪客

4.要阻擋的IP可以任意的增加...
( 興趣嗜好電腦3C )
回應 推薦文章 列印 加入我的文摘
上一篇 回創作列表 下一篇

引用
引用網址:https://classic-blog.udn.com/article/trackback.jsp?uid=mashow&aid=77771

 回應文章


等級:
留言加入好友
如何讓訪客無法得知自己所用的Web Server資訊
2005/12/29 07:31
印象中有可以讓訪客無法得知自己所用的Web Server資訊的設定, 這樣相信可以讓你的Server更加安全, 不過我是不知道怎麼設定就是了...