Since I'm starting some real work on my final school project, I want to install a Ubuntu development server here at home. I have a Pentium 4 box here that will perform that task.
In this first part I will show you how to install Subversion over WebDAV. All of this will be done in such a way that it's easy to serve multiple projects at once.
In future parts I will tell you more about installing Trac, FastCGI (with Apache) to host Rails applications and how to use Capistrano to deploy your app properly.
First off, I installed Ubuntu 6.10 on my server. Because I don't need a graphical user interface, I have installed Ubuntu in text-only mode.
<h3>Open up to the universe</h3>
The first thing I always do when I install a Ubuntu box is to enable the universe package repositories. This is rather easy.
Edit /etc/apt/sources.list and uncomment all the Universe related lines. Also, comment out your install disk. Here's what my /etc/apt/sources.list looks like:
Because I have a MacBook, I'd like to use it to do my work. To do so I need to install the OpenSSH server on my server so I can access it over the network.
Note that you need to sudo the svn commands because only root has write access to your repository currently.
<h3>WebDAV for SVN</h3>
Okay. You are already at revision 3 on your repository. Good work! Now let's make sure that you repositories are accessable over the web. First, we install libapache2-svn. This packages includes WebDAV support for SVN.
Next I open up /etc/apache2/mods-available/dav_svn.conf. This file contains configuration for the WebDAV and SubVersion modules we just installed.
Here I enable basic HTTP authentication, which is good enough for my local network. I also enable DAV by uncommenting "DAV svn".
You need to take special care of the "SVNPath" variable here. We don't host just one repository. We host several and /var/lib/svn is the parent directory of all our repositories. E.g. 'colt' is a sub directory that resides in /var/lib/svn. To make Apache understand this we need to change "SVNPath" to "SVNParentPath". This enables all sub directories to be independent repositories.
Note: The authentication file we use here can be recycled later when we install Trac! Handy-Dandy, isn't it?
Now kick Apache to reload and you should be able to access your repository over the web! Try http://example.com/svn/colt.
<h3>Authentication</h3>
Reading of the repository is okay without authentication. But writing needs to be protected. We need to create a password file for this. This is easy and is already explained in /etc/apache2/mods-available/dav_svn.conf:
Before you start using Subversion, make sure you make the repositories owned by Apache. Apache is the one who wil access the repositories physically. This is really easy:
Alright sparky! Subversion access is ready for you now! Next time I'll tell you how to integrate Trac with your hot new Subversion repositories.
<h3>Notes</h3>
All users in you passwd file can write to all repositories. I've not yet found a way to prevent this, since I don't need that functionality right now. If you know more about this, please let me know.
Subversion repositories are always readable by anonymous people. You should remove the LimitExcept block from dav_svn.conf to make sure all users authenticated themselves before accessing your repository.
If you add more repositories, you always have to chown them to your apache's user and group. After that you can use them through WebDAV.