Deny External Access to Subversion Directories on Web Servers

Deny External Access to Subversion Directories on Web Servers
By Shay Anderson on February 2014
Denying access to Subversion directories on Web servers is a good idea.

Apache
Here is how to accomplish this in Apache (CentOS 6 example): # nano /etc/httpd/conf/httpd.confThen add these lines in the file and save:
Deny From All
Restart Apache: # service httpd restart
Nginx
Here is how to deny access in Nginx (CentOS 6 example): # nano /etc/nginx/conf.d/default.confAdd these lines in the server block and save file: # deny access to SVN dirs
location ~ /.svn/ {
deny all;
}
Restart nginx: # service nginx restart

Finally, test all access to Subversion directories for assurance.