Install Apache/Subversion on Debian Lenny and Migrate the Repositories
Install Subversion/Apache
Subversion Configuration
Create subversion repositories:
sudo chown -R www-data:www-data /var/svn
All our subversion repositories should be located in /var/svn in order to be visible to Apache (you can change /var/svn to something else).
SSL (Secure Sockets Layer)
The following steps are required if you need SSL, otherwise skip this chapter.
a2enmod ssl
"Listen 443" should already exist in /etc/apache2/ports.conf, otherwise add it manually:
Create a new SSL config file (replace ssl.new.site with your preferred name):
Edit the file:
Replace:
with
Before </VirtualHost>, add:
SSLCertificateFile /etc/apache2/ssl/ssl.new.site.pem
You can try using the template from "default-ssl" instead of "default", which is easier and more reliable since many SSL-related configurations are already handled. However, I haven't tried this method and I'm not sure if it works without modifications.
Create SSL certificate file:
sudo make-ssl-cert /usr/share/ssl-cert/ssleay.cnf /etc/apache2/ssl/ssl.new.site.pem
Enable the new site:
sudo /etc/init.d/apache2 reload
To see if the setup works, use your web browser to visit:
Replace server.ip with the ip of your server. There should be a pop-up or an alert about the new certificate.
DAV_SVN Configuration
Edit /etc/apache2/mods-available/dav_svn.conf and follow the guidline:
Normally it looks like this:
DAV svn
SVNParentPath /var/svn
AuthType Basic
AuthName "Subversion Repository"
AuthUserFile /etc/apache2/dav_svn.passwd
Require valid-user
SSLRequireSSL # this line must be added if you want SSL enabled
</Location>
Enable the mod and restart:
sudo /etc/init.d/apache2 restart
Create a user account for dav_svn:
To add more users, use:
Subversion Testing
sudo chown -R www-data:www-data /var/svn/test
svn co https://new.site/svn/test
It should says "Checked out revision 0.", otherwise try looking for the errors on the Internet. You probably forgot some steps or I forgot to mention some details.
Migration
Skip this chapter if you don't need to migrate you data from your old server.
On the old server, we need to dump all updates into a single file. Each repository must be done separately.
cd svndump
sudo svnadmin dump /var/svn/repository > ./repository.dump
cd ..
tar zcvf svndump.tgz svndump
scp svndump.tgz username@new.server.ip:./
Those dump files must be applied on the new system's repositories.
cd /var/svn/repository
sudo svnadmin create repository-name
sudo svnadmin load repository-name < ~/svndump/repository.dump
sudo chown -R www-data:www-data /var/svn/*
Congratulations, all your source code has been migrated!
September 2nd, 2009 - 04:24
Like this theme, nice one.
November 6th, 2009 - 01:11
Yes! Thank U so much. Super Tutorial. Works fine for me.
November 13th, 2009 - 15:19
You’re welcome. I’m glad that you like it
December 21st, 2009 - 15:18
Really usefull.
Thank you.