<?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>HostingFu &#187; linux</title>
	<atom:link href="http://hostingfu.com/tag/linux/feed" rel="self" type="application/rss+xml" />
	<link>http://hostingfu.com</link>
	<description>Web Hosting Blog by a Software Developer</description>
	<lastBuildDate>Mon, 19 Jul 2010 09:27:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Subversion Error OPTIONS of &#8220;&#8230;&#8221; could not connect to server &#8211; Fixed!</title>
		<link>http://hostingfu.com/article/subversion-error-options-of-could-not-connect-to-server-fixes</link>
		<comments>http://hostingfu.com/article/subversion-error-options-of-could-not-connect-to-server-fixes#comments</comments>
		<pubDate>Tue, 27 Oct 2009 02:31:57 +0000</pubDate>
		<dc:creator>scotty</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[subversion]]></category>

		<guid isPermaLink="false">http://hostingfu.com/article/subversion-error-options-of-could-not-connect-to-server-fixes</guid>
		<description><![CDATA[Tried to set up a new VPS last night &#8212; a Xen VPS with stock kernel 2.6.18. Picked Debian 5 Lenny as operating system, and then upgrade to Squeeze using apt-get dist-upgrade. Smooth sailing so far. Until I tried to pull some of the toolchains I was trying to build from a remote subversion repository. [...]]]></description>
			<content:encoded><![CDATA[<p>Tried to set up a new VPS last night &#8212; a Xen VPS with stock kernel 2.6.18. Picked <a href="http://wiki.debian.org/DebianLenny">Debian 5 Lenny</a> as operating system, and then upgrade to <a href="http://wiki.debian.org/DebianSqueeze">Squeeze</a> using <code>apt-get dist-upgrade</code>. Smooth sailing so far. Until I tried to pull some of the toolchains I was trying to build from a remote subversion repository.</p>
<p>For example to pull the latest <a href="http://wordpress.org/">WordPress</a>.</p>
<pre class="code">
$ svn co http://core.svn.wordpress.org/trunk/
svn: OPTIONS of 'http://core.svn.wordpress.org/trunk': could not connect to server (http://core.svn.wordpress.org)
</pre>
<p>Definitely not a network issue as <em>every single Subversion repository over HTTP</em> is returning the same problem. A bit of gooling seems to suggest that <a href="http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=531338">neon is to blame</a> (neon is the HTTP/WebDAV client library used by Subversion). Doing strace shows that:</p>
<pre class="code">
...
close(4)                                = 0
socket(PF_INET, <b>0x80001</b> /* SOCK_??? */, IPPROTO_TCP) = -1 EINVAL (Invalid argument)
write(2, "svn: OPTIONS of 'http://core.svn."..., 115svn: OPTIONS of 'http://core.svn.wordpress.org/trunk': could not connect to server (http://core.svn.wordpress.org)
) = 115
exit_group(1)                           = ?
</pre>
<p>Well. According to <code>/usr/include/bits/socket.h</code>, 0&#215;80000 is <code>SOCK_CLOEXEC</code> (<em>Atomically set close-on-exec flag for the new descriptor(s).</em>), which is <a href="http://lists.manyfish.co.uk/pipermail/neon/2009-June/001021.html">not supported on Linux kernel older than 2.6.27</a>. Here comes the problem of para-virtualisation and operating system jails &#8212; you are still running the virtualised kernel supplied by your vendor. Almost all of my VPS &#8212; Xen or OpenVZ &#8212; runs on Linux kernel 2.6.18 as it&#8217;s the kernel of choice for RHEL 5 where many virtualisation vendors want to support.</p>
<p>D&#8217;oh.</p>
<p>Well. Instead of rebuilding subversion with an older neon library, here is a <a href="http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=531338#20">much simpler work-around</a> posted on Debian&#8217;s mailing list.</p>
<pre class="code">
$ echo 'http-library=self' &gt;&gt; ~/.subversion/servers
</pre>
<p>Done! Subversion should now be working on the older kernels.</p>
]]></content:encoded>
			<wfw:commentRss>http://hostingfu.com/article/subversion-error-options-of-could-not-connect-to-server-fixes/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>32 or 64 Bit for Your VPS?</title>
		<link>http://hostingfu.com/article/32-or-64-bit-your-vps</link>
		<comments>http://hostingfu.com/article/32-or-64-bit-your-vps#comments</comments>
		<pubDate>Mon, 16 Mar 2009 07:20:38 +0000</pubDate>
		<dc:creator>scotty</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[vps]]></category>

		<guid isPermaLink="false">http://hostingfu.com/?p=182</guid>
		<description><![CDATA[There&#8217;s an interesting discussion on SliceHost forum that I spotted a while ago &#8212; &#8220;Might I have to say goodbye to Slicehost? (64-bit vs. 32-bit)&#8221;. Someone is thinking of leaving SliceHost because all its OS templates are running 64 bit Linux. That means your sizeof(long) and sizeof(void*) are now 8 bytes instead of 4, which [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://hostingfu.com/files/images/64bit.png" width="100" height="107" alt="64 bit" style="float:right;margin:0 0 1ex 1ex"/> There&#8217;s an interesting discussion on SliceHost forum that I spotted a while ago &#8212; <a href="http://forum.slicehost.com/comments.php?DiscussionID=2875">&#8220;Might I have to say goodbye to Slicehost? (64-bit vs. 32-bit)&#8221;</a>. Someone is thinking of leaving <a href="http://hostingfu.com/tag/slicehost">SliceHost</a> because all its OS templates are running 64 bit Linux. That means your <code>sizeof(long)</code> and <code>sizeof(void*)</code> are now 8 bytes instead of 4, which actually can <em>significantly increase the memory usage</em> depending on the applications you run.</p>
<p><span id="more-182"></span></p>
<p>The same has also been said in this <a href="http://journal.dedasys.com/2008/11/24/slicehost-vs-linode">SliceHost vs. Linode comparison</a> &#8212; x86_64 simply uses more memory than the plain old x86. So now you not only paying the same for less memory ($20/month gets you 256MB on SliceHost vs. 384MB on Linode), your applications are also using more memory due to its 64 bit architecture &#8212; enough to force you to step up the plan. One of my friends has <a href="http://pyrmontvillage.com.au/">his WordPress website</a> running at SliceHost. It&#8217;s a typical LAMB setup with no control panel, but originally I thought a 256MB Slice would suffice. Apparently not, and the amount of swapping due to possibly bad-optimisation and fat 30+MB Apache processes force him to upgrade to a 512MB slice. But 512MB just to run a low-medium WordPress site? That&#8217;s pathetic.</p>
<p>I too have similar experience. Two Ubuntu boxes. One 32 bit at <a href="http://hostingfu.com/tag/vpslink">VPSLink</a> and one 64 bit at SliceHost. Both running pretty much my standard LAMP stack serving WordPress and Drupal sites (except Nginx instead of Apache). No opcode cache loaded. Minimum number of extensions. A <code>php-cgi</code> process is around 35MB VSZ and 14MB RSS on 32 bit, but 120MB VSZ and 25MB RSS on 64 bit. That means I can run almost twice the number of FastCGI processes, which can be beneficial on a busy site.</p>
<p>I guess for a standard web app stack, unless I <em>really</em> have a specific need for 64 bit, I&#8217;ll probably stick to that plain old 32 bit.</p>
]]></content:encoded>
			<wfw:commentRss>http://hostingfu.com/article/32-or-64-bit-your-vps/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Debian GNU/Linux 5 &#8220;Lenny&#8221; Released</title>
		<link>http://hostingfu.com/article/debian-gnu-linux-5-lenny-released</link>
		<comments>http://hostingfu.com/article/debian-gnu-linux-5-lenny-released#comments</comments>
		<pubDate>Sun, 15 Feb 2009 22:30:43 +0000</pubDate>
		<dc:creator>scotty</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://hostingfu.com/?p=180</guid>
		<description><![CDATA[Debian GNU/Linux 5.0 released: The Debian Project is pleased to announce the official release of Debian GNU/Linux version 5.0 (codenamed &#8220;Lenny&#8221;) after 22 months of constant development. Debian GNU/Linux is a free operating system which supports a total of twelve processor architectures and includes the KDE, GNOME, Xfce, and LXDE desktop environments. It also features [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.debian.org/News/2009/20090214">Debian GNU/Linux 5.0 released</a>:</p>
<blockquote><p>The Debian Project is pleased to announce the official release of Debian GNU/Linux version 5.0 (codenamed <em>&#8220;Lenny&#8221;</em>) after 22 months of constant development. Debian GNU/Linux is a free operating system which supports a total of twelve processor architectures and includes the KDE, GNOME, Xfce, and LXDE desktop environments. It also features compatibility with the FHS v2.3 and software developed for version 3.2 of the LSB.</p></blockquote>
<p>Great news. While I <a href="http://hostingfu.com/article/switched-gentoo-ubuntu">switched from Gentoo to Ubuntu</a> on production servers last year, recently I have been deploying (and migrating from Ubuntu!) Debian 5 servers and IMHO they are more stable than Ubuntu 8.04 Hardy Heron, which I have been deploying over the last 9 months or so.</p>
<p><span id="more-180"></span></p>
<p>As most my sites run PHP and off-the-shelf free/open source software, one of the biggest gripe about Ubuntu 8.04 LTS (which is supposed to have 5 year security updates) is its inclusion of PHP 5.2.4 that has <em>enumerous</em> amount of FastCGI related issues. Most of my sites run on Nginx 0.5/0.6 connecting to PHP backend via FastCGI, and under <em>moderate load</em> (50k-80k page view/day) the PHP FastCGI server will just crash and burn, leaving these messages in Nginx&#8217;s error log:</p>
<pre class="code">(104: Connection reset by peer) while reading response header from upstream</pre>
<p>The only way to recover is by restarting the entire PHP FastCGI backend (after site is down for a couple of minutes). Later on it would occur multiple times a day, and I actually have to write a script monitoring Nginx&#8217;s error log to automatically restart PHP FastCGI server to reduce the down time. That sucks &#8212; especially when I know PHP 5.2.5 fixed many FastCGI related issues but if I stick to Ubuntu 8.04 LTS I am stuck with PHP 5.2.4 for a long time (unless I build my own PHP which I was not willing to do).</p>
<p>Instead of upgrading to Ubuntu 8.10, I went with Debian 5 Lenny instead. Same command line interface. Same file system layout &#8212; but it just feels more stable when it was still marked as &#8220;testing&#8221; back then. PHP 5.2.6 included was much more solid and FastCGI server hasn&#8217;t crashed once. Problem solved!</p>
]]></content:encoded>
			<wfw:commentRss>http://hostingfu.com/article/debian-gnu-linux-5-lenny-released/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Ubuntu Server Upgrade to 8.04 Hardy Heron</title>
		<link>http://hostingfu.com/article/ubuntu-server-upgrade-8-04-hardy-heron</link>
		<comments>http://hostingfu.com/article/ubuntu-server-upgrade-8-04-hardy-heron#comments</comments>
		<pubDate>Wed, 30 Apr 2008 07:30:23 +0000</pubDate>
		<dc:creator>scotty</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://hostingfu.com/?p=156</guid>
		<description><![CDATA[First of all I have to confess that I have been very busy over the last months or two and have not really been motivated to write. I have a few other projects happening at the same time &#8212; at work, at home, at church and at my other websites, and I apologise for neglecting [...]]]></description>
			<content:encoded><![CDATA[<p>First of all I have to confess that I have been <b>very</b> busy over the last months or two and have not really been motivated to write. I have a few other projects happening at the same time &#8212; at work, at home, at church and at my other websites, and I apologise for neglecting this blog. Hopefully I will get back to writing here again. I am also hoping to write shorter pieces &#8212; maybe just 2 or 3 paragraphs &#8212; so I can make more frequent posts.</p>
<p>Now, something I have been doing over the last couple of days is to <b>upgrade my Ubuntu servers</b> to 8.04 Hardy Heron, which was &#8220;officially&#8221; released last Thursday. Now it has been almost two months since I wrote my last blog post, which was about <a href="http://hostingfu.com/article/switched-gentoo-ubuntu">switching from Gentoo to Ubuntu</a>, and now most servers/VPSs that I am personally responsible for (except those at work) are running Ubuntu. Hardy Heron is a LTS (Long Term Support) release which I am hoping to build most my apps on for the next 2 weeks. Upgrading to it from previous Ubuntu releases is surprisingly trivial.</p>
<p><span id="more-156"></span></p>
<pre class="code">
# apt-get update
# apt-get upgrade
# apt-get install update-manager-core
# do-release-upgrade
<i>[blah blah blah]</i>
</pre>
<p>The first two steps are only there to ensure you already have latest updates for the current release. It&#8217;s quite possible that &#8220;update-manager-core&#8221; has already been installed. &#8220;do-release-upgrade&#8221; does all the bulky work &#8212; checking whether a new release is available, checking how many packages need to be updated, download, unpackage and install all packages + resolving potential conflicts, etc. And at the end it just reboots your server. Wait for a minute and two, connect back in and <em>hopefully</em> you will be running 8.04 Hardy Heron. I was lucky that it worked on all my Ubuntu boxes.</p>
<p>Do note that the upgrading script, which was written in Python, does chew up quite a lot of memory. I have one tiny 64MB (+256MB swap) VPS that almost got killed with OOM. So be prepared, but YMMV.</p>
<p>So far as a server I haven&#8217;t experienced with too much differences. PostgreSQL 8.3 was in but Firebird 2.1 wasn&#8217;t (although it should be included &#8220;<a href="http://www.firebirdnews.org/?p=1661">soon</a>&#8220;). Now, back to more code hacking.</p>
]]></content:encoded>
			<wfw:commentRss>http://hostingfu.com/article/ubuntu-server-upgrade-8-04-hardy-heron/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Switched From Gentoo to Ubuntu</title>
		<link>http://hostingfu.com/article/switched-gentoo-ubuntu</link>
		<comments>http://hostingfu.com/article/switched-gentoo-ubuntu#comments</comments>
		<pubDate>Thu, 06 Mar 2008 01:12:57 +0000</pubDate>
		<dc:creator>scotty</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[gentoo]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://hostingfu.com/?p=155</guid>
		<description><![CDATA[SliceHost 3-Way-Handshake Podcast Episode 8 &#8212; over 80% of Slice at SliceHost runs on Debian-based distributions (Debian, Ubuntu), verses around 5.5% for Gentoo. RPM-based distributions (CentOS, Fedora, etc) is a bit bigger but simply does not compare with overwhelming domination of Debian-based distributions. Over the last 3-4 months I have also gradually moved my Gentoo [...]]]></description>
			<content:encoded><![CDATA[<p>SliceHost 3-Way-Handshake <a href="http://blog.slicehost.com/articles/2008/03/05/podcast-episode-8">Podcast Episode 8</a> &#8212; over <strong>80%</strong> of Slice at SliceHost runs on Debian-based distributions (Debian, Ubuntu), verses around <strong>5.5%</strong> for Gentoo. RPM-based distributions (CentOS, Fedora, etc) is a bit bigger but simply does not compare with overwhelming domination of Debian-based distributions.</p>
<p>Over the last 3-4 months I have also gradually moved my Gentoo based servers to either Ubuntu or Debian (prefer the latest Ubuntu if available). In fact I have just deleted my 18 month old Gentoo slice at SliceHost, and moved all content to a new slice running Ubuntu 7.10 last month. Now I am happy to say that <em>all</em> of my live servers/VPS are now running either Ubuntu or Debian, and it has changed my Monday morning (my usual mass-update morning) from:</p>
<ol>
<li><code># emerge --sync</code></li>
<li><code># emerge -avD world</code></li>
<li>Starring at compilation messages scrolling across the screen.</li>
<li>Trying to figure out why some packages are blocking, some packages do not emerge, and why some packages I upgraded last week is now down-grading again.</li>
<li>&#8230; 20 minutes later I finally got my root prompt back!</li>
<li>Restart all services that I have emerged, finger crossed hoping that nothing breaks, otherwise <code>revdep-rebuild</code> while reading special upgrading instruction on PAM, MySQL, or OpenSSL at <a href="http://gentoo.org/">Gentoo.org</a>.</li>
</ol>
<p>To:</p>
<ol>
<li><code># apt-get update</code></li>
<li><code># apt-get upgrade</code></li>
</ol>
<p>Upgrading all the packages in the Gentoo Portage system can be very time consuming, and it gets worse when you have quite a few servers to upgrade!</p>
<p><span id="more-155"></span></p>
<p>However, <a href="http://hostingfu.com/linux/why-gentoo">I still love my Gentoo</a> and still use it on my desktop and my home server, continuously updated over the last 3-4 years. We still use it at work because of how configurable it is, and how easy it is to write an ebuild script. Portage, IMHO, is still the best thing since slice bread, but unfortunately it is not the best thing for my VPS at slice host. Building takes too long, it is too CPU and IO intensive that I am afraid I am hurting my neighbours&#8217; performance. Moreover, if something breaks my application due to upgrading (far less than uncommon in the Gentoo world), it will take <em>ages</em> to revert back to the previous version (especially heavy builds like MySQL upgrades) &#8212; <em>when my service is down</em>!</p>
<p>Great for development boxes, but not so great for production boxes hosting services that people might want to access 24/7.</p>
<p>Ubuntu is constantly improving <a href="http://hostingfu.com/article/time-to-try-ubuntu">since the last time I gave it a try</a>. <code>apt-get</code> is a joy to use comparing to <code>yum</code> on CentOS/Fedora. It has <em>almost</em> all the packages I need, and Debian package control files are not that hard to write either. One thing I have not yet tried is dist-upgrade, which is probably even more scary than <code>emerge world</code>. <a href="https://wiki.ubuntu.com/HardyHeron">HardyHeron</a> will (hopefully) be released next month so I guess I&#8217;ll be able to find out how easy dist-upgrade on a VPS is.</p>
]]></content:encoded>
			<wfw:commentRss>http://hostingfu.com/article/switched-gentoo-ubuntu/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Linux vmsplice Local Exploit &#8211; How Hosts Responded</title>
		<link>http://hostingfu.com/article/linux-vmsplice-local-exploit-how-hosts-responded</link>
		<comments>http://hostingfu.com/article/linux-vmsplice-local-exploit-how-hosts-responded#comments</comments>
		<pubDate>Tue, 12 Feb 2008 01:20:12 +0000</pubDate>
		<dc:creator>scotty</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://hostingfu.com/?p=150</guid>
		<description><![CDATA[SecurityFocus: Linux kernel memory access vulnerabilities, exploit included to get you root account on stock kernels between 2.6.17 and 2.6.24.1. Web hosts responded &#8212; Holy !$#&#38;!!! CentOS 5, Ubuntu Edgy-Gutsy, Debian Etch &#8212; all these Linux distributions are affected. Basically a local user can gain root access, and with help from vulnerable applications that allow [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.securityfocus.com/bid/27704/info">SecurityFocus: Linux kernel memory access vulnerabilities</a>, exploit included to get you root account on stock kernels between 2.6.17 and 2.6.24.1. <a href="http://www.webhostingtalk.com/showthread.php?t=670497">Web hosts responded</a> &#8212; <a href="http://forums.hostgator.com/showthread.php?t=27629">Holy !$#&amp;</a>!!! CentOS 5, Ubuntu Edgy-Gutsy, Debian Etch &#8212; all these Linux distributions are affected. Basically a local user can gain root access, and with help from vulnerable applications that allow executing arbitrary local code, a remote user might be able to take over the entire system.</p>
<p><span id="more-150"></span></p>
<p>It is great to see hosts taking security seriously (especially those providing SSH access to shared hosting accounts). Looking at my list of hosting accounts:</p>
<ul>
<li><a href="http://www.slicehost.com/">SliceHost</a> &#8212; <a href="http://forum.slicehost.com/comments.php?DiscussionID=1347">not vulnerable</a> as they run Linux 2.6.16.</li>
<li><a href="http://www.linode.com/">Linode</a> &#8212; <a href="http://www.linode.com/forums/viewtopic.php?t=3101">new kernel images created</a> within 24 hours of security alert.</li>
<li><a href="http://www.vpslink.com/">VPSLink</a> &#8212; can&#8217;t find any discussion on their forums. My VPS there was running 2.6.9 so it should be secure, but I heard there are servers running newer 2.6.18 kernels from OpenVZ.</li>
<li><a href="http://www.dreamhost.com/">DreamHost</a> &#8212; &#8220;What security issue? We are still running 2.4 kernels!&#8221;</li>
<li><a href="http://www.nearlyfreespeech.net/">NearlyFreeSpeech</a> &#8212; &#8220;What security issue? FreeBSD ftw!&#8221;</li>
</ul>
<p>A bad bad week for Linux for sure. Time to press that panic button.</p>
]]></content:encoded>
			<wfw:commentRss>http://hostingfu.com/article/linux-vmsplice-local-exploit-how-hosts-responded/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Time to try Ubuntu?</title>
		<link>http://hostingfu.com/article/time-to-try-ubuntu</link>
		<comments>http://hostingfu.com/article/time-to-try-ubuntu#comments</comments>
		<pubDate>Fri, 27 Oct 2006 11:55:00 +0000</pubDate>
		<dc:creator>scotty</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://hostingfu.com/?p=63</guid>
		<description><![CDATA[I originally commented on Isabel Wang&#8217;s blog post on Ubuntu Linux and dedicated server providers, but somehow the comment disappeared. Hopefully it is not censorship in place :) So I am gathering my thoughts again, and will put them here. I am a long time Gentoo Linux man, which is not hard to figure out [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://hostingfu.com/files/images/ubuntu-logo.jpg" alt="Ubuntu Logo" width="160" height="160" style="float:left;margin:0 20px 5px 0"/> <em>I originally commented on <a href="http://www.thewhir.com/blogs/isabel-wang/index.cfm/2006/10/24/Oracle-Loves-Ubuntu">Isabel Wang&#8217;s blog post on Ubuntu Linux and dedicated server providers</a>, but somehow the comment disappeared. Hopefully it is not censorship in place :) So I am gathering my thoughts again, and will put them here.</em></p>
<p>I am a long time <a href="http://hostingfu.com/linux/why-gentoo">Gentoo Linux</a> man, which is not hard to figure out from reading my posts here. However, recently I am thinking about giving <a href="http://www.ubuntu.com/">Ubuntu</a> a try. Source-based Linux distributions like Gentoo is great if you like to tinker, and have lots of time on your hands. However when you have multiple servers and VPS to administer, and what you are supposed to do is to focus on software development &#8212; managing all those Gentoo boxes can just be too time consuming.</p>
<p><span id="more-63"></span></p>
<p>So I was thinking, maybe I should pick up a binary distribution. Debian? Fedora? CentOS? Well, definitely <strong>Ubuntu</strong>, which is apparently so hot even <a href="http://radar.oreilly.com/archives/2006/06/ubuntu_linux_a_threat_to_mac_o.html">Mac OS X nerds are migrating</a>.</p>
<p>And I saw earlier this week that Ubuntu is <a href="http://www.sun.com/servers/coolthreads/tnb/linux.jsp">one of two Linux distributions certified to run on SunFire T1000/T2000 servers</a>. Yup. Those cool thread 8 core UltraSparcs, so now we know which Linux distribution is <a href="http://www.sun.com/">Sun</a> adoring. Let along the <a href="http://news.com.com/2061-11516_3-6127035.html">rumoured partnership between Oracle and Ubuntu</a>. Feels like RedHat in the late 90&#8242;s.</p>
<p>So back to Isabel&#8217;s question -</p>
<blockquote><p>Oracle&#8217;s backing would certainly enhance Ubuntu&#8217;s exposure, but it&#8217;s getting plenty of attention on its own. So my question is, why hasn&#8217;t there been more Ubuntu uptake among dedicated server providers?</p></blockquote>
<p>From her list of dedicated server providers, CentOS seems to be the most commonly supported distribution. I guess CentOS providers a stable platform, well supported by control panel vendors, long term continuous updates &#8212; these make them great OS to install on production boxes, run regular <code>yum update</code> and never need to be touched it again.</p>
<p>However it won&#8217;t excite a developer with its list of old packages. Python 2.3? PHP 4.3? Apache 2.0.52? Anyone still develops for these things? But they are part of CentOS 4.4 released 2 months ago. I&#8217;ve seen many cases where an in-house developed software failed to run after uploaded to the shared hosting environment, because ISP is running one of those rock-solid enterprise Linux distribution that is just way too old. Feeling familiar?</p>
<p>Ubuntu, on the other hand, seems to be always on the cutting edge, providing the latest tools needed by your bleeding edge Web 2.0 applications. <a href="http://www.ubuntu.com/news/610released">6.10 edgy</a> has just been released, and <a href="http://www.python.org/2.5">Python 2.5</a> is there!</p>
<p>Ubuntu is picking up momentum. The big boys want to flirt with her. Developers love her. Zealots dumped Mac OS X for her. Time for dedicated server providers to offer her more support.</p>
]]></content:encoded>
			<wfw:commentRss>http://hostingfu.com/article/time-to-try-ubuntu/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Secure Shell, the Linux Shared Hosting Essential</title>
		<link>http://hostingfu.com/article/secure-shell-the-linux-shared-hosting-essential</link>
		<comments>http://hostingfu.com/article/secure-shell-the-linux-shared-hosting-essential#comments</comments>
		<pubDate>Thu, 11 May 2006 12:00:24 +0000</pubDate>
		<dc:creator>scotty</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://hostingfu.com/?p=7</guid>
		<description><![CDATA[One of the first thing I look for in Un*x/Linux shared hosting is, whether the host provides Secure Shell (SSH) access. As the hosting market becomes more competitive, more and more budget hosts start to provide this feature. However, many, especially ones under big names like GoDaddy and Yahoo, do not offer this essential feature [...]]]></description>
			<content:encoded><![CDATA[<p>One of the first thing I look for in Un*x/Linux shared hosting is, whether the host provides <a href="http://en.wikipedia.org/wiki/SSH">Secure Shell</a> (SSH) access. As the hosting market becomes more competitive, more and more budget hosts start to provide this feature. However, many, especially ones under big names like <a href="http://www.godaddy.com/">GoDaddy</a> and <a href="http://smallbusiness.yahoo.com/webhosting/">Yahoo</a>, do not offer this <em>essential</em> feature as part of their package.</p>
<p>But what is so <em>essential</em> about SSH?</p>
<p><span id="more-7"></span></p>
<h3 id="toc-i-cant-live-without-the-shell">I can&#8217;t live without the shell!</h3>
<p>First of all, <b>uploading files via FTP sucks</b>. Period.</p>
<p>Plain vanilla FTP is not secure. While many have accused those who <code>telnet</code> around for sending plain text password through the wire, many people are still relying on unencrypted FTP access to their web host. Hosts should at least have FTP over SSL/TLS, and <b>actively encouraging</b> their users to explicitly demand SSL/TLS when FTPing.</p>
<p>Moreover, FTP to upload files <em>is slow</em>. I am not talking about uploading one or two files. Many sites now consist of many files &#8212; server-side scripts, images, Javascript, stylesheets, etc. The easiest way to do is by ensuring the live copy of the site is <strong>synchronised</strong> with your local copy, so that only those files that have been updated will be uploaded.</p>
<p>Personally I have not found an <em>efficient</em> solution that utilises FTP, to ensure my live copy of the site is synchronised with my local copy. All the FTP synchronisers require traversing through directories to move files up and down. It takes <em>ages</em> (and large amount of bandwidth and CPU time wasted) to ensure two copies are synchronised, and it only works one way.</p>
<p>With SSH, you have a choice to use <a href="http://samba.anu.edu.au/rsync/">rsync</a> or related friends over SSH tunnel. It only sends out the bits that have changed, very efficiently. Very useful if you have hundreds or thousands of files.</p>
<p>Better still &#8212; this is my personal favourite &#8212; you can use the <a href="http://www.cis.upenn.edu/~bcpierce/unison/">Unison File Synchronizer</a> over SSH tunnel. Unlike rsync which will only synchronise one way, unison does two-way sync and will prompt you to resolve conflicts, in case the same file in both live and local copies have been modified since the last sync. Every now and then I do tinker with my live site just to test things out, and unison ensures my changes also get merged into my local copy.</p>
<p>With efficient tools like rsync and unison where you can upload files efficiently and securely over SSH tunnel, I do not think I can go with a web host that offers only plain FTP.</p>
<h3 id="toc-debugging-live-scripts">Debugging Live Scripts</h3>
<p>Although it is <em>Linux</em>, but there is rarely identical Linux setup across web hosts. Moreover, the web host environment will probably be very different from your local setup, if you are developing on Windows. The differences in setup will sometimes cause your perfectly working server-side scripts to stop working under live hosting environment. And sometimes it is necessary to do your debugging on the live site &#8212; although it is not recommended (especially if you have habit of breaking stuff), but sometimes <em>necessary</em> when code-upload-test-debug cycle just takes too long.</p>
<p>SSH is essential, when you need to log onto the live site to inspect things like <code>error_log</code> or PHP logs in real time.</p>
<p>I do not even know how you are supposed to do if you do not have SSH access to the raw error log files. FTPing in the modified code and FTPing the error log file out <b>every time</b> you made a small adjustment? Get real.</p>
<h3 id="toc-shell-power">Shell = Power</h3>
<p>Well, I won&#8217;t touch on this one. But remember what the wise one used to say, &#8220;with great power comes great responsibility&#8221;. Don&#8217;t abuse it :)</p>
<h3 id="toc-whos-got-shell">Who&#8217;s got shell?</h3>
<p>Plenty of them. But make sure you check out their plan features and ensure <b>SSH</b> is on the table. Of course, if you have a dedicated server or VPS, you not only have SSH access to your box, you also have the root privileged. However, even in shared hosting not all shells are equal.</p>
<p>For example, with two of my shared hosting accounts, <a href="http://hostingfu.com/dreamhost">DreamHost</a> and <a href="http://hostingfu.com/jumba">Jumba</a>, you get very different experience when you log in. Take Jumba for example, as it is a cPanel account, you get <code>jailshell</code> with limited visibility (although I can still see the full process list &#8212; might be a bug on their side). Moreover, development tool is limited. Python 2.3, Perl 5.8.3, Ruby 1.8.2 and there is no access to gcc.</p>
<p><em>(Note: this kind of jailed limited environment is probably what you&#8217;ll expect from most cPanel hosting that provides SSH. Jumba has in fact provided SSH under a great price &#8212; AUD$35.40/USD$27.40 per annual shared hosting in my case. I have also heard that they also provide SSH access to their free hosting clients. However they will only offer on request, and you need a static IP for their firewall rules.)</em></p>
<p>On the other hand, <b>DreamHost</b>, gives me a great shell. You are still under some kind of jail &#8212; at least the visibility to other processes are limited, but you do get to see many other directories and files in the FS (remember: <em>great power &#8211; great responsibility</em>). They have 3 different versions of Python installed. Moreover, you have <code>gcc</code> at your disposal. Many <a href="http://wiki.dreamhost.com/">DreamHost wiki entries</a> actually suggest you to compile your own version of PHP, Python and other tools, in case they are not provided by the Debian install. That certainly has made your hosting account much much more useful.</p>
<p>What if the compiler is not provided? Fortunately you can know very well what kind of architecture your host is on, and if you have access to a local Linux box, provided your package is not too complicated, you can easily compile a static version (or one that depends on only glibc for example) of binary and upload them. Compiling <a href="http://www.cis.upenn.edu/~bcpierce/unison/">unison</a> is tedious, as you need to compile and install another <a href="http://caml.inria.fr/">bugger</a>. So I just upload the binary I used at home into my hosting account, and it <em>just works</em>.</p>
<h3 id="toc-final-remark">Final Remark</h3>
<p>Still looking for a Linux shared hosting? Besides storage, bandwidth, cost, etc, do look for whether Secure Shell access is provided. It makes your hosting account much more useful.</p>
<p><em>(Note: This blog entry assumes that you have already acquired the skill to operate inside a un*x shell. I am a software developer, and I have been a Linux user since &#8217;95 so it is all very natural to me&#8230;)</em></p>
]]></content:encoded>
			<wfw:commentRss>http://hostingfu.com/article/secure-shell-the-linux-shared-hosting-essential/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SSH Dictionary Attack Prevention with iptables</title>
		<link>http://hostingfu.com/article/ssh-dictionary-attack-prevention-with-iptables</link>
		<comments>http://hostingfu.com/article/ssh-dictionary-attack-prevention-with-iptables#comments</comments>
		<pubDate>Wed, 19 Apr 2006 06:14:00 +0000</pubDate>
		<dc:creator>scotty</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://hostingfu.com/?p=24</guid>
		<description><![CDATA[Last week (9-15 April). 8,750 failed SSH login attempt, averaging almost one per minute, trying out all kinds of possible user names and left tons of junk in my message log. The recent SSH brute-force attacks (actually it&#8217;s not that recent) are rather annoying, and this article at Whitedust.com has useful information on how to [...]]]></description>
			<content:encoded><![CDATA[<p>Last week (9-15 April). <b>8,750</b> failed SSH login attempt, averaging almost one per minute, trying out all kinds of possible user names and left tons of junk in my message log. The recent SSH brute-force attacks (actually it&#8217;s not that <em>recent</em>) are rather annoying, and <a href="http://www.whitedust.net/article/27/Recent%20SSH%20Brute-Force%20Attacks/">this article at Whitedust.com</a> has useful information on how to prevent this kind of attacks.</p>
<p><span id="more-24"></span></p>
<p>For me I have always used <code>AllowUsers</code> directive in <code>/etc/ssh/sshd_config</code> to limit the users that can login. In my setup, I have</p>
<pre class="code">
AllowUsers root@<em>home-IP</em> <em>my-regular-login</em>
</pre>
<p>It allows root ssh login, but only from my home ADSL connection with static IP address so I can automate backups. Then it also includes a user ID that I regularly use to log into this VPS. If I need to do some system administration, I&#8217;ll use either <code>su</code> or <code>sudo</code> once I am inside.</p>
<p>However I found it is also ideal to slow down the attack when the infested host started to brute force the SSH authentication. There are many scripts/user-land daemons that perform monitoring and blocking. However in a resource limited VPS, I prefer to use something that has less demand in memory/CPU usage. <a href="http://snowman.net/projects/ipt_recent/">IPTables recent module</a> provides a kernel level solution with little overhead.</p>
<p>This is what I have in my <code>iptables</code> rules:</p>
<pre class="code">
iptables -N SSH_CHECK
iptables -A INPUT -p tcp --dport 22 -m state --state NEW -j SSH_CHECK
iptables -A SSH_CHECK -m recent --set --name SSH
iptables -A SSH_CHECK -m recent --update --seconds 60 --hitcount 4 --name SSH -j DROP
</pre>
<p>What it does is:</p>
<ol>
<li>Create a new chain <code>SSH_CHECK</code>, and all incoming SSH connection (TCP port 22) will go into this chain to test the condition.</li>
<li>Condition is, for any source IP address there cannot be more than 3 SSH connection attempts within a 60 seconds window.</li>
<li>If condition has been met, then all packets from that source IP address will be dropped.</li>
<li>That source IP can only connect again if condition is cleared again, i.e. there has been 60 seconds of <em>quiet time</em>.</li>
</ol>
<p>I found it quite effectively and dramatically reduce bot attacks on SSH port. Still, it is important to remove shell access from users that no longer require it, and choose sensible random password that is difficult to guess.</p>
]]></content:encoded>
			<wfw:commentRss>http://hostingfu.com/article/ssh-dictionary-attack-prevention-with-iptables/feed</wfw:commentRss>
		<slash:comments>22</slash:comments>
		</item>
	</channel>
</rss>
