SETTING UP CVS/SVN/HTTP/HTTPS ON YOUR HOME MACHINE


This page describes my experiences in setting up CVS/SVN/HTTP/HTTPS capabilities on my home machine. A number of things have been put together based on trial-and-error, and might not be the best way of doing things. It has been verified to work on Ubuntu Feisty, but should work on other distributions too (possibly with some minor modifications).

If you have any feedback about better ways of doing the same, please let me know and I will update the page accordingly.


PROVIDING A DOMAIN NAME FOR YOUR HOME MACHINE

ISPs typically provide two kinds of IP address plans for their customers: dynamic and static addresses. Most people use dynamic IP addresses because they are 2-3 times cheaper as compared to static IP addresses. This means that the IP address of your machine (or the external IP address of your router if you have one) is given to you only for a lease of time. Once this expires, a new IP address will be given. In this section, we will see how we can get a static hostname mapping for your machine inspite of having a dynamic IP address.

To get a static hostname, you will need to first create an account at http://www.dyndns.com. These accounts are free. Once logged in, update your account by providing information about your home machine and choosing a static hostname from the options provided.

Once your account is setup and configured, the next step is to setup your home router or machine to update your DynDNS account whenever you get a new IP address. Most routers available in the market already support this capability, so first check if your router does this. If it does, all you have to do is enter your DynDNS account information in your router's web interface and you are done. If it doesn't, you will have to use a third party software to provide the same functionality. You can find some such software here: (http://www.dyndns.com/support/clients).



DIRECTORY STRUCTURE SETUP

I don't like the way the groups structure is setup by Ubuntu by default. So, I changed a bunch of things to suit my taste better.

$ sudo mkdir -m 775 /home/cvs /home/svn /home/http /home/http/cgi

$ sudo chmod g+s /home/cvs /home/svn /home/http /home/http/cgi

$ sudo chgrp users /home/cvs /home/svn /home/http /home/http/cgi


SECURE SSH ACCESS TO THE SERVER

The default SSH configuration is quite safe to be used in a private environment. But, for a server which is exposed to the outside world, a few changes to the settings might be useful. Here are the changes I made:



CVS SERVER

Installing the CVS server is the easiest of the lot. The following command should do it:



SVN SERVER

This section describes how to setup the SVN server. It allows access in one of two ways -- over SSH or using Apache.



HTTP SERVER

I used apache2 as the HTTP server. Here are the steps I followed:



HTTPS SERVER

Enable SSL request handling for the server.



ACCESSING THE SVN SERVER THROUGH APACHE WEBDAV

Using SSH to access your SVN server requires all SVN users to have login accounts on your home machine. You might or might not want this. Further, maintaining SSH keys for everyone can be a big headache. Luckily, SVN also provides an alternative approach for accessing it, using Apache2 Webdav. The advantage of this method is that you don't necessarily have to give all users who want to use the SVN an account on your machine. Apache maintains a separate user account system, that you can use.



SVN PASSWORD CHANGING CAPABILITY FOR INDIVIDUAL USERS

Typically SVN account passwords have to managed by the system administrator. This is inconvenient and not safe in general. Since SVN does not provide direct capability to allow users to modify their own passwords, here is a simple hack to do this. We first enable execution of CGI scripts for Apache. This can be a security risk, so we try to keep the permissions as restricted as possible.



FEEDBACK

You are all set. Have fun! Please do let me know your experiences, comments and suggestions. Especially, if I missed any setting or if there is a better way of doing the same, please let me know.


Pavan Balaji
Last modified: Mon Jun 4 00:04:02 CDT 2007