Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to block access to the .svn/entries on my webserver?

Tags:

nginx

svn

I setup an NGINX webserver and use svn to manage project folder. Nessus found the weakness:

Configure permissions for the affected
web server to deny access to the
'.svn' directory.

How do I block access to the .svn directory? It seems that svn export is the more preferable way to checkout on the webserver, but it easier to me to use svn up.

like image 225
Daniel Avatar asked Nov 30 '10 15:11

Daniel


2 Answers

finally I found the right way to make it in nginx. Add to nginx.conf this lines in server {} definition:

    location ~ /.svn/ {
      deny all;
    }

That's all!

like image 174
Daniel Avatar answered Nov 14 '22 10:11

Daniel


Put the following in a file called ".htaccess" (if you're running Apache):

<FilesMatch "^\.svn">
  Deny from all
</FilesMatch>
like image 34
goreSplatter Avatar answered Nov 14 '22 09:11

goreSplatter