<?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>itsMine &#187; subversion</title>
	<atom:link href="http://blog.itsmine.co.uk/tag/subversion/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.itsmine.co.uk</link>
	<description></description>
	<lastBuildDate>Sun, 18 Apr 2010 02:28:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<atom:link rel="next" href="http://blog.itsmine.co.uk/tag/subversion/feed/?page=2" />

		<item>
		<title>HOWTO: Install Subversion, Ruby on Rails and Redmine on CentOS5 (&amp; RHEL5)</title>
		<link>http://blog.itsmine.co.uk/2009/01/22/howto-install-subversion-and-redmine-on-centos5-rhel5/</link>
		<comments>http://blog.itsmine.co.uk/2009/01/22/howto-install-subversion-and-redmine-on-centos5-rhel5/#comments</comments>
		<pubDate>Thu, 22 Jan 2009 10:26:05 +0000</pubDate>
		<dc:creator>rob</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Project]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[HOWTO]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[Red Hat]]></category>
		<category><![CDATA[redmine]]></category>
		<category><![CDATA[subversion]]></category>

		<guid isPermaLink="false">http://blog.itsmine.co.uk/?p=400</guid>
		<description><![CDATA[[Update 17th Sept 2009] I&#8217;ve just noticed that Redmine version 0.8.5 was released last week, while this HOWTO should still be valid, I have not yet tested it so please report any issues you experience with new installs in the comments and I&#8217;ll look into them and amend the HOWTO where necessary [Updated 3rd June ]]></description>
			<content:encoded><![CDATA[<p>[Update 17th Sept 2009]</p>
<p>I&#8217;ve just noticed that Redmine version 0.8.5 was released last week, while this HOWTO should still be valid, I have not yet tested it so please report any issues you experience with new installs in the comments and I&#8217;ll look into them and amend the HOWTO where necessary <img src='http://blog.itsmine.co.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><span style="color: #800080;">[Updated 3rd June 2009]</span></p>
<p>So since <a href="http://www.assembla.com" target="_blank">Assembla</a> changed it&#8217;s strategy and forced  a monetised service or your once private projects were to become public after some date in February I decided to set up my own subversion repos / web management interface.</p>
<p>I never really used the Assembla service to its full potential however and all I really needed was a basic SVN setup with a webinterface to show the diffs in an eye-friendly format. The only two real choices were <a href="http://www.google.co.uk/url?sa=t&amp;source=web&amp;ct=res&amp;cd=1&amp;url=http%3A%2F%2Ftrac.edgewall.org%2F&amp;ei=c0d4SaDRK4mt-gbM_YHYDw&amp;usg=AFQjCNFj9e7EQBej7FOQLMErR3QOrAtShQ&amp;sig2=Qz479KBdRN6dyreAtLtvXg" target="_blank">Trac</a> and <a href="http://www.google.co.uk/url?sa=t&amp;source=web&amp;ct=res&amp;cd=1&amp;url=http%3A%2F%2Fwww.redmine.org%2F&amp;ei=jkd4ScX5IJKj-gbhy5nbDw&amp;usg=AFQjCNFdhje3wlQXAFvw07HLWK7lIeOIoA&amp;sig2=9hb9qskm7LLklrNLQPoMpw" target="_blank">Redmine</a>. I&#8217;d already used Trac on Assembla and countless other project sites so I was more drawn to Redmine due to it&#8217;s good interface design (imo, the Trac interface looks like it&#8217;s stuck together with Lego pieces), its features are more integrated and well, I fancied a change. The only problem was that Redmine runs on <a href="http://rubyonrails.org/" target="_blank">Ruby on Rails</a> which I&#8217;ve heard very bad things about. So I decided to take a plunge and find out wtf the hassle was all about. It turns out there weren&#8217;t any up-to-date, well written and well maintained HOWTO&#8217;s out there detailing how to get a functional RoR environment configured on CentOS / RHEL. So I wrote my own (after hitting several brick walls)&#8230;</p>
<h3>HOWTO: Install Subversion, Ruby on Rails and Redmine on CentOS5 (&amp; RHEL5)</h3>
<p>NOTES</p>
<ul>
<li>This HOWTO is written for CentOS 5.2 [updates for 5.3 in <span style="color: #800080;">purple text</span>]</li>
<li>Replace [FQDN] with either your IP address or the hostname (or FQDN) which you’ll be using to access the interface.</li>
<li>Replace [user] with the username under whom&#8217;s home directory the Subversion repository database will be located. e.g. /home/[user]/svn-repos</li>
</ul>
<ul>
<li>This HOWTO will be using the following variables:</li>
</ul>
<blockquote>
<ul>
<li>You already have the &#8220;httpd&#8221; (apache) package installed</li>
<li>You will be running apache as the user ‘apache’</li>
<li>The subversion repository root folder will be under /home/[user]/subversion/</li>
<li>The vhost&#8217;s folder locationg will be /var/www/svn</li>
<li>The subversion repository to be created will be called ‘example-repo’</li>
</ul>
</blockquote>
<p>Install and set up Subversion</p>
<pre class="brush: bash;">yum install mod_dav_svn subversion</pre>
<p>Add the group [user] to the user apache and make the subversion base URL readable and writable&#8230;</p>
<pre class="brush: bash;">usermod -aG [user] apache
chmod g+x /home/[user]
mkdir /home/[user]/subversion
chmod g+rwx /home/[user]/subversion
chown -R [user]:[user] /home/[user]/subversion</pre>
<p>Make the web directory:</p>
<pre class="brush: bash;">mkdir /var/www/svn
chown apache.apache /var/www/svn</pre>
<p>Put the following into /etc/httpd/conf.d/svn.conf (this is for a sub-repo called &#8216;example-repo&#8217;)</p>
<pre class="brush: plain;">NameVirtualHost *:80
&lt;VirtualHost *:80&gt;
        DocumentRoot &quot;/var/www/svn&quot;
        ServerName [FQDN]
        &lt;Location /example-repo&gt;
                DAV svn
                SVNPath /home/[user]/subversion/example-repo
                AuthType Basic
                AuthName &quot;Subversion repo&quot;
                AuthUserFile /var/www/passwd
                Require valid-user
        &lt;/Location&gt;

        &lt;Directory &quot;/var/www/svn&quot;&gt;
        allow from all
        Options +Indexes
        &lt;/Directory&gt;
&lt;/VirtualHost&gt;</pre>
<p>Add an HTTP auth user&#8230;</p>
<pre class="brush: bash;">htpasswd -cm /var/www/passwd [user]</pre>
<p>Create a proper SVN repository</p>
<pre class="brush: bash;">cd /home/[user]/subversion
su [user] -c &quot;svnadmin create example-repo&quot;</pre>
<p>Import any SVN repos by doing:</p>
<pre class="brush: bash;">su [user] -c &quot;svnadmin load example-repo &lt; /path/to/repo/dump/file&quot;</pre>
<p>Make sure the permissions are correct</p>
<pre class="brush: bash;">chmod g+rwx /home/[user]/subversion
chown -R [user].[user] /home/[user]</pre>
<p><strong><ins>Install Ruby on Rails</ins></strong></p>
<p>*NOTE: Ruby on Rails installation requires the EPEL yum repository (at time of writing).</p>
<pre class="brush: bash;">su -c 'rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm'</pre>
<p>Let&#8217;s get Ruby up and running first&#8230; [NOTE: not on an SElinux environment cba with that]</p>
<pre class="brush: bash;">yum install httpd httpd-devel apr make gcc-c++ mysql-server mysql ruby ruby-devel ruby-docs ruby-ri \
ruby-libs ruby-mode ruby-tcltk ruby-irb ruby-rdoc fcgi fcgi-devel mod_fcgid rubygems subversion-ruby</pre>
<p>Now we&#8217;ll install passenger (aka mod_rails)</p>
<pre class="brush: bash;">gem install passenger
passenger-install-apache2-module</pre>
<p>Create and insert this text into /etc/httpd/conf.d/rails.conf (or alternatively edit the existing svn.conf created when we set up subversion)<br />
NOTE:</p>
<ul>
<li>The below configuration is specific to the installation of redmine (hence the DocumentRoot)</li>
</ul>
<pre class="brush: plain;">LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-2.0.6/ext/apache2/mod_passenger.so
   PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-2.0.6
   PassengerRuby /usr/bin/ruby

NameVirtualHost *:80

   &lt;VirtualHost *:80&gt;
     ServerName 192.168.10.17
     DocumentRoot /var/www/rails/redmine/public
   &lt;/VirtualHost&gt;</pre>
<p><strong><ins>Now on to Redmine itself</ins></strong></p>
<p>Get Redmine 0.8 from <a class="external" href="http://www.redmine.org/wiki/redmine/Download">http://www.redmine.org/wiki/redmine/Download</a></p>
<pre class="brush: bash;">cd /usr/src
svn co http://redmine.rubyforge.org/svn/branches/0.8-stable redmine-0.8
mkdir /var/www/rails/
cd /var/www/rails/
cp -r /usr/src/redmine-0.8/ redmine/
chown -R apache.apache redmine
cd redmine</pre>
<p>Create a clean backup of source files</p>
<pre class="brush: bash;">tar czf Redmine0.8-clean.tar.gz .</pre>
<p>Initialise mySQL:</p>
<pre class="brush: bash;">service mysqld start</pre>
<p>To secure mysql:</p>
<pre class="brush: bash;">mysql_secure_installation</pre>
<p>Create a mysql database for redmine&#8230;</p>
<pre class="brush: bash;">mysql -u[username] -p</pre>
<p>At the prompt enter:</p>
<pre class="brush: bash;">create database redmine character set utf8;</pre>
<p>Quit with:</p>
<pre class="brush: bash;">quit</pre>
<p>Copy the example database file to the &#8220;live&#8221; location</p>
<pre class="brush: bash;">cd /var/www/rails/redmine
cp config/database.yml.example config/database.yml</pre>
<p>Enter the appropriate settings for the [production] section ensuring that host is set to 127.0.0.1</p>
<pre class="brush: bash;">vim /var/www/rails/redmine/config/database.yml</pre>
<p>Set up email</p>
<pre class="brush: bash;">cd /var/www/rails/redmine
cp config/email.yml.example config/email.yml</pre>
<p>Enter the appropriate settings for the [production] section ensuring that &#8220;address&#8221; is set to the <strong>IP address</strong> of the SMTP host</p>
<pre class="brush: bash;">vim /var/www/rails/redmine/config/email.yml</pre>
<p>Install rails for redmine using gem&#8230;</p>
<pre class="brush: bash;">cd /var/www/rails/redmine/app/
gem install -v=2.1.2 rails</pre>
<p>Import the redmine database into the live database specified in the above config file</p>
<pre class="brush: bash;">cd /var/www/rails/redmine/app/
rake db:migrate RAILS_ENV=&quot;production&quot;</pre>
<p>Install default configuration data in database (this is entirely optional, but recommended).</p>
<pre class="brush: bash;">cd /var/www/rails/redmine/app/
rake redmine:load_default_data RAILS_ENV=&quot;production&quot;</pre>
<p>Bring up the testing webserver, once loaded check your config by browsing to <a class="external" href="http://%5bfqdn%5d:3000/">http://[FQDN]:3000</a></p>
<pre class="brush: bash;">cd /var/www/rails/redmine/
ruby script/server -e production</pre>
<p>Make sure your apache config file edits are ok and that the services will start at boot by doing:</p>
<pre class="brush: bash;">service httpd configtest
service httpd restart
chkconfig httpd on
chkconfig mysqld on</pre>
<p>[Optional:] Add the following to your crontab which will create a database backup in the /home/[user] directory</p>
<pre class="brush: bash;">/usr/bin/mysqldump -u &lt;user&gt; -p &lt;password&gt; &lt;database&gt; | gzip &gt; /home/[user]/redmine_`date +%y_%m_%d`.gz</pre>
<p><span style="color: #800080;">Make your subversion server configuration accessible to redmine by doing the following:</span></p>
<pre class="brush: bash;">mkdir /etc/subversion
cp -r /root/.subversion/* /etc/subversion/
vim /var/www/rails/redmine/lib/redmine/scm/adapters/subversion_adapter.rb</pre>
<p><span style="color: #800080;">Change the line:</span></p>
<pre class="brush: bash;">SVN_BIN = &quot;svn&quot;</pre>
<p><span style="color: #800080;">to:</span></p>
<pre class="brush: bash;">SVN_BIN = &quot;svn --config-dir /etc/subversion&quot;</pre>
<p><span style="color: #800080;">Then restart apache:</span></p>
<pre class="brush: bash;">service httpd restart</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.itsmine.co.uk/2009/01/22/howto-install-subversion-and-redmine-on-centos5-rhel5/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
	</channel>
</rss>
