<?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>Bennyland &#187; trac</title>
	<atom:link href="http://blog.bennyland.com/tag/trac/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.bennyland.com</link>
	<description>this server is running in my bedroom - benny’s learning how to run a linux server</description>
	<lastBuildDate>Thu, 06 Jan 2011 16:41:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Installing Trac and Subversion on CentOS5</title>
		<link>http://blog.bennyland.com/2010/01/18/installing-trac-and-subversion-on-centos5/</link>
		<comments>http://blog.bennyland.com/2010/01/18/installing-trac-and-subversion-on-centos5/#comments</comments>
		<pubDate>Tue, 19 Jan 2010 01:30:31 +0000</pubDate>
		<dc:creator>benny</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[guide]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[trac]]></category>

		<guid isPermaLink="false">http://blog.bennyland.com/?p=19</guid>
		<description><![CDATA[Installing Trac and Subversion on CentOS is pretty simple. First, you need to install subversion - it was automatically installed for me already when I installed the OS, however I wanted to update it and found out that I couldn't do so until I deleted the i386 version. Don't do this step if you're on [...]]]></description>
			<content:encoded><![CDATA[<p>Installing Trac and Subversion on CentOS is pretty simple.</p>
<p>First, you need to install subversion - it was automatically installed for me already when I installed the OS, however I wanted to update it and found out that I couldn't do so until I deleted the i386 version.<span id="more-19"></span></p>
<p>Don't do this step if you're on a 32-bit system!</p>
<pre class="brush: bash; title: ;">
yum erase subversion.i386
</pre>
<p>Next, you can install or upgrade subversion and add mod_dav_svn</p>
<pre class="brush: bash; title: ;">
yum install subversion mod_dav_svn
</pre>
<p>And Trac...</p>
<pre class="brush: bash; title: ;">
yum install python
cd /tmp
wget http://peak.telecommunity.com/dist/ez_setup.py
python ez_setup.py
yum install mod_python
</pre>
<p>MySQL-python is needed for python to interact with mysql.  Download the latest MySQL-python from http://sourceforge.net/projects/mysql-python, then:</p>
<pre class="brush: bash; title: ;">
tar -zxvf mysql-python-tarball.tar.gz
cd mysql-python-source-directory
python setup.py build &amp;&amp; python.setup.py install
</pre>
<p>Some developer packages will also be needed:</p>
<pre class="brush: bash; title: ;">
yum install neon neon-devel python-devel swig
</pre>
<p>Next, install clearsilver.  You should look for the version that works for your OS. For CentOS 5, it's the latest el5.rf, and either i386 or x86 depending on your setup.  You can find the list of packages here: <a href="http://dag.wieers.com/rpm/packages/clearsilver/">http://dag.wieers.com/rpm/packages/clearsilver/</a>. Make sure that you get the same version number of clearsilver and python-clearsilver.</p>
<pre class="brush: bash; title: ;">
wget http://dag.wieers.com/rpm/packages/clearsilver/clearsilver-VERSION.el5.rf.ENVIRONMENT.rpm
rpm -i clearsilver-VERSION.el5.rf.ENVIRONMENT.rpm
wget http://dag.wieers.com/rpm/packages/clearsilver/python-clearsilver-VERSION.el5.rf.ENVIRONMENT.rpm
rpm -i python-clearsilver-VERSION.el5.rf.ENVIRONMENT.rpm
</pre>
<p>Now that you have all of these, you can install Trac.  Download the latest tar from <a href="http://trac.edgewall.org/wiki/TracDownload">http://trac.edgewall.org/wiki/TracDownload</a></p>
<pre class="brush: bash; title: ;">
cd /tmp
wget http://path.to/TracDownloadTarball.tar.gz
tar -zxvf TracDownloadTarball.tar.gz
cd TracDownloadTarball
python ./setup.py install
</pre>
<p>You're done. <img src='http://blog.bennyland.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Create SVN Repositories and link new Trac projects to them.  You'll first make directories to place your svn and trac projects (i'm using /var/www/svn|trac)</p>
<pre class="brush: bash; title: ;">
mkdir /var/www/svn/svn-repository-name
mkdir /var/www/trac/svn-repository-name
svnadmin create --fs-type fsfs /var/www/svn/svn-repository-name
trac-admin /var/www/trac/
initenv
chown -R apache.apache /var/www/svn/svn-repository-name
chown -R apache.apache /var/www/trac/svn-repository-name
</pre>
<p>Now you'll need to make a subversion.conf file for apache to load up. One might already exist (it did in my case), but even if it doesn't, that's ok.</p>
<pre class="brush: bash; title: ;">vim /etc/httpd/conf.d/subversion.conf</pre>
<pre class="brush: xml; title: ;">
LoadModule dav_svn_module     modules/mod_dav_svn.so
LoadModule authz_svn_module   modules/mod_authz_svn.so
&lt;VirtualHost *:80&gt;
	ServerName svn.astrosmurf.com
	DocumentRoot /path/to/existing/empty/directory
	&lt;Location /&gt;
		DAV svn
		SVNParentPath /path/to/svn/root
		SVNListParentPath on
		Order allow,deny
		Allow from all
	&lt;/Location&gt;
	&lt;LocationMatch /.+&gt;
		# access differences per repository in here:
		AuthzSVNAccessFile /path/to/svn/root/svn-acl-conf

		# means to authenticate the user
		AuthType Basic
		AuthName &quot;Astrosmurf Subversion&quot;
		AuthUserFile /path/to/svn/root/svn.htpasswd

		# only authenticated users may access the repository
		Require valid-user
	&lt;/LocationMatch&gt;
	ErrorLog /var/www/logs/error.svn.log
	CustomLog /var/www/logs/access.svn.log combined
&lt;/VirtualHost&gt;
</pre>
<p>You'll also want to do the same for Trac</p>
<pre class="brush: bash; title: ;">vim /etc/httpd/conf.d/trac.conf</pre>
<p>and the contents should look similar to this (of course, modify both of these to suit your needs):</p>
<pre class="brush: xml; title: ;">
&lt;IfModule mod_python.c&gt;
	&lt;VirtualHost *:80&gt;
		ServerName trac.yourserver.com
		DocumentRoot /path/to/existing/empty/directory
		&lt;Location /&gt;
			SetHandler mod_python
			PythonInterpreter main_interpreter
			PythonHandler trac.web.modpython_frontend
			PythonOption TracEnvParentDir /path/to/trac/root
			PythonOption TracUriRoot /
			PythonOption PYTHON_EGG_CACHE /usr/lib/trac/plugins-cache
			Order allow,deny
			Allow from all
		&lt;/Location&gt;
		&lt;LocationMatch /[^/P]+/.*&gt;
			# means to authenticate the user
			AuthType Basic
			AuthName &quot;Subversion&quot;
			AuthUserFile /path/to/svn/root/svn.htpasswd
			AuthGroupFile /path/to/svn/root/svn-authgroup-conf
			# only authenticated users may access the repository
			Require group staff
		&lt;/LocationMatch&gt;
		&lt;LocationMatch /Pub[^/]+/.*&gt;
			# means to authenticate the user
			AuthType Basic
			AuthName &quot;Subversion&quot;
			AuthUserFile /path/to/svn/root/svn.htpasswd
			# only authenticated users may access the repository
			Require valid-user
		&lt;/LocationMatch&gt;

		ErrorLog /var/www/logs/error.trac.log
		CustomLog /var/www/logs/access.trac.log combined
	&lt;/VirtualHost&gt;
&lt;/IfModule&gt;
</pre>
<p>Now, make the different auth files. This file contains users and groups... in fact I don't remember why i have both the acl and the authgroup file, but whatever...</p>
<pre class="brush: bash; title: ;">vim /var/www/svn/svn-acl-conf</pre>
<pre class="brush: plain; title: ;">
[groups]
staff = user1, user2, user3
rb = reviewboard

[/]
@rb = rw

[name_of_staff_repo:/]
@staff = rw

[name_of_user1_repo:/]
user1 = rw

[Public:/]
@staff = rw
public = r
</pre>
<p>and set up authgroup. This file contains group names and who belongs to them</p>
<pre class="brush: bash; title: ;">vim /var/www/svn/svn-authgroup-conf</pre>
<pre class="brush: plain; title: ;">
staff: user1 user2 user3
</pre>
<p>And the passwords file</p>
<pre class="brush: bash; title: ;">
touch /var/www/svn/svn.htpasswd
htpasswd -m /var/www/svn/svn.htpasswd user1
htpasswd -m /var/www/svn/svn.htpasswd user2
htpasswd -m /var/www/svn/svn.htpasswd user3
</pre>
<p>You can also create a public user and somehow let the public know that they can enter your repository with username <em>public</em> and password <em>public</em>.</p>
<pre class="brush: bash; title: ;">htpasswd -m /var/www/svn/svn.htpasswd public</pre>
<p>Restart httpd and you should should now be able to go to http://svn.yourhost.com/ and http://trac.yourhost.com/</p>
<pre class="brush: bash; title: ;">service httpd restart</pre>
<p>A lot of this info came from several different sources, some from googling and others form these places:</p>
<ul>
<li><a href="http://biotext.org.uk/updating-subversion-on-64-bit-linux-centos-5/">http://biotext.org.uk/updating-subversion-on-64-bit-linux-centos-5/</a></li>
<li><a href="http://www.daniel-skinner.co.uk/setup-subversion-and-trac-on-centos-5/06/01/2008">http://www.daniel-skinner.co.uk/setup-subversion-and-trac-on-centos-5/06/01/2008</a></li>
<li><a href="http://www.techyouruniverse.com/software/installing-trac-with-subversion-on-cent-os-5-with-neon-and-quicksilver">http://www.techyouruniverse.com/software/installing-trac-with-subversion-on-cent-os-5-with-neon-and-quicksilver</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.bennyland.com/2010/01/18/installing-trac-and-subversion-on-centos5/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

