How to install Subversion version control server (with Apache support)
- Install Subversion and Apache 2 Module
sudo apt-get install subversion apache2 libapache2-svn
- Enable Subversion/DAV Apache 2 Module
sudo a2enmod dav_svn
sudo nano /etc/apache2/mods-enabled/dav_svn.conf
Edit the file to look something like this:
<strong><Location /svn></strong>
<strong><span> </span>DAV svn</strong>
<strong><span> </span>SVNPath /home/svn</strong>
<strong> </strong>
<strong><span> </span>AuthType Basic</strong>
<strong><span> </span>AuthName "Subversion Repository"</strong>
<strong><span> </span>AuthUserFile /etc/apache2/dav_svn.passwd<span style="color: red">-------we have to create</span> </strong>
<strong><span> </span>Require valid-user</strong>
<strong></Location></strong>
- Create Subversion Repository
sudo mkdir /home/svn
sudo svnadmin create /home/svn
- Give Apache 2 Permissions to Repository
sudo chown -R www-data /home/svn
Replace 'username' with your username
sudo htpasswd -cm /etc/apache2/dav_svn.passwd username
Enter password when prompted.
sudo /etc/init.d/apache2 restart
- Working with the new repository
Open a terminal window and paste:
svn checkout <a href="http://username@localhost/svn" title="http://username@localhost/svn">http://username@localhost/svn</a> lucky
You
will be prompted to enter the password. Now you have a working copy in
the directory 'lucky'. Now lets create a file and commit it.
cd lucky
mousepad Hello.txt
Enter anything you like in the file and click save, Exit.
svn add Hello.txt
Now
you added the file but it won't appear in the repository yet, you have
to commit it. To commit, its as easy as doing the following:
svn commit
Now check your repository using the web browser at
http://localhost/svn/.