拒绝访问.svn文件在Apache的文件夹 [英] Deny access to .svn folders on Apache

查看:398
本文介绍了拒绝访问.svn文件在Apache的文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们在颠覆一个Rails应用程序,我们使用Capistrano的部署,但已经注意到,我们可以访问/.svn,其中presents一个安全问题的文件。

We have a rails application in subversion that we deploy with Capistrano but have noticed that we can access the files in '/.svn', which presents a security concern.

我想知道什么是最好的方式做到这一点。有几个思路:

I wanted to know what the best way to do this. A few ideas:


  • 全局Apache配置为拒绝访问

  • 添加.htaccess文件在公用文件夹和所有子文件夹

  • 帽任务更改权限

我真的不喜欢删除的文件夹或使用svn出口,因为我想保持svn的信息周围的人的想法。

I don't really like the idea of deleting the folders or using svn export, since I would like to keep the 'svn info' around.

推荐答案

最好的选择是使用Apache的配置。

The best option is to use Apache configuration.

使用htaccess的或全球性的配置主要取决于如果你控制你的服务器。

Using htaccess or global configuration depends mainly on if you control your server.

如果你这样做,你可以使用像

If you do, you can use something like


<DirectoryMatch .*\.svn/.*>
    Deny From All
</DirectoryMatch>

如果你不这样做,你可以做.htaccess文件具有类似的东西FilesMatch

If you don't, you can do something similar in .htaccess files with FilesMatch

这篇关于拒绝访问.svn文件在Apache的文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆