<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>www.unnionline.com &#187; Installation</title>
	<atom:link href="http://www.unnionline.com/blog/category/subversion/installation/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.unnionline.com/blog</link>
	<description></description>
	<lastBuildDate>Wed, 30 Nov 2011 11:49:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.1</generator>
		<item>
		<title>Installing Subversion With Apache and DAV In Ubuntu 8.10</title>
		<link>http://www.unnionline.com/blog/2009/05/installing-subversion-with-apache-and-dav-in-ubuntu-810/</link>
		<comments>http://www.unnionline.com/blog/2009/05/installing-subversion-with-apache-and-dav-in-ubuntu-810/#comments</comments>
		<pubDate>Tue, 05 May 2009 09:04:06 +0000</pubDate>
		<dc:creator>cbaunni</dc:creator>
				<category><![CDATA[Installation]]></category>
		<category><![CDATA[Subversion]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[CVS]]></category>
		<category><![CDATA[DAV]]></category>
		<category><![CDATA[Project]]></category>
		<category><![CDATA[Repositories]]></category>
		<category><![CDATA[SVN]]></category>
		<category><![CDATA[SVN Server]]></category>
		<category><![CDATA[Ubuntu 8.10]]></category>
		<category><![CDATA[WebDAV]]></category>

		<guid isPermaLink="false">http://www.unnionline.com/blog/?p=69</guid>
		<description><![CDATA[Installing and configuring subversion (SVN) and WebDAV on ubuntu 8.10 server]]></description>
			<content:encoded><![CDATA[<p>Subversion (SVN) is a version control system initiated in 2000 by CollabNet Inc. It is used to maintain current and historical versions of files such as source code, web pages, and documentation. Its goal is to be a mostly-compatible successor to the widely used Concurrent Versions System (CVS) [<a href="http://en.wikipedia.org/wiki/Subversion_(software)">Wikipedia</a>]</p>
<p>I have adopted subversion to manage my PhD thesis and other research related tasks. Here is how I setup SVN server on my Ubuntu 8.10 server.</p>
<p><strong>Installing subversion</strong></p>
<p>First of all, we need to install the necessary packages to put SVN on to the server</p>
<p><code>sudo apt-get install subversion libapache2-svn</code></p>
<p>Now that SVN in on the server, the next step is to create a user who has rights to manage SVN repositories.</p>
<p><strong>SVN users and groups</strong></p>
<p>There are severel ways to set permissions on the repository. As I already have a username, say &#8216;mark&#8217;, on my server, the best thing to do would be to create a group called &#8216;subversion&#8217; and add myself to it. I am also planning to access my repositories via http, so it is necessary to add the user &#8216;www-data&#8217; to the &#8216;subversion&#8217; group. All this can be done by following the commands below.</p>
<p><code>sudo addgroup subversion<br />
sudo adduser mark subversion<br />
sudo adduser www-data subversion<br />
</code></p>
<p>Logout and login again before continuing further.</p>
<p><strong>Creating a SVN repository</strong></p>
<p>The next thing to do is to chose a location for creating SVN repositories. I like to create my repositories at <code>/home/svn</code>. Follow the commands below to create a SVN repository.</p>
<p><code>sudo mkdir /home/svn<br />
sudo mkdir /home/svn/research<br />
sudo svnadmin create /home/svn/research<br />
</code></p>
<p>This will create the repository &#8216;research&#8217; under /home/svn. Note that this repository will/should have the root:root user and group permissions.</p>
<p><strong>Configuring SVN access via WebDAV protocol (http://)</strong></p>
<p>To access the SVN repository via WebDAV protocol, configure the Apache2 web server. To do this edit the <code>/etc/apache2/mods-available/dav_svn.conf</code> file to look like:</p>
<p><code>DAV svn<br />
SVNPath /home/svn/research<br />
AuthType Basic<br />
AuthName "Subversion Repository"<br />
AuthUserFile /etc/svn/htaccess</code></p>
<p>Require valid-user<br />
Now WebDAV has to be provided with the user access details as it is going to control the reading and writing to the repository:</p>
<p><code>cd /etc/svn<br />
sudo htpasswd -c -m htpasswd mark<br />
</code></p>
<p>Any additional users has to be added without the &#8216;-c&#8217; switch so as to avoid overwriting the &#8216;htaccess&#8217; file. Afterword restart apache by issuing:</p>
<p><code>sudo /etc/init.d/apache2 restart<br />
</code></p>
<p>Test the configuration by typing <code>http://localhost/svn</code> in a browser. Enter the username and password and now the repository can be seen.</p>
<p><strong>Creating further repositories and projects </strong></p>
<p>Further repositories may be constructed inside the research repository, provided users of the &#8216;subversion&#8217; group should have their ownership. The following commands can achieve the same.</p>
<p><code>sudo mkdir /home/svn/research/thesis<br />
sudo chown -R mark:subversion /home/svn/research/thesis<br />
sudo chmod -R 777 /home/svn/research/thesis<br />
svnadmin create /home/svn/research/thesis<br />
</code></p>
<div id="attachment_73" class="wp-caption alignleft" style="width: 191px"><a href="http://www.unnionline.com/blog/wp-content/uploads/2009/05/svn_repository.jpg"><img class="size-medium wp-image-73" title="SVN repository structure" src="http://www.unnionline.com/blog/wp-content/uploads/2009/05/svn_repository-181x300.jpg" alt="A sample SVN repository structure" width="181" height="300" /></a><p class="wp-caption-text">A sample SVN repository structure</p></div>
<p>Once that is done, its  time create a project and add it to the repository so that SVN can manage it. Before that, its better to have a look at the &#8216;usual&#8217; subversion project directory structure [Refer figure]. In SVN, a project directory usually has 3 subdirectories; trunk, tags and branches. Trunk contain the most recent working copy of the project, tags contain copies of the working directory of some importance (such as the copy of the thesis version that was submitted to your supervisor to have a look at) and branches contain snapshots of the working copy from which you decided to follow a different route.</p>
<p>All said, the final decision about the directory structure rests upon the user. Now the idea is to create a skeletal directory structure somewhere in your home directory and import it to the thesis repository. Follow the commands below to establish this.</p>
<p><code>cd ~<br />
mkdir thesis<br />
mkdir thesis/trunk<br />
mkdir thesis/tag<br />
mkdir thesis/branches<br />
svn import thesis/ http://localhost/svn/research/thesis/<br />
</code></p>
<p>Now check repository again via the browser and project can be seen added inside. The skeletal directories can be deleted now. A working copy of the project can be created by issuing the commands:</p>
<p><code>cd ~<br />
svn checkout http://localhost/svn/research/thesis<br />
</code></p>
<p>Files can be added to the repository by:</p>
<p><code>cd ~</code><code> cd thesis/trunk/</code></p>
<p><code>touch File_A.py<br />
svn add File_A.py<br />
svn commit -m "Initial import of the File_A.py file for versioning"<br />
</code></p>
<p>Check again via the browser to see the file.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.unnionline.com/blog/2009/05/installing-subversion-with-apache-and-dav-in-ubuntu-810/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

