阿帕奇访问控制
我正在尝试将 Apache 配置为允许只读访问,并要求用户在来自本地网络 (10.*) 时写入 SVN 存储库,但不允许任何访问,除非在来自外部网络时登录。
我有点了解 Order、Deny、Allow 和 Limit 指令的工作原理,但我不知道是否可能/如何将它们组合起来以达到预期的结果。
<Location /svn>
# Set mod_dav_svn settings
DAV svn
SVNListParentPath on
SVNParentPath /mnt/svn
AuthzSVNAccessFile /mnt/svn/.authz
# Set Authentication
AuthType Basic
AuthName "Auth Realm"
AuthUserFile /mnt/svn/.htpasswd
Order Deny,Allow
Deny from all
Allow from 127.0.0.1 10.0.0.0/8
<LimitExcept GET PROPFIND OPTIONS REPORT>
Require valid-user
</LimitExcept>
Satisfy Any
</Location>
我知道这将允许对任何本地流量的所有访问,但在尝试从外部流量写入时要求登录。 这很接近我想要的。 非常感谢任何有关阅读内容的帮助或建议。
I'm trying to configure Apache to allow read only access and ask for user to write to a SVN repository when you are coming from the local network (10.*) but not allow any access unless logged in when coming from external network.
I sort of understand how the Order, Deny, Allow, and Limit directives work but I do not know if it is possible/how to combine them to achieve the desired result.
<Location /svn>
# Set mod_dav_svn settings
DAV svn
SVNListParentPath on
SVNParentPath /mnt/svn
AuthzSVNAccessFile /mnt/svn/.authz
# Set Authentication
AuthType Basic
AuthName "Auth Realm"
AuthUserFile /mnt/svn/.htpasswd
Order Deny,Allow
Deny from all
Allow from 127.0.0.1 10.0.0.0/8
<LimitExcept GET PROPFIND OPTIONS REPORT>
Require valid-user
</LimitExcept>
Satisfy Any
</Location>
I know this will allow all access to any local traffic but ask for login when trying to write from external traffic. This is close to what I want. Any help or suggestions on what to read are greatly appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为没有解决办法。
I don't think there is a solution.
这可能是一个迟到的回复,但你可以添加两个
VirtualHost 指令需要 ip 或 * 以及要侦听的端口。 假设您的主机托管在具有两个网卡的计算机上,只要每个网卡仅侦听正确的卡,它就应该执行您想要的操作......
This may be a late reply, but you could add two
The VirtualHost directive requires an ip or * and the port to listen on. Assuming your hosting on a machine with two network cards, as long as each only listens on the correct card it should do what you wanted....