<?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>IT Know-It-All &#187; ubuntu</title>
	<atom:link href="http://itkia.com/tag/ubuntu/feed/" rel="self" type="application/rss+xml" />
	<link>http://itkia.com</link>
	<description>Applications, OS, Networking, Data</description>
	<lastBuildDate>Mon, 02 Apr 2012 15:00:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Ubuntu Lucid and mod_fcgid Upload Corruption</title>
		<link>http://itkia.com/ubuntu-lucid-and-mod_fcgid-upload-corruption/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=ubuntu-lucid-and-mod_fcgid-upload-corruption</link>
		<comments>http://itkia.com/ubuntu-lucid-and-mod_fcgid-upload-corruption/#comments</comments>
		<pubDate>Sat, 06 Aug 2011 07:44:46 +0000</pubDate>
		<dc:creator>IT Know-It-All</dc:creator>
				<category><![CDATA[LAMP]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[mod_fcgid]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://itkia.com/?p=274</guid>
		<description><![CDATA[Ubuntu Lucid 10.04 LTS and I just aren&#8217;t getting along well so far. In past Linux upgrades I was able to keep my data and config files (after checking config files against new versions for any major changes), and the &#8230; <a href="http://itkia.com/ubuntu-lucid-and-mod_fcgid-upload-corruption/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Ubuntu Lucid 10.04 LTS and I just aren&#8217;t getting along well so far. In past Linux upgrades I was able to keep my data and config files (after checking config files against new versions for any major changes), and the upgraded system and applications behaved the same way. This hasn&#8217;t been the case for <a href="http://itkia.com/upgrade-hell/">my Lucid LTS upgrade</a>.</p>
<p>I have mod_fcgid for my PHP sites, and after my Lucid upgrade I noticed that PHP uploads such as images, photos and documents were being corrupted quite frequently, and it was happening on both WordPress and Simple Machines Forum (SMF). I spent a lot of time troubleshooting it to no avail. I was about to give up and either roll back to Hardy LTS or put PHP on Windows and run my sites there when I stumbled across this bug report: <a href="https://bugs.launchpad.net/ubuntu/+source/libapache2-mod-fcgid/+bug/573591">Uploads greater than 64 kilobytes corrupted when using Apache mod_fcgid</a></p>
<p>Lucid LTS&#8217;s mod_fcgid has this bug, and to automatically get the patch you have to have security.ubuntu.com in your /etc/apt/sources.list, for example:</p>
<blockquote><p>deb http://security.ubuntu.com/ubuntu lucid-security universe</p></blockquote>
<p>Then run updates and upgrades.</p>
<p>I suppose it&#8217;s partially my fault for not having security there in the first place, but I thought the security patches would eventually show up on the distribution mirrors. Apparently not yet. And also this seems more like a bug fix than a security issue.</p>
]]></content:encoded>
			<wfw:commentRss>http://itkia.com/ubuntu-lucid-and-mod_fcgid-upload-corruption/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Upgrade Hell</title>
		<link>http://itkia.com/upgrade-hell/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=upgrade-hell</link>
		<comments>http://itkia.com/upgrade-hell/#comments</comments>
		<pubDate>Mon, 04 Jul 2011 18:18:16 +0000</pubDate>
		<dc:creator>IT Know-It-All</dc:creator>
				<category><![CDATA[LAMP]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[mod_fcgid]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://itkia.com/?p=257</guid>
		<description><![CDATA[I&#8217;ve had an eventful couple of months revolving around wanting to move this web server from a hosted VPS to my home and both the old and new environments running into upgrade troubles. The hosted VPS was an old stable &#8230; <a href="http://itkia.com/upgrade-hell/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve had an eventful couple of months revolving around wanting to move this web server from a hosted VPS to my home and both the old and new environments running into upgrade troubles.</p>
<p>The hosted VPS was an old stable Debian version running under Virtuozzo with a 2.4 kernel. For years it has been running flawlessly. During a recent upgrade it started installing a new glibc and other programs relying on a 2.6 kernel. I guess my old Debian stable went out of support, but I&#8217;m surprised it tried going 2.6. Of course I have no control over the kernel, so I was in a bad spot. The critical services were still running, so I kept them running. (I am pretty sure most services would fail upon restart.) I had some problems with mismatched libraries failing, but overall the web server, DNS servers and sites kept running. Since I was planning on migrating to my home server anyway, I decided to keep it limping along while I prepared my home server environment.</p>
<p>My home environment was a Hardy 8.04 LTS Ubuntu server running OpenVZ containers. This has been stable for at least a couple of years, but in anticipation of moving my web server into a container there I decided to upgrade to Lucid 10.04 LTS. My mistake was not previewing major changes that would affect me. Each one probably deserves its own blog, so I&#8217;ll summarize here for now.</p>
<p>OpenVZ deprecated, <a href="https://help.ubuntu.com/community/LXC">LXC </a>is the new paravirtualization component. Good news: it&#8217;s in the main kernel tree. Bad news: it&#8217;s different enough from OpenVZ to introduce a new learning curve, and the documentation and support tools are immature as of mid-2011.</p>
<p>mod_fcgid behaves differently: On my small VPS I had apache and mod_fcgid configured for optimal efficiency in a small RAM footprint, but the same configuration options caused failures on the new mod_fcgid. The short story is that <a href="http://httpd.apache.org/mod_fcgid/mod/mod_fcgid.html">mod_fcgid became an Apache project</a> in 2009, and they&#8217;ve made some changes. They&#8217;re actually decent changes, but they don&#8217;t work with my old config options when trying to minimize process count and RAM usage. mod_fcgid will now by default avoid closing the first three processes for <strong>each </strong>class, &#8220;class&#8221; being defined in my case as the php file called in the URL. Since RAM is not an issue on the home server I removed my process count constraints, but I intend to toy with the settings until I can get it like I used to have it: one to four php_cgi processes handling all php requests.</p>
<p>SysV init -&gt; Upstart init: Lucid init is a hybrid between the new Upstart init and the old Sys V init. In many ways I like this, and when installing Ubuntu packages this wouldn&#8217;t really be an issue, but inside the LXC containers it has thrown me for a few loops because Upstart keys on events that may not happen inside a container the same way they do on the host. The good news is that in-container init scripts and service starts that key on filesystem mounting and network interface availability can be changed to &#8220;start on startup&#8221; since you can assume a container will have its filesystem and network set up before the init system is called. In particular you might want to be sure that /etc/init/rc-sysinit.conf is changed to &#8220;start on startup&#8221; inside LXC containers, and I had to do the same for /etc/init/mysql.conf .</p>
]]></content:encoded>
			<wfw:commentRss>http://itkia.com/upgrade-hell/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Using Squid To Cache Apt Updates For Debian And Ubuntu</title>
		<link>http://itkia.com/using-squid-to-cache-apt-updates-for-debian-and-ubuntu/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=using-squid-to-cache-apt-updates-for-debian-and-ubuntu</link>
		<comments>http://itkia.com/using-squid-to-cache-apt-updates-for-debian-and-ubuntu/#comments</comments>
		<pubDate>Sun, 05 Jul 2009 22:20:44 +0000</pubDate>
		<dc:creator>IT Know-It-All</dc:creator>
				<category><![CDATA[How To ...]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://itkia.com/?p=55</guid>
		<description><![CDATA[My detailed experience successfully configuring Squid to cache apt updates <a href="http://itkia.com/using-squid-to-cache-apt-updates-for-debian-and-ubuntu/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div>
<p>I run several Debian-based Linux machines and virtual machines at home and periodically install or reinstall one to test something. They all need updates—and mostly the same updates—so I wanted to cache the updates locally rather than download them several times when I upgrade.</p>
<p>There is an apt-proxy package, and although I can&#8217;t recall the problems with it I remember deciding it was not going to work well for me. I could rsync the entire package archive, but that&#8217;s just wasteful. I finally decided on setting up a <a href="http://www.squid-cache.org/">Squid proxy</a> dedicated—by intent, not controls—to caching deb packages from Debian and Ubuntu archives. And rpm&#8217;s and such if I should use other distro&#8217;s.</p>
<p>So I set up Squid and looked through the configuration options. Squid is by default set up to be most efficient at getting cache hits. I wanted to be sure it doesn&#8217;t expire the seldom-accessed large deb files to make room for tiny files, so I changed the <a href="http://www.squid-cache.org/Doc/config/cache_replacement_policy/">cache replacement policy</a> to LFUDA to optimize byte hit rate. I also increased the <a href="http://www.squid-cache.org/Doc/config/maximum_object_size/">maximum object size</a> to 100 megabytes from the default 4096 kilobytes. In a typical Squid cache the larger files aren&#8217;t cached because they often aren&#8217;t requested as often as smaller files by web surfers, however my cache&#8217;s purpose is to save these large files locally for updating several machines.</p>
<p>Now I needed to make my machines use the proxy for apt. For that I just added a code snippet to each /etc/apt/apt.conf, or in my cases I just slipped this file named jimproxy into /etc/apt/apt.conf.d/ :</p>
<pre>Acquire {
        Retries "0";
        HTTP {
                Proxy "http://address-or-URL-of-squid-proxy.example.tld:3128/";
        };
};</pre>
<p>Now when I run apt or aptitude or any manager that uses apt, they will use my Squid proxy to obtain the distribution packages.</p>
<p>This worked quite well, but I recently noticed some problems. The issue appeared to be that there were missing deb files from the archives, but what really was happening was that new Package.bz2 lists were on the archives, but my Squid cache was serving older lists it had cached. It listed some older packages which were no longer there. So my &#8220;apt-get update&#8221; would read an old package list and then &#8220;apt-get -u upgrade&#8221; wouldn&#8217;t find those older packages. So I need to tell Squid to be sure to check for new package lists. To do that I changed the <a href="http://www.squid-cache.org/Doc/config/refresh_pattern/">refresh pattern</a> option for &#8220;refresh-ims&#8221;. Voilà, it works properly now.</p>
<p>Squid.conf lines before:</p>
<pre># maximum_object_size 4096 KB
# cache_replacement_policy lru
refresh_pattern ^ftp:           1440    20%     10080
refresh_pattern ^gopher:        1440    0%      1440
refresh_pattern .               0       20%     4320</pre>
<p>Squid.conf lines after:</p>
<pre>maximum_object_size 100 MB
cache_replacement_policy heap LFUDA
refresh_pattern ^ftp:           1440    20%     10080
refresh_pattern ^gopher:        1440    0%      1440
refresh_pattern .               0       20%     4320 refresh-ims</pre>
<p>I turned on refresh-ims for everything, but I probably would have been fine with turning it on for just the frequently-changing files as shown in the following code. But in my case I don&#8217;t think turning it on for all files will adversely affect things.</p>
<pre>maximum_object_size 100 MB
cache_replacement_policy heap LFUDA
refresh_pattern ^ftp:          1440    20%     10080
refresh_pattern ^gopher:       1440    0%      1440
refresh_pattern Packages\.bz2$ 0       20%     4320 refresh-ims
refresh_pattern Sources\.bz2$  0       20%     4320 refresh-ims
refresh_pattern Release\.gpg$  0       20%     4320 refresh-ims
refresh_pattern Release$       0       20%     4320 refresh-ims
refresh_pattern .              0       20%     4320</pre>
</div>
<p>You may also be interested in <a href="http://itkia.com/2008-update-on-running-drupal-on-a-small-vps/">using Squid in web accelerator mode in a small VPS</a> to boost performance.</p>
]]></content:encoded>
			<wfw:commentRss>http://itkia.com/using-squid-to-cache-apt-updates-for-debian-and-ubuntu/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

