{"id":349,"date":"2008-07-27T21:47:51","date_gmt":"2008-07-28T02:47:51","guid":{"rendered":"http:\/\/unitstep.net\/?p=349"},"modified":"2008-07-27T21:47:51","modified_gmt":"2008-07-28T02:47:51","slug":"protecting-svn-metadata-folders-on-a-web-server","status":"publish","type":"post","link":"https:\/\/unitstep.net\/blog\/2008\/07\/27\/protecting-svn-metadata-folders-on-a-web-server\/","title":{"rendered":"Protecting SVN metadata folders on a web server"},"content":{"rendered":"

I recently changed my WordPress install over to an SVN checkout<\/a> in order to get rid of the tedious steps required to upgrade every time a new version is released.<\/p>\n

Thankfully, following the well-written guide on the WordPress.org Codex was easy and straightforward – both for changing this existing installation over to SVN and for setting up a new blog<\/a> for RunTrackr<\/a>. I now look forward to updates, just so I can relish in the ease of upgrading. \ud83d\ude42<\/p>\n

SVN is a powerful tool (I use it both at work and for personal projects) and is a great SCM tool for small-to-medium sized projects. The command-line tool is easy to use, and for Windows, the great TortoiseSVN<\/a> tool can’t be beat. (It integrates nicely with the Windows explorer and is compatible with the Eclipse Subclipse SVN integration plugin) Additionally, the integrated Apache HTTP<\/acronym> server lends itself nicely to many web-based applications that not only enable browsing but also form the basis for some remote backup\/file-sharing\/synchronizing services out there.<\/p>\n

One thing you’ll probably want to do after switching WordPress (or any web application) to a SVN checkout is to protect the .svn<\/code> metadata folders from public access. These folders are used by the Subversion client to keep track of changes and determine what files need to be updated when getting the latest versions. They also contain information about what SVN server you are using – in some cases you don’t want to reveal these details, and in any case it’s always best practice to deny access to anything except for that which you explicitly want to make public.<\/p>\n

Doing this is fairly straightforward with Apache. All you need to do is edit your .htaccess<\/code> file in the root of your web directory. Add an entry like this:<\/p>\n

# SVN metadata folder protection.\r\n<IfModule mod_rewrite.c>\r\n  RewriteRule ^(.*\/)?\\.svn\/ - [F,L]\r\n<\/IfModule><\/code><\/pre>\n

This works for me, though some have used<\/a> other regular expressions to accomplish the same task.<\/p>","protected":false},"excerpt":{"rendered":"

I recently changed my WordPress install over to an SVN checkout in order to get rid of the tedious steps required to upgrade every time a new version is released. Thankfully, following the well-written guide on the WordPress.org Codex was easy and straightforward – both for changing this existing installation over to SVN and for […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[87,251,25],"tags":[252,428,466,415],"_links":{"self":[{"href":"https:\/\/unitstep.net\/wp-json\/wp\/v2\/posts\/349"}],"collection":[{"href":"https:\/\/unitstep.net\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unitstep.net\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unitstep.net\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unitstep.net\/wp-json\/wp\/v2\/comments?post=349"}],"version-history":[{"count":2,"href":"https:\/\/unitstep.net\/wp-json\/wp\/v2\/posts\/349\/revisions"}],"predecessor-version":[{"id":351,"href":"https:\/\/unitstep.net\/wp-json\/wp\/v2\/posts\/349\/revisions\/351"}],"wp:attachment":[{"href":"https:\/\/unitstep.net\/wp-json\/wp\/v2\/media?parent=349"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unitstep.net\/wp-json\/wp\/v2\/categories?post=349"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unitstep.net\/wp-json\/wp\/v2\/tags?post=349"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}