<?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; CentOS</title>
	<atom:link href="http://blog.itsmine.co.uk/tag/centos/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/centos/feed/?page=2" />

		<item>
		<title>HOWTO: OVH Kimsufi + CentOS + VMware Server 2 + networking</title>
		<link>http://blog.itsmine.co.uk/2009/09/07/howto-ovh-kimsufi-centos-vmware-server-2-networking/</link>
		<comments>http://blog.itsmine.co.uk/2009/09/07/howto-ovh-kimsufi-centos-vmware-server-2-networking/#comments</comments>
		<pubDate>Mon, 07 Sep 2009 00:30:51 +0000</pubDate>
		<dc:creator>rob</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[HOWTO]]></category>
		<category><![CDATA[OVH]]></category>

		<guid isPermaLink="false">http://blog.itsmine.co.uk/?p=728</guid>
		<description><![CDATA[This will take you through the installation and configuration of an authentic CentOS install running on an OVH Kimsufi server, allowing you to run VMware Server 2 with routed networking, since bridged networking is not possible on OVH servers. First off, some groundrules for this HOWTO we need to distinguish a few things&#8230; At time ]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">This will take you through the installation and configuration of an authentic CentOS install running on an OVH Kimsufi server, allowing you to run VMware Server 2 with routed networking, since bridged networking is not possible on OVH servers. First off, some groundrules for this HOWTO we need to distinguish a few things&#8230;</p>
<blockquote>
<p style="text-align: justify;">At time of writing, on a standard Kimsufi, OVH provide you with one static IP, and three &#8220;failover IP&#8217;s&#8221; these &#8220;failover&#8221; IP&#8217;s are just normal IP&#8217;s, although they don&#8217;t  have their own gateway (since only the host machine is allowed to use the gateway). The only thing that&#8217;s different about these &#8220;failover&#8221; IP&#8217;s is that if you have more than one Kimsufi or dedicated server with OVH then you can simply change which server the failover IP is routed to, which is quite handy for DR (disaster recovery) or even load balancing.</p>
</blockquote>
<p style="text-align: justify;">Let&#8217;s get started, first, you need to set up your server with the default CentOS image that is provided by OVH (this may already be the case if you requested this image when you ordered), if not, this is done by selecting your server from the dropdown box at the top of the manager screen, then clicking on &#8220;Services&#8221; beneath the &#8220;Dedicated servers&#8221; menu on the left-hand side. While in this menu,  ensure that &#8220;Netboot&#8221; is set to &#8220;hd&#8221; so that the boot process is kicked to the hard disk and not OVH&#8217;s custom kernels. Next, choose &#8220;Reinstall / Change OS&#8221; and follow the steps here to install CentOS, the partitioning doesn&#8217;t really matter, where possible just choose the default options and continue through the steps until the installation process starts.</p>
<p style="text-align: justify;">The installation process will continue and wipe your server clean and replace it with OVH&#8217;s CentOS image (which I might add, isn&#8217;t a <em>TRUE </em>CentOS kernel, as provided by the CentOS project). Once you&#8217;ve received your email from OVH confirming that the reinstall is complete and have got your new root password, log into the server via SSH. When you have a prompt, type the following commands:</p>
<pre class="brush: bash;">mkdir /cleaninstall
cd /cleaninstall</pre>
<p>For 32-bit CentOS:</p>
<pre class="brush: bash;">wget http://ftp.hosteurope.de/mirror/centos.org/5/os/i386/images/pxeboot/initrd.img
wget http://ftp.hosteurope.de/mirror/centos.org/5/os/i386/images/pxeboot/vmlinuz</pre>
<p>For 64-bit CentOS:</p>
<pre class="brush: bash;">wget http://ftp.hosteurope.de/mirror/centos.org/5/os/x86_64/images/pxeboot/initrd.img
wget http://ftp.hosteurope.de/mirror/centos.org/5/os/x86_64/images/pxeboot/vmlinuz</pre>
<p>Then copy the pxe boot files to the /boot partition</p>
<pre class="brush: bash;">cp vmlinuz /boot/vmlinuz.cent.pxe
cp initrd.img /boot/initrd.img.cent.pxe</pre>
<p>Next we need to set up the GRUB bootloader:</p>
<pre class="brush: bash;">yum install grub</pre>
<p>Empty the bootloader sequence and insert our new config:</p>
<pre class="brush: bash;">cat /dev/null &gt; /boot/grub/menu.lst
vi /boot/grub/menu.lst</pre>
<p>Paste the below text in this file amending the following variables to suit your info:<br />
YOURPASSWORD = A password of your choosing, this is a a temporary password and is only used during the installation via VNC<br />
IPADDR = The IP address of your OVH server (host)<br />
GATEWAY = The gateway IP address of your OVH server (find this by doing: # netstat -r | grep default)</p>
<p>For 32-bit CentOS:</p>
<pre class="brush: plain;">default 0
timeout 30
title Centos Install (PXE)
        root (hd0,0)
        kernel /boot/vmlinuz.cent.pxe vnc vncpassword=YOURPASSWORD headless ip=IPADDR netmask=255.255.255.0 gateway=GATEWAY dns=213.186.33.99 ksdevice=eth0 method=http://ftp.hosteurope.de/mirror/centos.org/5/os/i386/ lang=en_US keymap=us
        initrd /boot/initrd.img.cent.pxe
</pre>
<p>For 64-bit CentOS:</p>
<pre class="brush: plain;">default 0
timeout 30
title Centos Install (PXE)
        root (hd0,0)
        kernel /boot/vmlinuz.cent.pxe vnc vncpassword=YOURPASSWORD headless ip=IPADDR netmask=255.255.255.0 gateway=GATEWAY dns=213.186.33.99 ksdevice=eth0 method=http://ftp.hosteurope.de/mirror/centos.org/5/os/x86_64/ lang=en_US keymap=us
        initrd /boot/initrd.img.cent.pxe
</pre>
<p>Save the file (in this sequence hit Escape, colon (:), x, Enter)</p>
<p>Next we need to install GRUB into the MBR of the server disk so&#8230;</p>
<pre class="brush: bash;">grub-install /dev/sda
grub-install --recheck /dev/sda</pre>
<p>Once that&#8217;s done, we need to bounce the box:</p>
<pre class="brush: bash;">shutdown -r now</pre>
<p style="text-align: justify;">Wait a couple of minutes for the server to come back online (you can monitor it using ping requests). Once the server is contactable again fire up a VNC client and in the connection box type in the IP address of your server followed by &#8220;:1&#8243;, for example, if your IP was 192.168.0.5, the VNC connection box will read 192.168.0.5:1</p>
<p style="text-align: justify;">Enter the password you specified as  and you will be presented a VNC window at the first step of the CentOS installation screen. Follow the installer (make sure you leave the network options alone &#8211; for now at least). After the installation completes and reboots, you now have a PROPER CentOS installation free from OVH&#8217;s meddling hands.</p>
<p style="text-align: justify;">Install VMWare Server 2 as you would normally on CentOS, there are tons of HOWTO&#8217;s out there on that subject I&#8217;m sure. One thing I will say about installing VMWare Server 2 is that when asked about configuring a bridged network interface, to be honest, I wouldn&#8217;t configure one, you&#8217;ll only need NAT and Host-Only networking. To configure a Bridged interface just invites a headache of having your switch-port blocked if you ever switch on a guest VM which tries to make use of it &#8211; which can be very frustrating and WILL cause an interruption to service while OVH sort out unblocking your MAC address from their network.</p>
<p style="text-align: justify;">So, once we&#8217;ve got VMware Server 2 installed and running, we need to set up the networking so that the &#8220;failover IPs&#8221; can be used for the virtual guests. We&#8217;re going to be doing this using routed IP&#8217;s as it&#8217;s the simplest way, without having to involve NAT&#8217;ing (ugly).</p>
<p style="text-align: justify;">We&#8217;ll start off by configuring the host machine to allow proxied arp requests on the VMware host-only interface, which in this case is the &#8220;vmnet1&#8243; device &#8211; this is the default interface name that VMware Server creates, however if yours is different you&#8217;ll need to amend the below steps accordingly (this is only if you&#8217;ve had a non-standard VMware install).</p>
<pre class="brush: bash;">echo &quot;net.ipv4.conf.vmnet1.proxy_arp=1&quot; &gt;&gt; /etc/sysctl.conf &amp;&amp; sysctl -p</pre>
<p>Next on the host, we have to create a static route to allow traffic to flow to the &#8220;failover IP&#8217;s&#8221;</p>
<p>IPFAILOVER is to be subsituted with one of your failover IP&#8217;s. e.g 10.0.0.11</p>
<pre class="brush: bash;">ip route add IPFAILOVER dev vmnet1</pre>
<p style="text-align: justify;">A line like the one above is required for each failover IP which you&#8217;ll be routing.</p>
<p style="text-align: justify;">
<p style="text-align: justify;">This would not survive a reboot (bad) so we have to do something a little more inventive&#8230;<br />
We need to create a network config file in the /etc/sysconfig/network-scripts folder to set up the interface dynamically, since VMware doesn&#8217;t actually configure the interface using the standard method. In short, we need a config file to set up the interface so that CentOS is &#8220;aware&#8221; of it, and then we also need to create a route file for the interface too to set up the routing for the interface at boot.</p>
<p style="text-align: justify;">So&#8230;<br />
First off we need to find out what interface subnet the vmware installer picked to use for the vmnet1 interface on the host server, so do a</p>
<pre class="brush: bash;">ifconfig vmnet1 | grep &quot;inet addr&quot;</pre>
<p>From the output of the above command, use the &#8220;inet addr:&#8221; address for the IPADDR= and use the &#8220;Mask:&#8221; for the NETMASK=</p>
<p>Create and populate the /etc/sysconfig/network-scripts/ifcfg-vmnet1 file with the below info:</p>
<pre class="brush: bash;">vi /etc/sysconfig/network-scripts/ifcfg-vmnet1</pre>
<pre class="brush: plain;">DEVICE=vmnet1
IPADDR=*.*.*.*
NETMASK=*.*.*.*
ONBOOT=yes</pre>
<p style="text-align: justify;">Now that CentOS is aware of that network interface, the routing config to the VM&#8217;s fail-over IP needs to go into /etc/sysconfig/network-scripts/route-vmnet1 which is done by:</p>
<pre class="brush: bash;">vi /etc/sysconfig/network-scripts/route-vmnet1</pre>
<pre class="brush: plain;">IPFAILOVER dev vmnet1</pre>
<p style="text-align: justify;">A new line like the one above is required for each failover IP which you&#8217;ll be routing.</p>
<p style="text-align: justify;">
<p style="text-align: justify;">Now, unfortunately, that doesn&#8217;t solve all our problems because VMware server starts up <em>after</em> the networking service and thus <em>after</em> the virtual device is created. So we need a way to restart the networking service after VMware has started. The quickest and dirtiest way of doing that is by putting something in /etc/rc.local which will do the job. I hated having to do this, purely because it&#8217;s not &#8220;kosher&#8221; with the distro, and in general bad practise, but needs must&#8230;</p>
<pre class="brush: bash;">echo &quot;/sbin/service network restart &amp;&gt; /tmp/network-restart&quot; &gt;&gt; /etc/rc.local</pre>
<p style="text-align: justify;">Ok, so now we need to allow traffic through to the virtual machines. This is done using the iptables kernel module on the host machine (or can be done on the guest so long as there&#8217;s a rule on the host allowing all traffic through to that failover IP). Generally speaking, I like to keep my firewall rules in one place for ease of management, and that&#8217;s on the host. So, we&#8217;ll open up the iptables config file (or use my script to make it easier):</p>
<pre class="brush: bash;">vim /etc/sysconfig/iptables</pre>
<p>Find the line:</p>
<pre class="brush: plain;">-A RH-Firewall-1-INPUT -m state --state NEW -m udp -p udp --dport 1194 -j ACCEPT</pre>
<p style="text-align: justify;">and insert this line below it subsituting where necessary (below example is allowing port 22 (ssh) access through to this failover IP):</p>
<pre class="brush: plain;">-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -d FAILOVERIP -j ACCEPT</pre>
<p style="text-align: justify;">As above, a new line (rule) like the one above is required for each failover IP which you&#8217;ll be routing.</p>
<p style="text-align: justify;">As far as the server, or rather, host side is concerned, we&#8217;re finished. Now we just need to configure the guest OS with the failover IP address (or addresses if you so choose). The virtual machine should be configured to use the following:</p>
<p style="text-align: justify;">Linux hosts:<br />
IP= FAILOVERIP<br />
NETMASK=255.255.255.255<br />
GATEWAY= FAILOVERIP (yes it&#8217;s the same as the interface IP)</p>
<p style="text-align: justify;">Windows hosts:<br />
IP= FAILOVERIP<br />
NETMASK=255.255.255.248<br />
GATEWAY= FAILOVERIP (yes it&#8217;s the same as the interface IP)</p>
<p style="text-align: justify;">The DNS nameservers can be set anything you wish to use, so long as they&#8217;re addressable and accessible by the VM&#8217;s. I tend to use <a href="http://www.opendns.com/" target="_blank">OpenDNS</a>&#8216;s servers unless I&#8217;m using my own.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.itsmine.co.uk/2009/09/07/howto-ovh-kimsufi-centos-vmware-server-2-networking/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Firewall editing script</title>
		<link>http://blog.itsmine.co.uk/2009/09/06/firewall-editing-script/</link>
		<comments>http://blog.itsmine.co.uk/2009/09/06/firewall-editing-script/#comments</comments>
		<pubDate>Sun, 06 Sep 2009 15:23:24 +0000</pubDate>
		<dc:creator>rob</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Red Hat]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://blog.itsmine.co.uk/?p=715</guid>
		<description><![CDATA[Ok, here&#8217;s a wee script I threw together to help myself and any other sys admins who have to make a lot of edits to the iptables firewall in Red Hat / CentOS. It basically opens up the /etc/sysconfig/iptables file to allow you to make your edit(s) and then when you close the editor, it&#8217;ll ]]></description>
			<content:encoded><![CDATA[<p>Ok, here&#8217;s a wee script I threw together to help myself and any other sys admins who have to make a lot of edits to the iptables firewall in Red Hat / CentOS. It basically opens up the /etc/sysconfig/iptables file to allow you to make your edit(s) and then when you close the editor, it&#8217;ll ask you if you want to apply the changes straight away, or apply them immediately to allow for testing, then unload the iptables module after a set amount of time (2 minutes as defined on line 2) in case anything broke.</p>
<pre class="brush: bash;">#!/bin/bash
TESTING_MINS=2
vim /etc/sysconfig/iptables
clear
QUESTION1=&quot;Do you want to restart the firewall now? (hit 't' to test for $TESTING_MINS min(s)) [y/n/t] &quot;
echo -n $QUESTION1

a=&quot;&quot;
while test -z &quot;$a&quot;
do
        read -n1 a
        echo &quot;&quot;

 case &quot;$a&quot; in
  Y|y)
        echo -e &quot;Restarting...\n\n&quot;
		/sbin/service iptables restart
  ;;
  N|n)
        exit 0
  ;;
  T|t)
        echo -e &quot;Time is now `date +%H:%M` -firewall service will be stopped at `date +%H:%M -d &quot;+$TESTING_MINS min&quot;`\nIf your test was successful, you will need to manually start the service again by running:\nservice iptables start&quot;
        echo &quot;/sbin/service iptables stop &amp;&gt; /dev/null&quot; | at now + $TESTING_MINS min &amp;&gt; /dev/null
		echo &quot;&quot;
        /sbin/service iptables restart
  ;;
  *)
        a=&quot;&quot;
        echo -n $QUESTION1
  ;;
  esac
done</pre>
<p>P.S. Any scripts I write and publish here are © Rob Freeman and released under the <a href="http://www.gnu.org/copyleft/gpl.html" target="_blank">GPL</a> unless otherwise stated.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.itsmine.co.uk/2009/09/06/firewall-editing-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HOWTO: Convert from RHEL 5.3 to CENTOS 5.3</title>
		<link>http://blog.itsmine.co.uk/2009/08/28/howto-convert-from-rhel-5-3-to-centos-5-3/</link>
		<comments>http://blog.itsmine.co.uk/2009/08/28/howto-convert-from-rhel-5-3-to-centos-5-3/#comments</comments>
		<pubDate>Fri, 28 Aug 2009 12:57:58 +0000</pubDate>
		<dc:creator>rob</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Red Hat]]></category>
		<category><![CDATA[yum]]></category>

		<guid isPermaLink="false">http://blog.itsmine.co.uk/?p=670</guid>
		<description><![CDATA[This is actually a lot more simple than I was expecting. Recently our RHEL subscription for a backup server expired and couldn&#8217;t really justify the cost to renew it, so I decided to convert it to a CentOS installation by doing the below: yum clean all mkdir /usr/src/centos cd /usr/src/centos wget http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5 wget http://mirror.centos.org/centos/5/os/i386/CentOS/centos-release-5-3.el5.centos.1.i386.rpm wget ]]></description>
			<content:encoded><![CDATA[<p>This is actually a lot more simple than I was expecting. Recently our RHEL subscription for a backup server expired and couldn&#8217;t really justify the cost to renew it, so I decided to convert it to a CentOS installation by doing the below:</p>
<pre class="brush: bash;">yum clean all
mkdir /usr/src/centos
cd /usr/src/centos
wget http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
wget http://mirror.centos.org/centos/5/os/i386/CentOS/centos-release-5-3.el5.centos.1.i386.rpm
wget http://mirror.centos.org/centos/5/os/i386/CentOS/centos-release-notes-5.3-3.i386.rpm
wget http://mirror.centos.org/centos/5/os/i386/CentOS/yum-3.2.19-18.el5.centos.noarch.rpm
wget http://mirror.centos.org/centos/5/os/i386/CentOS/yum-updatesd-0.9-2.el5.noarch.rpm
wget http://mirror.centos.org/centos/5/os/i386/CentOS/yum-fastestmirror-1.1.16-13.el5.centos.noarch.rpm
rpm –-import RPM-GPG-KEY-CentOS-5
/bin/rpm -e --nodeps redhat-release
/bin/rpm -e --nodeps rhn-client-tools
/bin/rpm -e --nodeps yum-rhn-plugin
rpm -Uvh --force *.rpm
yum upgrade</pre>
<p>How painless was that?!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.itsmine.co.uk/2009/08/28/howto-convert-from-rhel-5-3-to-centos-5-3/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<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>
		<item>
		<title>RHEL vs Fedora</title>
		<link>http://blog.itsmine.co.uk/2008/10/02/rhel-vs-fedora/</link>
		<comments>http://blog.itsmine.co.uk/2008/10/02/rhel-vs-fedora/#comments</comments>
		<pubDate>Thu, 02 Oct 2008 13:58:17 +0000</pubDate>
		<dc:creator>rob</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Red Hat]]></category>

		<guid isPermaLink="false">http://blog.itsmine.co.uk/?p=304</guid>
		<description><![CDATA[In the past I&#8217;ve been asked a lot about what the difference is between RHEL and Fedora &#8211; a lot of people think that Fedora is just a &#8216;free&#8217; version of RHEL with pretty much the same features with the only difference being that you have to pay for support with RHEL whereas Fedora is ]]></description>
			<content:encoded><![CDATA[<p>In the past I&#8217;ve been asked a lot about what the difference is between RHEL and Fedora &#8211; a lot of people think that Fedora is just a &#8216;free&#8217; version of RHEL with pretty much the same features with the only difference being that you have to pay for support with RHEL whereas Fedora is only community supported. Unfortunately there are more differences between Fedora and RHEL than just support. The best way I can describe it is a comparison between a Formula 1 car (Fedora) and a well-cared-for Mercedes road car (RHEL). The F1 car has all the latest gadgets and technology and is on the bleeding edge of design, but unfortunately things can go wrong, and things like the tires wear down and sometimes the car flies off the track after a corner (update). If there&#8217;s a design flaw (bug) the chances are they won&#8217;t re-design a new car mid-season just to fix it &#8211; they&#8217;ll rather fix it in the next design.<br />
The F1 car design gets a new release each season with a new paint job and better performing spoilers etc and unfortunately accidents still happen. After a year or so, the old car design is scrapped completely and parts aren&#8217;t made specially for it any more (it&#8217;s reached End-Of-Life and is no longer supported).</p>
<p>On the other hand however we have the Mercedes road car which has drawn all of the experience of building the engines and parts for the F1 car, but have had the time to mature the technology used in F1, make it extremely resilient and safe and put it all into a stable car. You can be confident driving the road car that nothing will break unexpectedly and that even if it does, you can take it to the garage and they&#8217;ll figure out what&#8217;s wrong and make it right again (bug fixes). You get air bags (RHCE&#8217;s <img src='http://blog.itsmine.co.uk/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> ). You also get the peace of mind knowing that the car has a warranty and will last for a long time to come, and that parts will always be available for it, and that the tyres won&#8217;t wear down quickly etc. All because you know the car has been safety tested and engineered to withstand a crash and a break-down.</p>
<p>I think that&#8217;s about as far as I can take the analogy &#8211; but I&#8217;m sure you get the drift <img src='http://blog.itsmine.co.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.itsmine.co.uk/2008/10/02/rhel-vs-fedora/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dropbox and CentOS 5</title>
		<link>http://blog.itsmine.co.uk/2008/09/14/dropbox-and-centos-5/</link>
		<comments>http://blog.itsmine.co.uk/2008/09/14/dropbox-and-centos-5/#comments</comments>
		<pubDate>Sun, 14 Sep 2008 13:43:48 +0000</pubDate>
		<dc:creator>rob</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Dropbox]]></category>
		<category><![CDATA[Red Hat]]></category>

		<guid isPermaLink="false">http://blog.itsmine.co.uk/?p=282</guid>
		<description><![CDATA[Well, since my last post I&#8217;ve been attempting to get Dropbox working on CentOS (since this is my server platform). I have so many potential uses for having dropbox running on my server that I&#8217;d probably bore anyone reading this if I listed them. Needless to say, it&#8217;d be very useful for me if Dropbox ]]></description>
			<content:encoded><![CDATA[<p>Well, since my last post I&#8217;ve been attempting to get Dropbox working on CentOS (since this is my server platform). I have so many potential uses for having dropbox running on my server that I&#8217;d probably bore anyone reading this if I listed them. Needless to say, it&#8217;d be <em>very</em> useful for me if Dropbox would work.</p>
<p>Rather than run the installation on my live server(s), I decided to do a test install on a Virtual Machine. I fired up VMWare and created a minimal installation of CentOS (and I mean <a title="CentOS Wiki minimal installation" href="http://wiki.centos.org/FAQ/CentOS5#head-c79c201900d22f163a445f134fcc6c916eb3cb6e" target="_blank"><em>minimal</em></a>) and after installing VMware tools I installed the GNOME desktop along with the X11 Window Manager. I normally use KDE, but unfortunately Dropbox only currently supports Nautilus and not Konqueror <img src='http://blog.itsmine.co.uk/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />  .</p>
<pre class="brush: bash;">yum --exclude=nautilus-sendto groupinstall 'X Window System' 'GNOME Desktop Environment'</pre>
<p>Now, officially CentOS is not supported by Dropbox, there are no packages for CentOS provided by Dropbox so I thought I&#8217;d get the source and see what I could do with it. The package requirements are higher than the CentOS package versions available through traditional channels. I thought I&#8217;d have a pop anyway and document how far I got here. The two key problems are that Dropbox require glib2 version to be at least 2.14.0 and libnotify needs to be at least 0.4.4. CentOS 5.2 (current release at time of writing) only has packages for glib2 at 2.12.3-2 and libnotify at 0.4.2-6. I wasn&#8217;t about to let that stop my potential enjoyment of Dropbox though, so I installed the other dependencies using yum:</p>
<pre class="brush: bash;">yum install bzip2 wget make gtk+-devel libnotify-devel nautilus-extensions.i386 nautilus-devel.i386 gnome-vfs2-devel compat-glibc-headers.i386 compat-glibc.i386 gnome-desktop-devel.i386</pre>
<p>Then I got the latest source from the DropBox <a href="http://www.getdropbox.com/install?os=linux" target="_blank">download page</a> and untarred it:</p>
<pre class="brush: bash;">wget http://dl.getdropbox.com/u/5143/nautilus-dropbox-packages/0.4.1/nautilus-dropbox-0.4.1.tar.bz2
tar jxf nautilus-dropbox-0.4.1.tar.bz2</pre>
<p>Next, I had to alter the configure script to accept our versions of glib2 and libnotify which was just a matter of finding and replacing</p>
<pre class="brush: plain;">GLIB_REQUIRED=2.14.0
LIBNOTIFY_REQUIRED=0.4.4</pre>
<p>with</p>
<pre class="brush: plain;">GLIB_REQUIRED=2.12.0
LIBNOTIFY_REQUIRED=0.4.2</pre>
<p>Then I ran the</p>
<pre class="brush: bash;">./configure
make
make install</pre>
<p>Everything seemed to compile ok. Time to fire up the desktop&#8230; GNOME launched ok, but nautilus refuses to load. The problem is revealed when trying to start nautilus from the command line:</p>
<pre class="brush: plain;">[rob@localhost ~]$ nautilus /home/rob
Initializing nautilus-dropbox 0.4.1
nautilus: symbol lookup error: /usr/lib/nautilus/extensions-1.0/libnautilus-dropbox.so: undefined symbol: g_timeout_add_seconds</pre>
<p>It looks like Dropbox <em>really</em> does require the specified versions of those packages which is a <strong>real</strong> shame. So in short, unless anyone comes up with a workaround, or Dropbox release a more compatible version it looks like there&#8217;s no awesomeness to be had with Dropbox and CentOS / RHEL <img src='http://blog.itsmine.co.uk/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p>Never-the-less the awesomeness still reigns on the Windows platform!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.itsmine.co.uk/2008/09/14/dropbox-and-centos-5/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
	</channel>
</rss>
