<?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>Daniel Skinner: News and Articles on Web Development &#187; trac</title>
	<atom:link href="http://www.daniel-skinner.co.uk/tag/trac/feed" rel="self" type="application/rss+xml" />
	<link>http://www.daniel-skinner.co.uk</link>
	<description>Daniel Skinner&#039;s Blog: Web Development news and articles</description>
	<lastBuildDate>Wed, 18 Mar 2009 15:11:23 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Setup Subversion and Trac on CentOS 5</title>
		<link>http://www.daniel-skinner.co.uk/setup-subversion-and-trac-on-centos-5/06/01/2008</link>
		<comments>http://www.daniel-skinner.co.uk/setup-subversion-and-trac-on-centos-5/06/01/2008#comments</comments>
		<pubDate>Sun, 06 Jan 2008 17:19:17 +0000</pubDate>
		<dc:creator>Daniel Skinner</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Guides]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[trac]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[version control]]></category>

		<guid isPermaLink="false">http://www.daniel-skinner.co.uk/setup-subversion-and-trac-on-centos-5/06/01/2008</guid>
		<description><![CDATA[Recently I set up a virtual server to use as a development machine. It runs on CentOS 5 and hosts several Subversion repositories with associated Trac projects.
There are many guides and plenty of help on the net to help you setup such a system. However, when I tried to do it I came across a [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I set up a virtual server to use as a development machine. It runs on CentOS 5 and hosts several <a href="http://subversion.tigris.org/" title="Subversion" rel="external">Subversion</a> repositories with associated <a href="http://trac.edgewall.org/" title="Trac" rel="external">Trac</a> projects.</p>
<p>There are many guides and plenty of help on the net to help you setup such a system. However, when I tried to do it I came across a few problems and I hope this post may help at least a few people trying to do the same as me. I am not going to rewrite the great tutorials out there, I will just point you to them and note what things I did differently.</p>
<p>This &#8216;guide&#8217; should get you from a fresh install of CentOS 5 linux to one or more working Subversion (<abbr title="Subversion">SVN</abbr>) repositories and associated Trac wiki&#8217;s. Apache/WebDAV is used as the network layer. I have only tested this on a fresh install of CentOS 5.</p>
<p><span id="more-18"></span></p>
<h2>The Environment</h2>
<p>I am aiming for the following:</p>
<ul>
<li>CentOS 5, <abbr title="Subversion">SVN</abbr> installed. Apache2 as the network layer using mod_dav_svn.</li>
<li>Trac running on Apache with mod_python</li>
<li><abbr title="Subversion">SVN</abbr> repositories located at: /srv/svn (e.g. /srv/svn/my-project), accessible via http://server/svn/my-project</li>
<li>Trac projects located at: /srv/trac (e.g /srv/trac/my-project) accessible via http://server/trac/my-project</li>
</ul>
<h2>How I did it</h2>
<p>Not all the steps are vital (probably) but this is how I got it working. Feel free to skip any non-relevant steps (i.e. there is probably no need for a fresh install). Replace any occurence of <span class="inline-code">&lt;project&gt;</span> with the name of your first project.</p>
<p><strong>1.</strong> Fresh install of CentOS. I followed most of the <a href="http://www.howtoforge.com/perfect_setup_centos5.0" title="The Perfect Setup: CentOS 5.0" rel="external">Perfect Setup Guide</a>, except the mail and ISPConfig stuff. The important part is setting up the Apache2 web server.</p>
<p><strong>2.</strong> Make sure <abbr title="Subversion">SVN</abbr> and mod_dav_svn are installed. As root:</p>
<pre>yum install subversion mod_dav_svn</pre>
<pre>vim /etc/httpd/conf/httpd.conf</pre>
<p>If the following two lines are not present, add them:</p>
<pre>LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so</pre>
<p><strong>3.</strong> Install Trac: Follow <a href="http://www.techyouruniverse.com/software/installing-trac-with-subversion-on-cent-os-5-with-neon-and-quicksilver" title="Installing Trac with SubVersion on CentOS 5" rel="external">Nick&#8217;s guide</a> with the alternative Clearsilver installation below. Skip the Apache Configuration part.</p>
<p>Follow all of parts 1 and 2. Instead of part 3 do:</p>
<pre>wget http://dag.wieers.com/rpm/packages/clearsilver/clearsilver-0.10.4-1.el5.rf.i386.rpm
rpm -i clearsilver-0.10.4-1.el5.rf.i386.rpm
wget http://dag.wieers.com/rpm/packages/clearsilver/python-clearsilver-0.10.4-1.el5.rf.i386.rpm
rpm -i python-clearsilver-0.10.4-1.el5.rf.i386.rpm</pre>
<p>Continue with parts 4.1 and 4.2 of Nick&#8217;s guide. Remember, leave out Apache configuration section.</p>
<p><strong>4. </strong>Create your first <abbr title="Subversion">SVN</abbr> Repository:</p>
<pre>svnadmin create --fs-type fsfs /srv/svn/&lt;project&gt;</pre>
<p><strong>5.</strong> Initialise a Trac project for your new repository:</p>
<pre>trac-admin /srv/trac/&lt;project&gt; initenv</pre>
<p>For the trac-admin command use the defaults if not sure, giving a descriptive name for the project. The `Path to repository` is: <span class="inline-code">/srv/svn/&lt;project&gt;</span>.</p>
<p><strong>6.</strong> Set the correct file permissions for apache</p>
<pre>chown -R apache.apache /srv/svn/&lt;project&gt;
chown -R apache.apache /srv/trac/&lt;project&gt;</pre>
<p><strong>7.</strong> Tell apache where to find the new repository. Here we create an additional Apache configuration file specifically for the <abbr title="Subversion">SVN</abbr> repositories.</p>
<pre>vim /etc/httpd/conf.d/subversion.conf</pre>
<p>Add the following directive:</p>
<pre>&lt;Location /svn/&lt;project&gt;&gt;
	DAV svn
	SVNPath /srv/svn/&lt;project&gt;
	AuthType Basic
	AuthName "&lt;project&gt; Repository"
	AuthzSVNAccessFile /srv/svn/svn-acl-conf
	AuthUserFile /srv/svn/&lt;project&gt;.htpasswd
	Require valid-user
&lt;/Location&gt;</pre>
<p><strong>8.</strong> Add a repository user:</p>
<pre>touch /srv/svn/&lt;project&gt;.htpasswd
htpasswd -m /srv/svn/&lt;project&gt;.htpasswd &lt;username&gt;</pre>
<p><strong>9. </strong>Create the Access Control List for the SVN Repository</p>
<pre>vim /srv/svn/svn-acl-conf</pre>
<p>Add the following directives:</p>
<pre>[&lt;project&gt;:/]
&lt;username&gt; =  rw</pre>
<p>Where <span class="inline-code">&lt;username&gt;</span> represents the username of the repository user you created earlier.</p>
<p><strong>10.</strong> Tell apache where to find the new Trac project. Here we create an additional Apache configuration file specifically for the Trac projects.</p>
<pre>vim /etc/httpd/conf.d/trac.conf</pre>
<p>Add the following directives:</p>
<pre>&lt;Location /trac/&lt;project&gt;&gt;
	SetHandler mod_python
	PythonHandler trac.web.modpython_frontend
	PythonOption TracEnv /srv/trac/&lt;project&gt;
	PythonOption TracUriRoot /trac/&lt;project&gt;
&lt;/Location&gt;

&lt;Location "/trac/&lt;project&gt;/login"&gt;
	AuthType Basic
	AuthName "trac"
	AuthUserFile /srv/trac/&lt;project&gt;.htpasswd
	Require valid-user
&lt;/Location&gt;</pre>
<p><strong>11.</strong> Add a Trac user:</p>
<pre>touch /srv/trac/&lt;project&gt;.htpasswd
htpasswd -m /srv/trac/&lt;project&gt;.htpasswd &lt;username&gt;</pre>
<p><strong>12.</strong> Give admin permissions to the Trac user you just created:</p>
<pre>trac-admin /srv/trac/&lt;project&gt; permission add &lt;username&gt; TRAC_ADMIN</pre>
<p>Where <span class="inline-code">&lt;username&gt;</span> represents the username of the Trac user you just created.</p>
<p><strong>13.</strong> Restart Apache:</p>
<pre>service httpd restart</pre>
<p>You should now have <abbr title="Subversion">SVN</abbr> and Trac installed. You will have an <abbr title="Subversion">SVN</abbr> repository setup (http://server/svn/&lt;project&gt;) and the Trac wiki (http://server/trac/&lt;project&gt;) associated with the repository.</p>
<p>Please let me know if this helped you. If you come across any problems I will be happy to try and help.</p>
<h2>Resources</h2>
<p>The last part of <a href="http://" title="CentOS HowTos: Subversion">CentOS HowTos: Subversion</a> will give you a quick introduction on how to use <abbr title="Subversion">SVN</abbr>.</p>
<p>Subversion setup guides: <a href="http://www.jimohalloran.com/2006/01/15/subversion-server-on-centos-42/" title="Subversion setup guide" rel="external">here</a> and <a href="http://www.techyouruniverse.com/software/installing-trac-with-subversion-on-cent-os-5-with-neon-and-quicksilver" title="Subversion setup guide" rel="external">here</a></p>
<p>Trac setup guides: <a href="http://trac.edgewall.org/wiki/TracOnRhel4" title="Trac setup guide" rel="external">here</a> and <a href="http://trac.edgewall.org/wiki/TracOnFedoraCore" title="Trac setup guide" rel="external">here</a>.</p>
<p><a href="http://www.clearsilver.net/" title="ClearSilver" rel="external">ClearSilver template system</a> (used by Trac).</p>
<p><a href="http://www.howtoforge.com/perfect_setup_centos5.0_p7" title="The Perfect Setup: CentOS 5.0" rel="external">Setting up CentOS 5.0</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.daniel-skinner.co.uk/setup-subversion-and-trac-on-centos-5/06/01/2008/feed</wfw:commentRss>
		<slash:comments>63</slash:comments>
		</item>
	</channel>
</rss>
