允许 Lighttpd 中某些 IP 的目录访问
我需要重写此规则(来自 apache 的 .htaccess):
<files "*.*">
Allow from 84.47.125.0/19 66.211.160.0/19 216.113.160.0/19
Deny from All
</files>
对于 lighttpd,仅允许那些 IP 访问我的 /pswd 目录:
84.47.125.0/19, 66.211.160.0/19, 216.113.160.0/19
我怎样才能在 lighttpd 中做到这一点?
I need to rewrite this rules (from apache's .htaccess):
<files "*.*">
Allow from 84.47.125.0/19 66.211.160.0/19 216.113.160.0/19
Deny from All
</files>
To lighttpd ones, to allow the access to my /pswd directory only for those IP's:
84.47.125.0/19, 66.211.160.0/19, 216.113.160.0/19
How can I do that in lighttpd?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我从未使用过 lighttpd,但我在 Google 上找到了这个:
http://www.cyberciti。 biz/tips/lighttpd-restrict-or-deny-access-by-ip-address.html
它有一个阻止 2 个 IP 和阻止单个 IP 访问的示例。通过执行以下操作,它应该可以轻松地适应您:
然后:
I've never used lighttpd but I've found this on Google:
http://www.cyberciti.biz/tips/lighttpd-restrict-or-deny-access-by-ip-address.html
It has an example for blocking access for 2 IPs and for blocking a single IP. It should be easily adaptable for you by doing this:
and then: