Site Deployment with Subversion
While working for a previous employer I was tasked with developing a new company “intranet” site. Changes rolled out at an aggressive rate and the process of deploying updates via FTP quickly turned into a tedious task.
After a while I decided to spend some personal time thinking of ways to make whole process a bit smoother. A few of days passed as I tossed around various ideas in my head, then it hit me…
Why not just checkout a working copy of the project onto the production server itself?

So simple! All I’d have to do is use the production server’s subversion client to add, update, and remove any changes — deployment becomes as simple as: $ svn up
Setting Up The Environment
As is the case with most ideas there ended up being a few issues that needed to be worked out before moving forward.
Subversion’s .svn Directories
A working copy of a subversion repository is riddled with hidden .svn directories. This is a security risk as, by default, these directories and their contents are publicly accessible. To fix this issue we need to deny access by adding the following lines of code to either the Apache Global Config file, the site’s <VirtualHost> block, or the .htaccess file in the site’s root directory.
1 2 3 4 | <Directory ~ "\.svn"> Order allow,deny Deny from all </Directory> |
See Apache Tips & Tricks: Deny access to some folders for more information.
- June 17, 2010
- Categories: Development