How to properly set up SVN on web server? How to properly set up SVN on web server? apache apache

How to properly set up SVN on web server?


I would advice against using a checkout working copy on production. The best way to upload to production is export. If you want something automatically you could look into some deployment script like Capistrano.

If you still want to do it .. you could use a htacccess to hide them:

<FilesMatch "\.svn/.*">   order deny,allow   deny from all</FilesMatch><Files .htaccess>   order deny,allow   deny from all</Files>


You can configure Apache to disallow access to .svn directories but you'd still need that your remote server has access to your local Subversion repository, with all the stuff that needs to be configured and secured: encryption, authentication, routers, firewalls...

I think the best compromise between flexibility and simplicity is actually using FTP but doing it with a file synchronization tool. You can either export your working copy into a temporary directory and synch from there or configure the tool to ignore the .svn directories. The synchronization process can be slow but being automated it doesn't really matter.

Also, don't forget about non-versioned files. Some need to be updated manually (such as setting files created from versioned templates) and some need to be ignored (such as cache files and user data).

As about the magic tool to do this all... I'm still looking for right one. So far, I'm using SyncBack freeware. It does the job but it's designed as a backup tool so it can be hard to configure.