<?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; phpundercontrol</title>
	<atom:link href="http://www.daniel-skinner.co.uk/tag/phpundercontrol/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>
	</channel>
</rss>
