<?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>Krystal Tech Corner</title>
	<atom:link href="http://krystal.co.uk/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://krystal.co.uk/blog</link>
	<description>Tips, advice and tech news from Krystal Hosting Ltd</description>
	<lastBuildDate>Thu, 23 Feb 2012 14:06:50 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Now accepting Google Checkout</title>
		<link>http://krystal.co.uk/blog/2012/02/now-accepting-google-checkout/</link>
		<comments>http://krystal.co.uk/blog/2012/02/now-accepting-google-checkout/#comments</comments>
		<pubDate>Thu, 23 Feb 2012 13:15:57 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[Website]]></category>
		<category><![CDATA[google checkout]]></category>
		<category><![CDATA[payment]]></category>

		<guid isPermaLink="false">http://krystal.co.uk/blog/?p=134</guid>
		<description><![CDATA[As of today, we are accepting payments via Google Checkout. The option to pay via Google is available when checking out, and also on paying Invoices raised for existing products. This now means that you can now pay us directly with your card, via Paypal or Google Checkout with bank transfer as a last resort. [...]]]></description>
			<content:encoded><![CDATA[<p>As of today, we are accepting payments via <a href="https://wallet.google.com">Google Checkout</a>.</p>
<p>The option to pay via Google is available when checking out, and also on paying Invoices raised for existing products.</p>
<p>This now means that you can now pay us directly with your card, via Paypal or Google Checkout with bank transfer as a last resort.</p>
<p>If you encounter any problems, please let us know via our <a href="http://krystal.info">support site</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://krystal.co.uk/blog/2012/02/now-accepting-google-checkout/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Converting cPanel servers to CloudLinux</title>
		<link>http://krystal.co.uk/blog/2012/02/converting-cpanel-servers-to-cloudlinux/</link>
		<comments>http://krystal.co.uk/blog/2012/02/converting-cpanel-servers-to-cloudlinux/#comments</comments>
		<pubDate>Wed, 22 Feb 2012 18:07:47 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[cPanel]]></category>
		<category><![CDATA[Centos]]></category>
		<category><![CDATA[Cloud Linux]]></category>

		<guid isPermaLink="false">http://krystal.co.uk/blog/?p=127</guid>
		<description><![CDATA[Over at Krystal we&#8217;ve started provisioning all of our UK hosting servers with Cloud Linux. So far we&#8217;ve had a great experience with both new servers and converting CentOS over. Over the last few weeks we&#8217;ve converted most of our shared hosting fleet of servers over to Cloud Linux to improve our hosting solution. For the reasons why, please read [...]]]></description>
			<content:encoded><![CDATA[<p>Over at Krystal we&#8217;ve started provisioning all of our <a title="Uk hosting" href="http://krystal.co.uk/web-hosting-uk/">UK hosting</a> servers with <a title="Cloud Linux" href="http://cloudlinux.com/">Cloud Linux</a>. So far we&#8217;ve had a great experience with both new servers and converting CentOS over.</p>
<p>Over the last few weeks we&#8217;ve converted most of our shared hosting fleet of servers over to Cloud Linux to improve our hosting solution. For the reasons why, please read on&#8230;</p>
<p><span id="more-127"></span></p>
<h2>Why Cloud Linux?</h2>
<p>As a host of thousands of websites, we have to manage our servers to make sure that no single user can dominate the resources of a server. This has always been a battle when running CentOS with users able to eat up server memory using php, or compromised websites running perl scripts.</p>
<p>Cloud Linux enables us to set the maximum resources that a single user can consume based on CPU and Memory (Disk I/O is on the way too!) meaning that a single user can&#8217;t take up all a server&#8217;s memory and cause it to run out of swap and crash. It also means that users with large websites aren&#8217;t hogging resources from everyone else.</p>
<h2>How does this affect me as a user?</h2>
<p>The simple answer is that is shouldn&#8217;t at all. Chances are if you are on one of our shared hosting or reseller plans then you&#8217;ve already been moved over. You should see a few new statistics in your cPanel.</p>
<p>If you are running a very intensive website on one of our cheaper plans, then you could run into the limits set by Cloud Linux, but so far we&#8217;ve not had a single report of this.</p>
<h2>Incompatibility</h2>
<p>The only current incompatibility we have is that R1Soft backups are currently not working with CloudLinux 6. We don&#8217;t know if this is just a CloudLinux 6 problem, or a Centos 6 problem. The R1Soft backups cause the kernel to crash (not even just a panic), requiring the server to have to be manually rebooted. R1Soft are aware of this problem, and there is an issue open since December, but no progress has been reported as of yet. Luckily we currently only have 4 servers running Cloud Linux 6 &#8211; Sahara, Dionysus, Demeter and Hera. We are taking extra cPanel backups for these servers at the moment to fill the void.</p>
<h2>More Information</h2>
<p>- If you are a dedicated server client and are interested in converting to CloudLinux then please open a support ticket.<br />
- If you want more information on CloudLinux then check out their website : <a href="http://cloudlinux.com/about/">http://cloudlinux.com/about/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://krystal.co.uk/blog/2012/02/converting-cpanel-servers-to-cloudlinux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Keeping your website safe &#8211; and off Google&#8217;s blacklist</title>
		<link>http://krystal.co.uk/blog/2011/10/keeping-your-website-safe-and-off-googles-blacklist/</link>
		<comments>http://krystal.co.uk/blog/2011/10/keeping-your-website-safe-and-off-googles-blacklist/#comments</comments>
		<pubDate>Mon, 17 Oct 2011 09:32:58 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[hacked site]]></category>

		<guid isPermaLink="false">http://krystal.co.uk/blog/?p=77</guid>
		<description><![CDATA[Lets suppose you wake up one sunny morning, and find that your web browser won&#8217;t let you open your website. Or worse still, it is listed in the Google results as &#8220;This site may harm your computer&#8221;! Maybe you thought the maintenance contract offered by your web developer was just sales flannel to get more [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://krystal.co.uk/blog/wp-content/uploads/2011/10/googlemalware2.jpeg"><img class="alignright size-medium wp-image-79" title="Google malware warning" src="http://krystal.co.uk/blog/wp-content/uploads/2011/10/googlemalware2-300x85.jpg" alt="Google malware warning" width="300" height="85" /></a>Lets suppose you wake up one sunny morning, and find that your web browser won&#8217;t let you open your website. Or worse still, it is listed in the Google results as &#8220;This site may harm your computer&#8221;! Maybe you thought the maintenance contract offered by your web developer was just sales flannel to get more money from you?</p>
<p><span id="more-77"></span></p>
<h2>Malware affects ALL systems</h2>
<p>When did you last install a Windows Update, or apply a Software Update to your Mac, or Ubuntu PC? The chances are that you have done so several times in the past year.</p>
<p>There is every chance, however, that you have never updated WordPress, Joomla, Drupal etc since you installed it. Or if you have, did you remember to check all of those juicy plugins, addons, and modules that you installed to make your website into the super funky thing that it is today?</p>
<p>Old plugins are a primary attack vector (that&#8217;s technical speak for &#8220;gaping hole&#8221;) for hackers to fire their attacks at. Just because there are no updates for your plugin does NOT mean it&#8217;s up to date &#8211; the developer may have abandoned the project. So always check.</p>
<h2>Who wants to hack your site?</h2>
<p>There are, unfortunately, armies of misguided yet talented individuals who spend their time supporting criminals, working out new ways to circumvent the security of your website so they can install their own software on your website.</p>
<p>Why? Because the software they install is intended to make them money &#8211; either directly through fraud (installing false banking lookalike pages) or by attempting to fool you into installing malware on your PC, so they can further spread their dark doings.</p>
<h2>The consequences of being hacked</h2>
<p>So what? My site got hacked &#8211; I&#8217;ll just restore it. This is a bad attitude for the following reasons:</p>
<ul>
<li>If the hack was subtle, you may not even realise it for some time. Your site may look and operate normally. After a few days we will no longer retain backups of the clean code, making recover that much harder.</li>
<li>Once search engines discover the malware, your SEO success story will come to a spectacular end. Your page rank will fall like a brick.</li>
<li>Do we need to mention the loss of business this will cause?</li>
<li>Loss of trust in your site and more importantly, your brand.</li>
<li>Just restoring clean code is not enough &#8211; the vulnerability will still exist and you will find yourself back in hot water soon enough.</li>
<li>We will probably suspend your account.</li>
</ul>
<h2>Types of attack</h2>
<p>The anatomy of any attack is quite complex &#8211; there is the method by which the attackers actually gains control, the method by which their dastardly malware is applied to your website, and then the effect of the malware itself on computers that open the website. Here are some examples of each stage of infection:</p>
<h3>Common incursion methods :</h3>
<p style="padding-left: 30px;"><strong>System command injection</strong> : Every time you open a webpage, your computer requests data from the server. An attacker creates malformed requests that attempt to fool the server into executing arbitrary code that will allow the attacker to gain the ability to alter the contents of server&#8217;s filesystem.</p>
<p style="padding-left: 30px;"><strong></strong><strong> SQL injection</strong> : Similar to Remote Command Injections, this method uses malformed requests to try and escape out of your PHP code to run arbitrary SQL queries, possibly exposing your database to the attacker.</p>
<p style="padding-left: 30px;"><strong>Infected PC</strong> : Due to an infection on your PC, an attacker has been able to gain access to your hosting account details.</p>
<p style="padding-left: 30px;"><strong>Man in the middle</strong> : An attacker compromises a local WiFi hotspot, and waits for victims to use it. Using advanced cryptographic techniques, the attacker may be able to sniff out usernames and passwords for various services you access.</p>
<h3>Types of attack :</h3>
<p style="padding-left: 30px;"><strong>SEO Poisoning</strong> &#8211; This is a technique where your website actually appears to run normally. The hackers create redirection commands (via htaccess or via injected PHP code) that redirect ONLY search engines to their  undesirable target site. So, when you look at your website it appears fine, but all of your hard earned results in google will point to porn, fraud or worse content.</p>
<p style="padding-left: 30px;"><strong>iFrame attack</strong> &#8211; The attacker injects code into your webpages that renders a &#8220;page within a page&#8221;. The injected webpage will invariably try to load popup windows that will try to fool you into installing fake anti-virus software, or similar, by telling you there is a problem with your PC. Unfortunately, the injected code is the symptom, and the vulnerability that allowed the injection to take place will be elsewhere.Symlink</p>
<p style="padding-left: 30px;"><strong>Cross site scripting</strong> : Somewhat more complicated, but equally as common, this sort of attack requires three parties &#8211; your vulnerable website, an unsuspecting user, and the attacker. The attacker lures the unsuspecting user to a compromised web page, and uses this page to access your vulnerable website using malformed requests. Once the unsuspecting party has accessed your vulnerable site, the attacker is able to view information that should be secret to the unsuspecting user.</p>
<h2>Why suspend my account?</h2>
<p>Depending on the severity and nature of the hack we may suspend your account. This might sound harsh, but in fact we are usually doing you a favour:</p>
<ul>
<li><strong>In terms of SEO</strong> &#8211; if Google, Bing etc. can&#8217;t see your hacked site, they can&#8217;t ban you, with all of the ramifications that go with it.</li>
<li><strong>In terms of your business</strong> &#8211; do you want your customers to experience a defaced website, or to have malware installed on their computers?</li>
</ul>
<p>If you had a monster loose in your shop, you&#8217;d want the building manager to close the doors while you sorted things out, right?</p>
<p>Also, depending on the nature of the attack, the malware may pose a threat to other users on the server, or to the stability of the server as a whole. It&#8217;s usually best to steer the safest course of action until we know what we are dealing with.</p>
<h2>Protecting your website</h2>
<h3>ALWAYS keep your PC, Mac, iPad etc up to date</h3>
<p><strong>Operating system updates</strong> &#8211; These can seem to arise at the most inconvenient of times. Those annoying popups telling you there are a dozen new updates for Windows, are there for a reason. Don&#8217;t delay &#8211; update as soon as you are able.</p>
<p><strong>Anti-Virus software</strong> &#8211; No computer is immune from malicious software, no matter that the marketing hype says. I&#8217;m writing this on a Mac, but I still have Anti-Virus software installed. Always keep your Anti-Virus software updated &#8211; without doing so, you may as well not have any at all.</p>
<h3>ALWAYS keep your website software up to date</h3>
<p><strong>Content Management Systems (CMS)</strong> &#8211; If you&#8217;re website is based on one of the popular content management solutions, such as WordPress, Joomla, Drupal, Concrete, phpBB, SMF, vBulletin etc, then this should be a straightforward task to updating the core components and should not take too long (often a few minutes).</p>
<p><strong>Plugins</strong> &#8211; Almost every CMS has the ability to add plugins, or add-in modules. As previously stated, it&#8217;s no good maintaining your CMS if the plugins you have installed are holding the door open for hackers. Always ensure they are kept up to date, and that they are being maintained by the author.</p>
<p><strong>Custom written</strong> &#8211; If you paid someone to develop your website from scratch, then you really have no option but to contact them and ensure that they maintain your website for you. It is advisable to ask them to provide a breakdown of the security issues they have addressed each time they charge you for updates!</p>
<h3>ALWAYS connect to your services using secure methods</h3>
<p><strong>Always access your webmail and cpanel services as:</strong></p>
<p>http://yourdomain/webmail and http://yourdomain/cpanel</p>
<p>In all cases, accessing the above should redirect you to a secure (https://) login page.</p>
<p><strong>Email, should be accessed using SSL methods &#8211; this is described in the following support article:</strong></p>
<p><a href="https://krystal.info/index.php?/Knowledgebase/Article/View/94/0/what-mail-settings-should-i-use-to-connect-to-krystals-servers">What mail settings should I use to connect to Krystal&#8217;s servers?</a></p>
<p><strong>Always connect to your FTP services using SFTP instead of FTP as this will encrypt the password. Please note that SFTP is available on port 722 (not the default 22)</strong></p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://krystal.co.uk/blog/2011/10/keeping-your-website-safe-and-off-googles-blacklist/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to test a website before changing nameservers</title>
		<link>http://krystal.co.uk/blog/2011/10/how-to-test-a-website-before-changing-nameservers/</link>
		<comments>http://krystal.co.uk/blog/2011/10/how-to-test-a-website-before-changing-nameservers/#comments</comments>
		<pubDate>Thu, 13 Oct 2011 19:28:42 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[cPanel]]></category>
		<category><![CDATA[dns]]></category>
		<category><![CDATA[hosting]]></category>
		<category><![CDATA[hosts]]></category>
		<category><![CDATA[nameservers]]></category>
		<category><![CDATA[testing]]></category>
		<category><![CDATA[website]]></category>

		<guid isPermaLink="false">http://krystal.co.uk/blog/?p=92</guid>
		<description><![CDATA[If you are moving your website and want to test out the setup on the new hosting before changing your nameservers or DNS settings on the domain then read on to discover how to get started. Introduction In this post we are going to explain how to view your website before moving the domains records [...]]]></description>
			<content:encoded><![CDATA[<p>If you are moving your website and want to test out the setup on the new hosting before changing your nameservers or DNS settings on the domain then read on to discover how to get started.</p>
<p><span id="more-92"></span></p>
<h2>Introduction</h2>
<p>In this post we are going to explain how to view your website before moving the domains records over from another location. This method will enable you to build and test a new website on our hosting and then move between different hosts with little to no downtime.</p>
<p>In our examples we are going to use an example domain &#8220;<strong>www.exampledomain.com</strong>&#8220; and the I.P address assigned to the site is &#8220;<strong>77.72.0.130</strong>&#8220;. The actual details for your domain will be in your <a title="cPanel Hosting" href="/web-hosting-uk/features/cpanel/">cPanel hosting</a> welcome e-mail.</p>
<h2>DNS in 60 seconds.</h2>
<p>Before we jump straight into the solution, lets quickly go over the basics of DNS so we can understand what we are doing. If you already know about nameservers and DNS, then skip this section!</p>
<p>The internet is one massive network. Each node connected to this network has a unique I.P address. These addresses are used to send information to the correct place. At the moment the majority of the internet is still based on IPv4, which means that addresses are made up of 4 numbers such as: 77.72.0.1</p>
<p>Humans aren&#8217;t good at remembering numbers that have no relevance to what the address means to them. Imagine telling your customers that your website address was http://77.72.0.15 &#8211; they&#8217;d never remember it. Humans are good at remembering short and concise words or phrases they can relate things to. That&#8217;s where &#8220;DNS&#8221; &#8211; <a href="http://en.wikipedia.org/wiki/Domain_Name_System" target="_blank">Domain Name System</a> comes in. DNS turns meaningful web addresses like &#8220;www.krystal.co.uk&#8221; into an I.P address that your computer can use to communicate with.</p>
<p>When you set your nameservers on your domain you are telling the world where to find all of the DNS entries for your domain &#8211; where to find your website and where to send e-mail.</p>
<h2>Overriding DNS records</h2>
<p>To start testing our domain on the new server, we want to instruct our local computer to ignore the DNS records found publicly on the domain name, and set our own records. This is done using the <strong>hosts</strong> file. Every operating system has one, and it&#8217;s a simple text file in where you can enter I.P addresses and domain names or subdomains.</p>
<h3>Windows</h3>
<p>The hosts file in located at <strong>C:\Windows\system32\drivers\etc\hosts </strong></p>
<p>This file is often set with read only permissions by system protective software as it&#8217;s an easy avenue of attack if your system is compromised. If your system was compromised, anyone with access could redirect you to any site that they wanted by entering false details in your hosts file. You&#8217;ll need to take off the read only permissions to make changes if it is set.</p>
<p>The default hosts file will look similar to this:</p>

<div class="wp_syntax"><div class="code"><pre class="none" style="font-family:monospace;"># Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
#      102.54.94.97     rhino.acme.com          # source server
#       38.25.63.10     x.acme.com              # x client host
&nbsp;
# localhost name resolution is handled within DNS itself.
#	127.0.0.1       localhost
#	::1             localhost</pre></div></div>

<p>All we need to do is insert new records for our domain name at the bottom of this file. We add one for the domain name, and one for the www. record of the domain name.</p>

<div class="wp_syntax"><div class="code"><pre class="none" style="font-family:monospace;">77.72.0.130	exampledomain.com
77.72.0.130	www.exampledomain.com</pre></div></div>

<p>Once you&#8217;ve saved this file, your computer will no longer go off and ask for DNS records for the domain name, but will simply use the address in the file. If you wish to remove the records, then load up the file and remove them, or add # to the start of the line to comment it out.</p>
<h3>Linux and MacOS</h3>
<p>The syntax for Linux and MacOS is exactly the same as Windows. The file will be located at <strong>/etc/hosts </strong>and will be protected, so you&#8217;ll need to edit it as a superuser, or as root. Open a terminal and type:</p>

<div class="wp_syntax"><div class="code"><pre class="none" style="font-family:monospace;">sudo nano /etc/hosts</pre></div></div>

<p>Use exactly the same syntax as in Windows, entering the records at the bottom of the file and then save the file.</p>

<div class="wp_syntax"><div class="code"><pre class="none" style="font-family:monospace;">77.72.0.130	exampledomain.com
77.72.0.130	www.exampledomain.com</pre></div></div>

<h2>Warning!</h2>
<p>The hosts file may already contain records such as</p>

<div class="wp_syntax"><div class="code"><pre class="none" style="font-family:monospace;">127.0.0.1		localhost</pre></div></div>

<p>Make sure you don&#8217;t remove these records, as you will cause problems with your system.</p>
<p>Remember that by adding these records to your system, the old website will cease to function for you until you remove them again. This could affect your ability to collect your e-mail as well as other things, so bare this in mind.</p>
]]></content:encoded>
			<wfw:commentRss>http://krystal.co.uk/blog/2011/10/how-to-test-a-website-before-changing-nameservers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>.htaccess rewrite examples using mod_rewrite</title>
		<link>http://krystal.co.uk/blog/2011/10/htaccess-rewrite-examples-using-mod_rewrite/</link>
		<comments>http://krystal.co.uk/blog/2011/10/htaccess-rewrite-examples-using-mod_rewrite/#comments</comments>
		<pubDate>Tue, 11 Oct 2011 21:56:55 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[cPanel]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[htaccess]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[seo]]></category>

		<guid isPermaLink="false">http://krystal.co.uk/blog/?p=54</guid>
		<description><![CDATA[In this post we will go through how to use mod_rewrite to fine tune the urls for your website. This can be beneficial for making pretty URLs for your visitors, for helping with your sites SEO, and also making your code more secure. Introduction If you want to brush up on the basics of the [...]]]></description>
			<content:encoded><![CDATA[<p>In this post we will go through how to use mod_rewrite to fine tune the urls for your website. This can be beneficial for making pretty URLs for your visitors, for helping with your sites SEO, and also making your code more secure.</p>
<p><span id="more-54"></span></p>
<h2>Introduction</h2>
<p>If you want to brush up on the basics of the .htaccess file then please see our <a href="http://krystal.co.uk/blog/2011/10/htaccess-file-beginners-guide/">.htaccess file beginners guide</a>.</p>
<p>Probably the most powerful use of the .htaccess file is the ability to take incoming requests to your website and manipulating them to your will. If you&#8217;ve ever looked at the link structure of other sites, and wondered how you can remove file extensions like .php or .html then read on!</p>
<p>The magic comes from an Apache module know as <a href="http://httpd.apache.org/docs/current/mod/mod_rewrite.html" target="_blank">mod_rewrite.</a> This module is installed and ready to use on all of our <a href="http://krystal.co.uk/web-hosting-uk/">UK Hosting</a> plans.</p>
<h2>How does it work?</h2>
<p>Anytime a request is made to your website the rewrite module will compare the address with any rules you have created. It will go through the list of rules in order and use the first one that is matched. If a match is found, then it will use the rule to reply to the request with the correct content.</p>
<h2>Getting Started</h2>
<p>All of our mod_rewrite rules will be going in our .htaccess file. The first thing you&#8217;ll need to do it enable the mod_rewrite module by adding the following:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">Options +FollowSymlinks
RewriteEngine on</pre></div></div>

<p>This only needs to be done once in the file &#8211; above all of your rules.</p>
<p>Let&#8217;s get stuck into some examples of what we can do!</p>
<h2>Hiding File Extensions</h2>
<p>A nice simple example to start off: Let&#8217;s say you have a site built with some php code, but you want to use the extension .html to serve your pages to the public. One way of doing this is to rewrite the file using the following code:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">RewriteRule ^<span style="color: #7a0874; font-weight: bold;">&#40;</span>.<span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>\.html$ <span style="color: #007800;">$1</span>.php <span style="color: #7a0874; font-weight: bold;">&#91;</span>NC<span style="color: #7a0874; font-weight: bold;">&#93;</span></pre></div></div>

<p>If we look at this code, we can break it down as follows:</p>
<ul>
<li><strong>RewriteRule</strong> &#8211; All of our rules will start with this.</li>
<li><strong>^(.*)\.html$</strong> &#8211; The second part is a <a href="http://en.wikipedia.org/wiki/Regular_expression" target="_blank">regular expression</a> that matches the incoming request, in this case the expression matches all files ending in .html</li>
<li><strong>$1.php</strong> &#8211; The third section tells Apache what to do with the incoming request, in this case use the first match from the second part and serve a file with that name ending in .php</li>
<li><strong>[NC]</strong> &#8211; The last part is a switch, which tells mod_rewrite to ignore case (NoCase).</li>
</ul>
<p>This code would mean that if you visited the URL http://&lt;yoursite&gt;/index.html then you would see http://&lt;yoursite&gt;/index.html in your address bar, but the actual page rendered in the browser would be http://&lt;yoursite&gt;/index.php</p>
<p>You can do this with any extension, it doesn&#8217;t have to be a recognised one. If you wanted to make all of your pages end in .krystal then you could with the following code:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">RewriteRule ^<span style="color: #7a0874; font-weight: bold;">&#40;</span>.<span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>\.krystal$ <span style="color: #007800;">$1</span>.php <span style="color: #7a0874; font-weight: bold;">&#91;</span>NC<span style="color: #7a0874; font-weight: bold;">&#93;</span></pre></div></div>

<h2 lang="bash">Simple redirecting to different URL/s</h2>
<p lang="bash">If you&#8217;ve developed a new site, moved your files to a different location or found some links that are showing 404 error pages, then you&#8217;ll want to catch these incoming requests and re-direct them to the correct location. There are a number of different ways you can do this, but the common consensus is that the best way to keep the search engines happy is to use the 301 http code (moved permanently).</p>
<p lang="bash">We can do a simple redirect for a single file with the following code:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">redirect <span style="color: #000000;">301</span> <span style="color: #000000; font-weight: bold;">/</span>old_page.htm http:<span style="color: #000000; font-weight: bold;">//</span>www.exampledomain.com<span style="color: #000000; font-weight: bold;">/</span>new_page.htm</pre></div></div>

<p lang="bash">But we can do much more with mod_write. If we use the same example as above, and say that we want to rewrite all .html files to .php files, and let the search engines, and users that the pages have permanently moved to the new location:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">RewriteRule ^<span style="color: #7a0874; font-weight: bold;">&#40;</span>.<span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>\.html$ http:<span style="color: #000000; font-weight: bold;">//</span>www.exampledomain.com<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$1</span>.php <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #007800;">R</span>=<span style="color: #000000;">301</span>,NC<span style="color: #7a0874; font-weight: bold;">&#93;</span></pre></div></div>

<p lang="bash">This code would mean that if you visited the URL http://&lt;yoursite&gt;/index.html then you would be redirected to http://&lt;yoursite&gt;/index.php in your address bar, and the actual page rendered in the browser would be http://&lt;yoursite&gt;/index.php. You would also keep much of your search engine link juice.</p>
<h2 lang="bash">Advanced redirection with variables</h2>
<p lang="bash">The real magic of mod_rewrite is the ability to convert complex URLs into multiple variables to pass to your scripts. This functionally gives you the ability to have fully dynamic URLS on your website, that can be interpreted. In the previous examples we used a regular expression to pull out the name of a file, and then loaded up a php file. In this example, we are going to use multiple regular expressions, and turn a request into a a normal php request.</p>
<p lang="bash">Let&#8217;s say we have a normal web address with php variables such as : http://www.exampledomain.com/news.php?category=sport&amp;id=999</p>
<p lang="bash">This is a perfectly valid, and satisfactory web address, but it could be better. If we could get the title of the news article into the URL, and hide the fact that we are using php then we&#8217;d be happy.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">RewriteRule ^news<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>a-z<span style="color: #7a0874; font-weight: bold;">&#93;</span>+<span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">0</span>-<span style="color: #000000;">9</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>+<span style="color: #7a0874; font-weight: bold;">&#41;</span>-<span style="color: #7a0874; font-weight: bold;">&#40;</span>.<span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000; font-weight: bold;">/</span>news.php?<span style="color: #007800;">category</span>=<span style="color: #007800;">$1</span><span style="color: #000000; font-weight: bold;">&amp;</span>amp;<span style="color: #007800;">id</span>=<span style="color: #007800;">$2</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>NC<span style="color: #7a0874; font-weight: bold;">&#93;</span></pre></div></div>

<p>This code would mean that if you visited the URL http://&lt;yoursite&gt;/news/sport/999-tom-scores-hatrick-in-world-cup-final and you would see the same URL in the browser location bar, but the actual page rendered in the browser would be news.php?category=sport&amp;id=999</p>
<p>You can see from this example that each regular expression inside the brackets () is interpreted and turned into variables in numerical order, $1,$2,$3 etc, so in this example  <strong>([a-z]+) = $1, ([0-9]+) = $2, (.*) = $3</strong>. We don&#8217;t bother using $3 in our rewrite rule &#8211; this isn&#8217;t a problem.</p>
<h2>Removing www. from your URLs</h2>
<p>If you want to remove www. from all of your addresses so that everyone gets re-directed to your root domain then you can use the following code:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">RewriteCond <span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>HTTP_HOST<span style="color: #7a0874; font-weight: bold;">&#125;</span> ^www.krystal.co.uk$
RewriteRule ^<span style="color: #7a0874; font-weight: bold;">&#40;</span>.<span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>$ http:<span style="color: #000000; font-weight: bold;">//</span>krystal.co.uk<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$1</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #007800;">R</span>=<span style="color: #000000;">301</span>,L<span style="color: #7a0874; font-weight: bold;">&#93;</span></pre></div></div>

<p lang="bash">This is very handy for making sure that you aren&#8217;t serving duplicate content to the search engines on both the www. and the non-www of your domain.</p>
<h2 lang="bash">Adding www. to your URLs.</h2>
<p lang="bash">The opposite to above, if you&#8217;d prefer to keep your www. and red-redirect everyone too it, then you can use</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">RewriteCond <span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>HTTP_HOST<span style="color: #7a0874; font-weight: bold;">&#125;</span> ^krystal.co.uk$
RewriteRule ^<span style="color: #7a0874; font-weight: bold;">&#40;</span>.<span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>$ http:<span style="color: #000000; font-weight: bold;">//</span>www.krystal.co.uk<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$1</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #007800;">R</span>=<span style="color: #000000;">301</span>,L<span style="color: #7a0874; font-weight: bold;">&#93;</span></pre></div></div>

<h2 lang="bash">Redirecting multiple domains to the same content</h2>
<p lang="bash">If you have multiple domains, and you want to correctly redirect them to the same website without taking a search engine hit for duplicate content, then you can use the following code:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">RewriteCond <span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>HTTP_HOST<span style="color: #7a0874; font-weight: bold;">&#125;</span> <span style="color: #000000; font-weight: bold;">!</span>www.krystal.co.uk$ <span style="color: #7a0874; font-weight: bold;">&#91;</span>NC<span style="color: #7a0874; font-weight: bold;">&#93;</span>
RewriteRule ^<span style="color: #7a0874; font-weight: bold;">&#40;</span>.<span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>$ https:<span style="color: #000000; font-weight: bold;">//</span>www.krystal.co.uk<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$1</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>L,<span style="color: #007800;">R</span>=<span style="color: #000000;">301</span><span style="color: #7a0874; font-weight: bold;">&#93;</span></pre></div></div>

<p lang="bash">This code says that if the domain <strong>IS NOT</strong> &#8220;www.krystal.co.uk&#8221; then re-direct to the same page, but on &#8220;www.krystal.co.uk&#8221;.</p>
<h2 lang="bash">Force requests over to secure URLs on https://</h2>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">RewriteCond <span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>HTTPS<span style="color: #7a0874; font-weight: bold;">&#125;</span> off
RewriteRule <span style="color: #7a0874; font-weight: bold;">&#40;</span>.<span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> https:<span style="color: #000000; font-weight: bold;">//%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>HTTP_HOST<span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>REQUEST_URI<span style="color: #7a0874; font-weight: bold;">&#125;</span></pre></div></div>

<p lang="bash">This code will force all of your traffic over to https://</p>
<p>Please let me know if you&#8217;d like to see any other specific rewrite examples, or .htaccess examples.</p>
]]></content:encoded>
			<wfw:commentRss>http://krystal.co.uk/blog/2011/10/htaccess-rewrite-examples-using-mod_rewrite/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>.htaccess file beginners guide</title>
		<link>http://krystal.co.uk/blog/2011/10/htaccess-file-beginners-guide/</link>
		<comments>http://krystal.co.uk/blog/2011/10/htaccess-file-beginners-guide/#comments</comments>
		<pubDate>Thu, 06 Oct 2011 21:34:50 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[cPanel]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[htaccess]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://krystal.co.uk/blog/?p=32</guid>
		<description><![CDATA[In brief, the .htaccess file is used to instruct Apache on what to do with incoming requests to your website. It is a very powerful tool that can totally rewrite incoming requests, block entire countries, or just define your error pages. If you are using cPanel, or any software such as Worpdress, then you are [...]]]></description>
			<content:encoded><![CDATA[<p>In brief, the .htaccess file is used to instruct Apache on what to do with incoming requests to your website. It is a very powerful tool that can totally rewrite incoming requests, block entire countries, or just define your error pages. If you are using cPanel, or any software such as Worpdress, then you are probably already utilising the .htaccess file without even knowing. In this post we&#8217;ll cover some .htaccess basics.</p>
<p><span id="more-32"></span><strong></strong></p>
<h2>Introduction</h2>
<h3>How do I create an .htaccess file?</h3>
<p>Firstly, the .htaccess file is simply a text file. It starts with a . because Linux naming convention is that any file or folder starting with a . is hidden and usually contains automated information or configuration information. You should be able to create the file using any text program, or any web editing software.</p>
<h3>Where do I put an .htaccess file?</h3>
<p>Simply, you put the .htaccess file in the folder you want to set the rules for. The .htaccess file is inherited, and can be overwritten in sub folders.</p>
<p>If you are using a <a title="cPanel hosting" href="/web-hosting-uk/features/cpanel/">cPanel hosting</a> account, your home directory will be <em>/home/&lt;username&gt;</em> and your public web directory will be <em>/home/&lt;username&gt;/publi</em><em>c_html</em> . If you place your .htaccess file in either of these directories then the file will be inherited throughout your entire web space. You should be careful if using addon domains, because you can often break software if you have it hosted in sub folders of your main web space. You can create multiple .htaccess files in different folders, and Apache will take the highest one in the hierarchy.<strong></strong></p>
<h3>What exactly does the .htaccess file do?</h3>
<p>The best place to start reading up on everything the .htaccess file can do is in the Apache Documentation, there is documentation for <a title="Apache 1.3 .htaccess" href="http://httpd.apache.org/docs/1.3/howto/htaccess.html" target="_blank">Apache 1.3 .htaccess</a> and <a title="Apache 2.2 .htaccess" href="http://httpd.apache.org/docs/2.2/howto/htaccess.html" target="_blank">Apache 2.2 .htaccess</a>. For now, let&#8217;s get started with some simple examples.</p>
<h2>Examples</h2>
<p>I&#8217;m strongly of the opinion that you learn by doing &#8211; so let&#8217;s jump straight into some examples.</p>
<p>We will pretend that our domain is &#8220;www.exampledomain.com&#8221; for these examples.</p>
<p>Just put the example text into your .htaccess file and upload it to your web space for it to go live.</p>
<h3>Example &#8211; Error Documents</h3>
<p>You&#8217;ve probably seen it on other peoples websites where you get a customised 404 Error page, or re-directed somewhere with a message saying that the page couldn&#8217;t be found, the .htaccess file is a great place to do that.</p>
<p>The following will cover you for most common error codes. See this <a title="List of HTTP status codes" href="http://en.wikipedia.org/wiki/List_of_HTTP_status_codes" target="_blank">full list of http codes</a> for a full explanation.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">ErrorDocument <span style="color: #000000;">400</span> <span style="color: #000000; font-weight: bold;">/</span>errors<span style="color: #000000; font-weight: bold;">/</span>bad_request.html
ErrorDocument <span style="color: #000000;">401</span> <span style="color: #000000; font-weight: bold;">/</span>errors<span style="color: #000000; font-weight: bold;">/</span>authentication_required.html
ErrorDocument <span style="color: #000000;">403</span> <span style="color: #000000; font-weight: bold;">/</span>errors<span style="color: #000000; font-weight: bold;">/</span>forbidden.html
ErrorDocument <span style="color: #000000;">404</span> <span style="color: #000000; font-weight: bold;">/</span>errors<span style="color: #000000; font-weight: bold;">/</span>page_not_found.html
ErrorDocument <span style="color: #000000;">500</span> <span style="color: #000000; font-weight: bold;">/</span>errors<span style="color: #000000; font-weight: bold;">/</span>server_error.html</pre></div></div>

<p>With this code, anyone who was to hit a broken link when visiting your website would be show the page www.exampledomain.com/errors/page_not_found.html</p>
<h3>Blocking visitors by IP</h3>
<p>If you want to block specific visitors, or entire IP ranges from your site, then you can do so with the following code :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">order allow,deny
deny from 1.2.3.4           <span style="color: #666666; font-style: italic;"># Blocks a single IP</span>
deny from 1.2.3.            <span style="color: #666666; font-style: italic;"># Blocks all IPs from 1.2.3.0 to 1.2.3.255</span>
deny from 192.168.0<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">30</span>      <span style="color: #666666; font-style: italic;"># Uses CIDR notation to block 4 IPs</span>
allow from all</pre></div></div>

<p>Note that the # is used for commenting, so you can remember what everything does in your file</p>
<h3>Change your default index page</h3>
<p>When someone visits your website, you&#8217;ll have an index file such as index.php or index.htm that will get loaded automatically. What if you want to change it? Here is how:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">DirectoryIndex different_index_file.html</pre></div></div>

<p>You can even enter multiple files, and it will go through the list until it finds the correct one:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">DirectoryIndex index1.html index2.php index3.cgi index4.htm</pre></div></div>

<h3>Enable Directory Listing</h3>
<p>Most <a title="secure web hosting" href="/web-hosting-uk/secure/secure-web-hosting/">secure web hosting</a>, including Krystal, will by default disable directory listings for security reasons. If you have some files in a directory that you&#8217;d like people to be able see and download, then you can enable directory listing.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">Options +Indexes</pre></div></div>

<h3>Redirect an old web page to a new one using a 301 redirect</h3>
<p>If you are <a title="Moving your website" href="/moving-my-website-to-krystal/">moving your website</a> around, then you want to keep the search engines, and visitors happy by not having broken links, then it&#8217;s a good idea to let them know that old pages have moved using a 301 redirect. The 301 code tells a visitor that the old page has <strong>Moved Permanently </strong>and that it can be found at the new address.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">redirect <span style="color: #000000;">301</span> <span style="color: #000000; font-weight: bold;">/</span>old_page.htm http:<span style="color: #000000; font-weight: bold;">//</span>www.exampledomain.com<span style="color: #000000; font-weight: bold;">/</span>new_page.htm</pre></div></div>

<h2>More complex uses of .htaccess</h2>
<p>We will be covering more complex examples of how to use the .htaccess file in a future post. We will introduce you to dynamically rewriting addresses which can be used to help boost your SEO, and to hide the underlying structure of your code.</p>
]]></content:encoded>
			<wfw:commentRss>http://krystal.co.uk/blog/2011/10/htaccess-file-beginners-guide/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Centos 5 cPanel rails: no such file to load — readline (LoadError)</title>
		<link>http://krystal.co.uk/blog/2011/10/centos-5-cpanel-rails-no-such-file-to-load-%e2%80%94-readline-loaderror/</link>
		<comments>http://krystal.co.uk/blog/2011/10/centos-5-cpanel-rails-no-such-file-to-load-%e2%80%94-readline-loaderror/#comments</comments>
		<pubDate>Wed, 05 Oct 2011 16:41:25 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[cPanel]]></category>
		<category><![CDATA[Centos]]></category>
		<category><![CDATA[Cloud Linux]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://krystal.co.uk/blog/?p=12</guid>
		<description><![CDATA[On our latest cPanel hosting servers running CloudLinux 5.5 (Centos 5.5) we ran the rails installation script to install rails. /script/installruby However when any user tried to start a rails application, or a rails console, the following error appeared: Loading production environment &#40;Rails 2.3.11&#41; /usr/lib/ruby/1.8/irb/completion.rb:10:in `require': no such file to load -- readline (LoadError) from [...]]]></description>
			<content:encoded><![CDATA[<p>On our latest <a href="/web-hosting-uk/features/cpanel/" title="cPanel hosting">cPanel hosting</a> servers running CloudLinux 5.5 (Centos 5.5) we ran the rails installation script to install rails.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>script<span style="color: #000000; font-weight: bold;">/</span>installruby</pre></div></div>

<p>However when any user tried to start a rails application, or a rails console, the following error appeared:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">Loading production environment <span style="color: #7a0874; font-weight: bold;">&#40;</span>Rails 2.3.11<span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>ruby<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">1.8</span><span style="color: #000000; font-weight: bold;">/</span>irb<span style="color: #000000; font-weight: bold;">/</span>completion.rb:<span style="color: #000000;">10</span>:<span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">`</span>require<span style="color: #ff0000;">': no such file to load -- readline (LoadError)
from /usr/lib/ruby/1.8/irb/completion.rb:10
from /usr/lib/ruby/1.8/irb/init.rb:254:in `require'</span>
from <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>ruby<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">1.8</span><span style="color: #000000; font-weight: bold;">/</span>irb<span style="color: #000000; font-weight: bold;">/</span>init.rb:<span style="color: #000000;">254</span>:<span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">`</span>load_modules<span style="color: #ff0000;">'
from /usr/lib/ruby/1.8/irb/init.rb:252:in `each'</span>
from <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>ruby<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">1.8</span><span style="color: #000000; font-weight: bold;">/</span>irb<span style="color: #000000; font-weight: bold;">/</span>init.rb:<span style="color: #000000;">252</span>:<span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">`</span>load_modules<span style="color: #ff0000;">'
from /usr/lib/ruby/1.8/irb/init.rb:21:in `setup'</span>
from <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>ruby<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">1.8</span><span style="color: #000000; font-weight: bold;">/</span>irb.rb:<span style="color: #000000;">54</span>:<span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">`</span>start<span style="color: #ff0000;">'
from /usr/bin/irb:13</span></pre></div></div>

<p>This is easily fixed by typing the following as root :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># yum install ncurses-devel readline-devel libncurses5-dev</span>
<span style="color: #666666; font-style: italic;"># /scripts/installruby --force</span></pre></div></div>

<p>Rails should now work with cPanel&#8217;s inbuilt functionality.</p>
]]></content:encoded>
			<wfw:commentRss>http://krystal.co.uk/blog/2011/10/centos-5-cpanel-rails-no-such-file-to-load-%e2%80%94-readline-loaderror/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

