lighttpd限制IP访问指定URL
制作:高进波
时间:2009-09-24
WEB服务器
lighttpd
1.编辑配置文件
vi /etc/lighttpd/lighttpd.conf
#example
$HTTP["host"] == "gaojinbo.com" {
status.status-url = "/server-status"
server.name = "gaojinbo.com"
server.document-root = "/www/www.gaojinbo.com"
$HTTP["remoteip"] !~ "119.107.106|129.145.100.138" {
$HTTP["url"] =~ "^/server-status" {
url.access-deny = ( "" )
}
}
}
2.重启服务
/etc/init.d/lighttpd restart
完成!
附:
Task: Match on the remote IP
For example block access to http://theos.in/stats/ url if IP address is NOT 192.168.1.5 and 192.168.1.10 (restrict access to these 2 IPs only):
Open /etc/lighttpd/lighttpd.conf file
# vi /etc/lighttpd/lighttpd.conf
Append following configuration directive:
$HTTP["remoteip"] !~ "200.19.1.5|210.45.2.7" {
$HTTP["url"] =~ "^/stats/" {
url.access-deny = ( "" )
}
}
Save and restart lighttpd:
# /etc/init.d/lighttpd restart
五月 3rd, 2011 at 05:33
Some New Sites I Like…
[...]below you’ll find the link to some websites that I think you should go and see http://www.panicattackstreatmentcure.net/links/ some are related to my site and others are unrelated but definitely worth visiting[...]…
七月 26th, 2011 at 06:46
You should check this out……
[...] Wonderful story, reckoned we could combine a few unrelated data, nevertheless really worth taking a look, whoa did one learn about Mid East has got more problerms as well [...]………