<?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; subversion</title>
	<atom:link href="http://www.daniel-skinner.co.uk/tag/subversion/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>Install phpUnderControl on CentOS 5</title>
		<link>http://www.daniel-skinner.co.uk/php-under-control-svn-centos-5/12/06/2008</link>
		<comments>http://www.daniel-skinner.co.uk/php-under-control-svn-centos-5/12/06/2008#comments</comments>
		<pubDate>Thu, 12 Jun 2008 15:19:56 +0000</pubDate>
		<dc:creator>Daniel Skinner</dc:creator>
				<category><![CDATA[Guides]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[phpundercontrol]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://www.daniel-skinner.co.uk/?p=26</guid>
		<description><![CDATA[If you follow this guide you should start with a basic CentOS 5 installation with Subversion setup correctly and end up with a working installation of phpUnderControl.]]></description>
			<content:encoded><![CDATA[<p>A while back now I started setting up a server to use as a development machine. From a standard CentOS 5 installation I have installed <a title="CentOS SVN" href="http://www.daniel-skinner.co.uk/setup-subversion-and-trac-on-centos-5/06/01/2008">SubVersion and Trac</a>. Now I have finally got round to installing <a title="phpUnderControl" href="http://www.phpundercontrol.org/">phpUnderControl</a> for continuous integration and build management.</p>
<p>As usual, there are many great guides already on the net but getting everything to work usually requires a few of these references and a few additional changes. I will point out where I got the information from where applicable but the aim of this guide is to be complete and comprehensive.</p>
<p>If you follow this guide you should start with a basic <a title="CentOS 5 SVN and Trac" href="http://www.daniel-skinner.co.uk/setup-subversion-and-trac-on-centos-5/06/01/2008">CentOS 5 installation with Subversion</a> setup correctly and end up with a working installation of phpUnderControl.</p>
<p><span id="more-26"></span></p>
<h2>The Environment</h2>
<p>I am aiming for the following:</p>
<ul>
<li>CentOS 5 with SubVersion installed</li>
<li>PHP 5.2.X installed</li>
<li>CruiseControl binary installed, running on Sun JDK 6</li>
<li>phpUnderControl installed</li>
<li>A working build process for the example project</li>
</ul>
<h2>Here it is&#8230;</h2>
<h3>Upgrade CentOS 5 with PHP5.2</h3>
<p>To get PHP5.2 installed on CentOS 5 (required for phpUC) we need to add an additional repository that has it. I am going to use the <a href="http://www.jasonlitka.com/yum-repository/">Yum Repository</a> provided by <a href="http://www.jasonlitka.com/">Jason Litka</a>. Detailed instructions can be found at his site. In summary, for CentOS 5 this consists of:</p>
<pre>rpm --import http://www.jasonlitka.com/media/RPM-GPG-KEY-jlitka
vi /etc/yum.repos.d/utterramblings.repo</pre>
<p>Add the following lines:</p>
<pre>[utterramblings]
name=Jason's Utter Ramblings Repo
baseurl=http://www.jasonlitka.com/media/EL$releasever/$basearch/
enabled=1
gpgcheck=1
gpgkey=http://www.jasonlitka.com/media/RPM-GPG-KEY-jlitka</pre>
<p>Now Yum can update PHP to 5.2. We also need a few other dependencies for phpUC:</p>
<pre>yum install -y php php-pear php-xml</pre>
<p>And the latest version of pear:</p>
<pre>pear channel-update pear.php.net
pear upgrade pear</pre>
<h3>Get phpUnderControl</h3>
<p>Using pear to install phpUC:</p>
<pre>pear config-set preferred_state beta
pear channel-discover components.ez.no
pear channel-discover pear.phpunit.de
pear install --alldeps phpunit/phpUnderControl</pre>
<p>This will install phpUC and all required dependencies. It&#8217;s a good idea to set pear back to only installing stable (i.e. non beta) packages:</p>
<pre>pear config-set preferred_state stable</pre>
<h3>Sun Java JDK 6</h3>
<p>phpUC needs CruiseControl and CruiseControl needs Sun JDK. Again, a full guide for getting this done can be found on the <a title="Java on CentOS" href="http://www.jasonlitka.com/">CentOS wiki</a>. The steps I took are:</p>
<p>Set up rpmbuild:</p>
<pre>vi ~/.rpmmacros</pre>
<p>Make sure the file contents is:</p>
<pre>%_topdir /home/&lt;username&gt;/rpmbuild
%_tmppath %{_topdir}/tmp</pre>
<p>with &lt;username&gt; replaced with your logon name (if you are using root the path would be /root/rpmbuild).</p>
<pre>mkdir -p ~/rpmbuild/{SOURCES,SRPMS,SPECS,RPMS,tmp,BUILD}
yum install -y rpm-build gcc gcc-c++ redhat-rpm-config jpackage-utils</pre>
<p>Download JDK6 Update 6 (or the latest version) from <a href="http://java.sun.com">java.sun.com</a>. Get the .rpm.bin version. The file I got was called jdk-6u6-linux-i586-rpm.bin.</p>
<pre>chmod +x jdk-6u6-linux-i586-rpm.bin
./jdk-6u6-linux-i586-rpm.bin
wget http://mirrors.dotsrc.org/jpackage/1.7/generic/non-free/RPMS/java-1.6.0-sun-compat-1.6.0.06-1jpp.i586.rpm
rpm -Uvh jdk-6u1-linux-i586.rpm java-1.6.0-sun-compat-1.6.0.01-1jpp.i586.rpm</pre>
<p>With the JDK successfully installed (hopefully) we use Alternatives to select the Sun JDK:</p>
<p>/usr/sbin/alternatives &#8211;config java</p>
<p>Make sure the selected version is along the lines of /usr/lib/jvm/jre-1.6.0-sun/bin/java.</p>
<p>At this point java -version should give something like:</p>
<pre>java version "1.6.0_06"
Java(TM) SE Runtime Environment (build 1.6.0_06-b02)
Java HotSpot(TM) Client VM (build 10.0-b22, mixed mode, sharing)</pre>
<p>Now to add some environment variables:</p>
<pre>vi /etc/profile.d/java.sh</pre>
<p>Add the following:</p>
<pre>export JAVA_HOME="/usr/java/jdk1.6.0_06"
export JAVA_PATH="$JAVA_HOME"
export PATH="$PATH:$JAVA_HOME"</pre>
<p>Note that JAVA_HOME is not set to &#8220;/usr/java/jdk1.6.0_06/bin&#8221;. I don&#8217;t think this is the standard but it&#8217;s an easy way to get CruiseControl to work (<a href="http://www.centos.org/modules/newbb/viewtopic.php?viewmode=flat&amp;topic_id=5717&amp;forum=28">see here</a>).</p>
<p>You will also need to restart your session for these changes to take effect or just export the variables directly to the prompt.</p>
<h3>Get CruiseControl</h3>
<p>Download the latest <a title="CruiseControl" href="http://sourceforge.net/project/showfiles.php?group_id=23523&amp;package_id=16338">2.7.X CruiseControl binary</a>. My version is cruisecontrol-bin-2.7.2.zip.</p>
<pre>unzip cruisecontrol-bin-2.7.2.zip -d /opt
ln -s /opt/cruisecontrol-bin-2.7.2/ /opt/cruisecontrol</pre>
<p>CruiseControl is bow installed in /opt/cruisecontrol-bin-2.7.2/ which is symlinked by /opt/cruisecontrol/</p>
<h3>Setup phpUnderControl and CruiseControl</h3>
<p>A more thorough guide can be found in the <a title="phpUnderControl" href="http://www.phpundercontrol.org/documentation.html">phpUnderControl Documentation</a>.</p>
<p>To patch the CruiseControl installation you should be able to simply to:</p>
<pre>phpuc install /opt/cruisecontrol</pre>
<p>If not, try this:</p>
<pre>cd /opt/
<code>svn co svn://www.phpunit.de/browser/phpUnderControl/tags/0.4.2 phpundercontrol
phpundercontrol/bin/phpuc.php install /opt/cruisecontrol</code></pre>
<p>And that&#8217;s pretty much it! I&#8217;ll just set up the example project so you can see it all in action:</p>
<pre>phpuc example /opt/cruisecontrol</pre>
<p>And to start cruisecontrol:</p>
<pre>cd /opt/cruisecontrol/
./cruisecontrol.sh</pre>
<p>Give it a while to setup. Once it&#8217;s all done you should be able to access the interface at:</p>
<p>http://localhost:8080/</p>
<p>By now you should have a working phpUC setup on your CentOS 5 machine and the example project failing the build process. Setting up your own projects is a bit more involved &#8211; follow the guide in the documentation for more details. As for the best way to make use of phpUC and optimal project layouts etc. I will have to get back to you as I haven&#8217;t yet played around much.</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>
<ul>
<li>Setting up <a title="CentOS 5 SVN and Trac" href="http://www.daniel-skinner.co.uk/setup-subversion-and-trac-on-centos-5/06/01/2008">S</a><a title="CentOS 5 SVN and Trac" href="http://www.daniel-skinner.co.uk/setup-subversion-and-trac-on-centos-5/06/01/2008">VN (and optionally Trac) on CentOS 5</a></li>
<li>Alternative <a title="Install PHPUnderControl on CentOS 5.1" href="http://f13o.blogspot.com/2008/06/install-phpundercontrol-on-centos-51.html">PHP5.2 and phpUC Setup</a></li>
<li><a title="Yum Repository" href="http://www.jasonlitka.com/yum-repository/">Jason Litka&#8217;s Yum Repository</a></li>
<li>Detailed guide to installing <a title="Java on CentOS" href="http://wiki.centos.org/HowTos/JavaOnCentOS">Java on CentOS</a></li>
<li><a href="http://www.phpundercontrol.org/documentation.html">phpUnderControl documentation</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.daniel-skinner.co.uk/php-under-control-svn-centos-5/12/06/2008/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<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>
