<?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>/* Open Source Lab Blogs */</title>
	<atom:link href="http://blogs.osuosl.org/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.osuosl.org</link>
	<description></description>
	<lastBuildDate>Wed, 13 Jun 2012 01:53:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
		<item>
		<title>Ganeti Tutorial PDF guide</title>
		<link>http://www.lancealbertson.com/2012/06/ganeti-tutorial-pdf-guide/</link>
		<comments>http://www.lancealbertson.com/2012/06/ganeti-tutorial-pdf-guide/#comments</comments>
		<pubDate>Wed, 13 Jun 2012 01:53:31 +0000</pubDate>
		<dc:creator>lance</dc:creator>
				<category><![CDATA[ganeti]]></category>
		<category><![CDATA[gentoo]]></category>
		<category><![CDATA[Hosting]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[opensource]]></category>
		<category><![CDATA[OSL Planet]]></category>
		<category><![CDATA[vagrant]]></category>
		<category><![CDATA[virtualization]]></category>

		<guid isPermaLink="false">http://www.lancealbertson.com/?p=446</guid>
		<description><![CDATA[As I mentioned in my previous blog post, trying out Ganeti can be cumbersome and I went out and created a platform for testing it out using Vagrant. Now I have a PDF guide that you can use to walk through some of the basics steps of using Ganeti along with even testing a fail-over scenario.&#8230; <a href="http://www.lancealbertson.com/2012/06/ganeti-tutorial-pdf-guide/">Continue reading <span>&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>As I mentioned in my previous blog post, trying out Ganeti can be cumbersome and I went out and created a platform for testing it out using Vagrant. Now I have a <a href="http://www.lancealbertson.com/wp-content/uploads/2012/06/GanetiTutorialPDFSheet.pdf">PDF guide</a> that you can use to walk through some of the basics steps of using Ganeti along with even testing a fail-over scenario. Its an updated version of a guide I wrote for OSCON last year. Give it a try and let me know what you think!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lancealbertson.com/2012/06/ganeti-tutorial-pdf-guide/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Large Moodle downloads die prematurely when served through Varnish</title>
		<link>http://blogs.osuosl.org/gchaix/2012/05/30/large-moodle-downloads-die-prematurely-when-served-through-varnish/</link>
		<comments>http://blogs.osuosl.org/gchaix/2012/05/30/large-moodle-downloads-die-prematurely-when-served-through-varnish/#comments</comments>
		<pubDate>Thu, 31 May 2012 02:42:38 +0000</pubDate>
		<dc:creator>Greg</dc:creator>
				<category><![CDATA[Hosting]]></category>
		<category><![CDATA[Moodle]]></category>
		<category><![CDATA[OSL Planet]]></category>
		<category><![CDATA[Performance and Scaling]]></category>
		<category><![CDATA[Varnish]]></category>

		<guid isPermaLink="false">http://blogs.osuosl.org/gchaix/?p=1196</guid>
		<description><![CDATA[Varnish and Moodle, to be blunt, hate each other. So much so that for my Moodle 1.9.x sites, I simply instruct Varnish to return(pass) without even trying to cache anything on a Moodle site. Today, however, I discovered even that is insufficient. Here&#8217;s what happened: A user was reporting that when downloading large files from [...]]]></description>
			<content:encoded><![CDATA[<p>Varnish and Moodle, to be blunt, <em>hate</em> each other.  So much so that for my Moodle 1.9.x sites, I simply instruct Varnish to return(pass) without even trying to cache anything on a Moodle site.  Today, however, I discovered even that is insufficient.  Here&#8217;s what happened:<br />
<span id="more-1196"></span><br />
A user was reporting that when downloading large files from within Moodle (500mb course zip backups in this case), they&#8217;d stop at approximately 200mb.  A look at varnishlog showed that Varnish was properly seeing that it&#8217;s a Moodle request that had a &#8220;Cache-Control: no-cache&#8221; header and didn&#8217;t even try to cache it before sending the request off to the backend.  The backend was behaving exactly as expected and serving up the file.  At some point, however, the download simply terminates before completion.  No indications in the Varnish or Apache logs, nothing.  It just &#8230; stops.</p>
<p>Huh.</p>
<p>So I put the following code in my VCL in vcl_recv:</p>
<p><code>    if (req.url ~ "file.php") {<br />
        return (pipe);<br />
    }</code></p>
<p>Success!</p>
<p>Note: this must go into the VCL before the line in vcl_recv that checks the Cache-Control header, otherwise it&#8217;ll pass before it gets to the pipe:</p>
<p><code>    if (req.url ~ "file.php") {<br />
        return (pipe);<br />
    }</p>
<p>    # Force lookup if the request is a no-cache request from the client<br />
    if (req.http.Cache-Control ~ "no-cache") {<br />
        return (pass);<br />
    }</code></p>



Share this:


	<a rel="nofollow"   href="http://digg.com/submit?phase=2&amp;url=http://blogs.osuosl.org/gchaix/2012/05/30/large-moodle-downloads-die-prematurely-when-served-through-varnish/&amp;title=Large%20Moodle%20downloads%20die%20prematurely%20when%20served%20through%20Varnish&amp;bodytext=Varnish%20and%20Moodle,%20to%20be%20blunt,%20hate%20each%20other.%20%20So%20much%20so%20that%20for%20my%20Moodle%201.9.x%20sites,%20I%20simply%20instruct%20Varnish%20to%20return(pass)%20without%20even%20trying%20to%20cache%20anything%20on%20a%20Moodle%20site.%20%20Today,%20however,%20I%20discovered%20even%20that%20is%20insufficient.%20%20" title="Digg"><img src="http://blogs.osuosl.org/gchaix/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"   href="http://delicious.com/post?url=http://blogs.osuosl.org/gchaix/2012/05/30/large-moodle-downloads-die-prematurely-when-served-through-varnish/&amp;title=Large%20Moodle%20downloads%20die%20prematurely%20when%20served%20through%20Varnish&amp;notes=Varnish%20and%20Moodle,%20to%20be%20blunt,%20hate%20each%20other.%20%20So%20much%20so%20that%20for%20my%20Moodle%201.9.x%20sites,%20I%20simply%20instruct%20Varnish%20to%20return(pass)%20without%20even%20trying%20to%20cache%20anything%20on%20a%20Moodle%20site.%20%20Today,%20however,%20I%20discovered%20even%20that%20is%20insufficient.%20%20" title="del.icio.us"><img src="http://blogs.osuosl.org/gchaix/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"   href="http://www.facebook.com/share.php?u=http://blogs.osuosl.org/gchaix/2012/05/30/large-moodle-downloads-die-prematurely-when-served-through-varnish/&amp;t=Large%20Moodle%20downloads%20die%20prematurely%20when%20served%20through%20Varnish" title="Facebook"><img src="http://blogs.osuosl.org/gchaix/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"   href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http://blogs.osuosl.org/gchaix/2012/05/30/large-moodle-downloads-die-prematurely-when-served-through-varnish/&amp;title=Large%20Moodle%20downloads%20die%20prematurely%20when%20served%20through%20Varnish&amp;annotation=Varnish%20and%20Moodle,%20to%20be%20blunt,%20hate%20each%20other.%20%20So%20much%20so%20that%20for%20my%20Moodle%201.9.x%20sites,%20I%20simply%20instruct%20Varnish%20to%20return(pass)%20without%20even%20trying%20to%20cache%20anything%20on%20a%20Moodle%20site.%20%20Today,%20however,%20I%20discovered%20even%20that%20is%20insufficient.%20%20" title="Google Bookmarks"><img src="http://blogs.osuosl.org/gchaix/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"   href="http://blogs.osuosl.org/gchaix/2012/05/30/large-moodle-downloads-die-prematurely-when-served-through-varnish/" title="Furl"><img src="http://blogs.osuosl.org/gchaix/wp-content/plugins/sociable/images/" title="Furl" alt="Furl" class="sociable-hovers" /></a>
	<a rel="nofollow"   href="http://www.printfriendly.com/print?url=http://blogs.osuosl.org/gchaix/2012/05/30/large-moodle-downloads-die-prematurely-when-served-through-varnish/&amp;partner=sociable" title="Print"><img src="http://blogs.osuosl.org/gchaix/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a>
	<a rel="nofollow"   href="http://reddit.com/submit?url=http://blogs.osuosl.org/gchaix/2012/05/30/large-moodle-downloads-die-prematurely-when-served-through-varnish/&amp;title=Large%20Moodle%20downloads%20die%20prematurely%20when%20served%20through%20Varnish" title="Reddit"><img src="http://blogs.osuosl.org/gchaix/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>
	<a rel="nofollow"   href="http://slashdot.org/bookmark.pl?title=Large%20Moodle%20downloads%20die%20prematurely%20when%20served%20through%20Varnish&amp;url=http://blogs.osuosl.org/gchaix/2012/05/30/large-moodle-downloads-die-prematurely-when-served-through-varnish/" title="Slashdot"><img src="http://blogs.osuosl.org/gchaix/wp-content/plugins/sociable/images/slashdot.png" title="Slashdot" alt="Slashdot" class="sociable-hovers" /></a>
	<a rel="nofollow"   href="http://www.stumbleupon.com/submit?url=http://blogs.osuosl.org/gchaix/2012/05/30/large-moodle-downloads-die-prematurely-when-served-through-varnish/&amp;title=Large%20Moodle%20downloads%20die%20prematurely%20when%20served%20through%20Varnish" title="StumbleUpon"><img src="http://blogs.osuosl.org/gchaix/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow"   href="http://technorati.com/faves?add=http://blogs.osuosl.org/gchaix/2012/05/30/large-moodle-downloads-die-prematurely-when-served-through-varnish/" title="Technorati"><img src="http://blogs.osuosl.org/gchaix/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>
	<a rel="nofollow"   href="http://blogs.osuosl.org/gchaix/2012/05/30/large-moodle-downloads-die-prematurely-when-served-through-varnish/" title="TwitThis"><img src="http://blogs.osuosl.org/gchaix/wp-content/plugins/sociable/images/" title="TwitThis" alt="TwitThis" class="sociable-hovers" /></a>
	<a rel="nofollow"   href="http://cgi.fark.com/cgi/fark/farkit.pl?h=Large%20Moodle%20downloads%20die%20prematurely%20when%20served%20through%20Varnish&amp;u=http://blogs.osuosl.org/gchaix/2012/05/30/large-moodle-downloads-die-prematurely-when-served-through-varnish/" title="Fark"><img src="http://blogs.osuosl.org/gchaix/wp-content/plugins/sociable/images/fark.png" title="Fark" alt="Fark" class="sociable-hovers" /></a>
	<a rel="nofollow"   href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://blogs.osuosl.org/gchaix/2012/05/30/large-moodle-downloads-die-prematurely-when-served-through-varnish/&amp;title=Large%20Moodle%20downloads%20die%20prematurely%20when%20served%20through%20Varnish&amp;source=Propeller-heads+Unite!+Random+thoughts+of+a+cubicular+denizen+at+the+OSU+Open+Source+Lab&amp;summary=Varnish%20and%20Moodle,%20to%20be%20blunt,%20hate%20each%20other.%20%20So%20much%20so%20that%20for%20my%20Moodle%201.9.x%20sites,%20I%20simply%20instruct%20Varnish%20to%20return(pass)%20without%20even%20trying%20to%20cache%20anything%20on%20a%20Moodle%20site.%20%20Today,%20however,%20I%20discovered%20even%20that%20is%20insufficient.%20%20" title="LinkedIn"><img src="http://blogs.osuosl.org/gchaix/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow"   href="http://blogs.osuosl.org/gchaix/2012/05/30/large-moodle-downloads-die-prematurely-when-served-through-varnish/" title="Ma.gnolia"><img src="http://blogs.osuosl.org/gchaix/wp-content/plugins/sociable/images/" title="Ma.gnolia" alt="Ma.gnolia" class="sociable-hovers" /></a>
	<a rel="nofollow"   href="http://www.newsvine.com/_tools/seed&amp;save?u=http://blogs.osuosl.org/gchaix/2012/05/30/large-moodle-downloads-die-prematurely-when-served-through-varnish/&amp;h=Large%20Moodle%20downloads%20die%20prematurely%20when%20served%20through%20Varnish" title="NewsVine"><img src="http://blogs.osuosl.org/gchaix/wp-content/plugins/sociable/images/newsvine.png" title="NewsVine" alt="NewsVine" class="sociable-hovers" /></a>
	<a rel="nofollow"   href="http://ping.fm/ref/?link=http://blogs.osuosl.org/gchaix/2012/05/30/large-moodle-downloads-die-prematurely-when-served-through-varnish/&amp;title=Large%20Moodle%20downloads%20die%20prematurely%20when%20served%20through%20Varnish&amp;body=Varnish%20and%20Moodle,%20to%20be%20blunt,%20hate%20each%20other.%20%20So%20much%20so%20that%20for%20my%20Moodle%201.9.x%20sites,%20I%20simply%20instruct%20Varnish%20to%20return(pass)%20without%20even%20trying%20to%20cache%20anything%20on%20a%20Moodle%20site.%20%20Today,%20however,%20I%20discovered%20even%20that%20is%20insufficient.%20%20" title="Ping.fm"><img src="http://blogs.osuosl.org/gchaix/wp-content/plugins/sociable/images/ping.png" title="Ping.fm" alt="Ping.fm" class="sociable-hovers" /></a>
	<a rel="nofollow"   href="http://blogs.osuosl.org/gchaix/2012/05/30/large-moodle-downloads-die-prematurely-when-served-through-varnish/" title="Pownce"><img src="http://blogs.osuosl.org/gchaix/wp-content/plugins/sociable/images/" title="Pownce" alt="Pownce" class="sociable-hovers" /></a>
	<a rel="nofollow"   href="http://www.tumblr.com/share?v=3&amp;u=http://blogs.osuosl.org/gchaix/2012/05/30/large-moodle-downloads-die-prematurely-when-served-through-varnish/&amp;t=Large%20Moodle%20downloads%20die%20prematurely%20when%20served%20through%20Varnish&amp;s=Varnish%20and%20Moodle,%20to%20be%20blunt,%20hate%20each%20other.%20%20So%20much%20so%20that%20for%20my%20Moodle%201.9.x%20sites,%20I%20simply%20instruct%20Varnish%20to%20return(pass)%20without%20even%20trying%20to%20cache%20anything%20on%20a%20Moodle%20site.%20%20Today,%20however,%20I%20discovered%20even%20that%20is%20insufficient.%20%20" title="Tumblr"><img src="http://blogs.osuosl.org/gchaix/wp-content/plugins/sociable/images/tumblr.png" title="Tumblr" alt="Tumblr" class="sociable-hovers" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://blogs.osuosl.org/gchaix/2012/05/30/large-moodle-downloads-die-prematurely-when-served-through-varnish/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Trying out Ganeti with Vagrant</title>
		<link>http://www.lancealbertson.com/2012/05/trying-out-ganeti-with-vagrant/</link>
		<comments>http://www.lancealbertson.com/2012/05/trying-out-ganeti-with-vagrant/#comments</comments>
		<pubDate>Mon, 21 May 2012 06:09:04 +0000</pubDate>
		<dc:creator>lance</dc:creator>
				<category><![CDATA[ganeti]]></category>
		<category><![CDATA[gentoo]]></category>
		<category><![CDATA[Hosting]]></category>
		<category><![CDATA[opensource]]></category>
		<category><![CDATA[OSL Planet]]></category>
		<category><![CDATA[vagrant]]></category>
		<category><![CDATA[virtualbox]]></category>
		<category><![CDATA[virtualization]]></category>

		<guid isPermaLink="false">http://www.lancealbertson.com/?p=425</guid>
		<description><![CDATA[Ganeti is a very powerful tool but often times people have to look for spare hardware to try it out easily. I also wanted to have a way to easily test new features of Ganeti Web Manager (GWM) and Ganeti Instance Image without requiring additional hardware. While I do have the convenience of having access to hardware&#8230; <a href="http://www.lancealbertson.com/2012/05/trying-out-ganeti-with-vagrant/">Continue reading <span>&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://code.google.com/p/ganeti/">Ganeti</a> is a very powerful tool but often times people have to look for spare hardware to try it out easily. I also wanted to have a way to easily test new features of <a href="https://code.osuosl.org/projects/ganeti-webmgr">Ganeti Web Manager (GWM)</a> and <a href="https://code.osuosl.org/projects/ganeti-image">Ganeti Instance Image</a> without requiring additional hardware. While I do have the convenience of having access to hardware at the <a href="http://osuosl.org">OSU Open Source Lab</a> to do my testing, I&#8217;d rather not depend on that always. Sometimes I like trying new and crazier things and I&#8217;d rather not break a test cluster all the time. So I decided to see if I could use <a href="http://vagrantup.com/">Vagrant</a> as a tool to create a Ganeti test environment on my own workstation and laptop.</p>
<p>This all started last year while I was preparing for my <a href="http://www.oscon.com/oscon2011/public/schedule/detail/18544">OSCON tutorial</a> on Ganeti and was manually creating VirtualBox VMs to deploy Ganeti nodes for the tutorial. It worked well but soon after I gave the tutorial I discovered Vagrant and decided to adapt my OSCON tutorial with Vagrant. Its a bit like the movie Inception of course, but I was able to successfully get Ganeti working with Ubuntu and KVM <em>(technically just qemu)</em> and mostly functional VMs inside of the nodes. I was also able to quickly create a three-node cluster to test failover with GWM and many facets of the webapp.</p>
<p>The vagrant setup I have has two parts:</p>
<ol>
<li><a href="https://github.com/ramereth/puppet-ganeti-tutorial">Ganeti Tutorial Puppet Module</a></li>
<li><a href="https://github.com/ramereth/vagrant-ganeti">Ganeti Vagrant configs</a></li>
</ol>
<p>The puppet module I wrote is very basic and isn&#8217;t really intended for production use. I plan to re-factor it in the coming months into a completely modular production ready set of modules. The node boxes are currently running Ubuntu 11.10 (I&#8217;ve been having some minor issues getting 12.04 to work), and the internal VMs you can deploy are based on the <a href="https://launchpad.net/cirros">CirrOS Tiny OS</a>. I also created several branches in the vagrant-ganeti repo for testing various versions of Ganeti which has helped the GWM team implement better support for 2.5 in the upcoming release.</p>
<p>To get started using Ganeti with Vagrant, you can do the following:</p>
<pre class="brush: bash; title: ; notranslate">git clone git://github.com/ramereth/vagrant-ganeti.git
git submodule update --init
gem install vagrant
vagrant up node1
vagrant ssh node1
gnt-cluster verify
</pre>
<p>Moving forward I plan to implement the following:</p>
<ul>
<li>Update tutorial documentation</li>
<li>Support for Xen and LXC</li>
<li>Support for CentOS and Debian as the node OS</li>
</ul>
<p>Please check out the <a href="https://github.com/ramereth/vagrant-ganeti/blob/master/README.md">README</a> for more instructions on how to use the Vagrant+Ganeti setup. If you have any feature requests please don&#8217;t hesitate to create an issue on the github repo.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lancealbertson.com/2012/05/trying-out-ganeti-with-vagrant/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Memcached and PECL memcache on CentOS and Fedora</title>
		<link>http://sheltren.com/drupal-memcache</link>
		<comments>http://sheltren.com/drupal-memcache#comments</comments>
		<pubDate>Thu, 26 Apr 2012 18:02:16 +0000</pubDate>
		<dc:creator>jeff</dc:creator>
				<category><![CDATA[OSL Planet]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[At Tag1 Consulting we do a lot of work on increasing web site performance, especially around Drupal sites.  One of the common tools we use is memcached combined with the Drupal Memcache module.  In Drupal, there are a number of different caches which a...]]></description>
			<content:encoded><![CDATA[<div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even" property="content:encoded"><p>At <a href="http://tag1consulting.com">Tag1 Consulting</a> we do a lot of work on increasing web site performance, especially around Drupal sites.  One of the common tools we use is <a href="http://memcached.org">memcached</a> combined with the <a href="http://drupal.org/project/memcache">Drupal Memcache module</a>.  In Drupal, there are a number of different caches which are stored in the (typically MySQL) database by default.  This is good for performance as it cuts down on potentially large/slow SQL queries and PHP execution needed to display content on a site.  The Drupal Memcache module allows you to configure some or all of those caches to be stored in memcached instead of MySQL, typically these cache gets/puts in memcache are much faster than they would be in MySQL, and at the same time it decreases work load on the database server.  This is all great for performance, but it involves setting up an additional service (memcached) as well as adding a PHP extension in order to communicate with memcached.  I've seen a number of guides on how to install these things on Fedora or CentOS, but so many of them are out-dated or give instructions which I wouldn't suggest such as building things from source, installing with the 'pecl' command (not great on a package based system), or using various external yum repositories (some of which don't mix well with the standard repos).  What follows is my suggested method for installing these needed dependencies in order to use memcached with Drupal, though the same process should be valid for any other PHP script using memcache.</p>
<h2>PECL Packages</h2>
<p>For the Drupal Memcache module, either the <a href="http://pecl.php.net/package/memcache">PECL memcache</a> or <a href="http://pecl.php.net/package/memcached">PECL memcached</a> (note the 'd'!) extensions can be used.  While PECL memcached is newer and has some additional features, PECL memcache (no 'd'!) tends to be better tested and supported, at least for the Drupal Memcache module.  Yes, the PECL extension names are HORRIBLE and very confusing to newcomers!  I almost always use the PECL memcache extension because I've had some strange behavior in the past using the memcached extension; likely those problems are fixed now, but it's become a habit and personal preference to use the memcache extension.</p>
<h2>Installing and Configuring memcached</h2>
<p>The first step is to get memcached installed and configured.  CentOS 5 and 6 both include memcached in the base package repo, as do all recent Fedora releases.  To install memcached is simply a matter of:<br /><code># yum install memcached</code></p>
<p>Generally, unless you really know what you're doing, the only configuration option you'll need to change is the amount of memory to allocate to memcached.  The default is 64MB.  That may be enough for small sites, but for larger sites you will likely be using multiple gigabytes.  It's hard to recommend a standard size to use as it will vary by a large amount based on the site.  If you have a "big" site, I'd say start at 512MB or 1GB; if you have a smaller site you might leave the default, or just bump it to 512MB anyway if you have plenty of RAM on the server.  Once it's running, you can watch the memory usage and look for evictions (removal of a cache item once the cache is full) to see if you might want to increase the memory allocation.</p>
<p>On all Fedora / CentOS memcached packages, the configuration file is stored in /etc/sysconfig/memcached.  By default, it looks like this:</p>
<pre>
PORT="11211"
USER="memcached"
MAXCONN="1024"
CACHESIZE="64"
OPTIONS=""
</pre><p>
To increase the memory allocation, adjust the CACHESIZE setting to the number of MB you want memcached to use.</p>
<p>If you are running memcached locally on your web server (and only have one web server), then I <em>strongly recommend</em> you also add an option for memcached to listen only on your loopback interface (localhost).  Whether or not you make that change, please consider locking down the memcached port(s) with a firewall.  In order to listen only on the 127.0.0.1 interface, you can change the OPTIONS line to the following:</p>
<pre>
OPTIONS="-l 127.0.0.1"
</pre><p>
See the memcached man page for more info on that or any other settings.</p>
<p>Once you have installed memcached and updated the configuration, you can start it up and configure it to start on boot:<br /><code><br />
# service memcached start<br />
# chkconfig memcached on<br /></code></p>
<h2>CentOS / RHEL PECL Module Install</h2>
<h3>Fedora</h3>
<p>If you are on Fedora and using PHP from the base repo in the distribution, then installation of the PECL extension is easy.  Just use yum to install whichever PECL extension you choose:<br /><code><br />
# yum install php-pecl-memcache<br /></code><br />
Or<br /><code><br />
# yum install php-pecl-memcached<br /></code></p>
<h3>CentOS 5 / RHEL 5</h3>
<p>CentOS and RHEL can be a bit more complicated, especially on EL5 which ships with PHP 5.1.x, which is too old for most people.  Here are the options I'd suggest for EL5:</p>
<ul><li>If you are OK using the PHP provided with EL5, then you can get the PECL extensions from EPEL.  Once you've enabled the EPEL repository (<a href="http://fedoraproject.org/wiki/EPEL/FAQ#How_can_I_install_the_packages_from_the_EPEL_software_repository.3F">instructions</a>), you can install either PECL extension by using the same yum commands outlined above in the Fedora section.</li>
<li>If you want to use PHP 5.2 or PHP 5.3 with EL5, I suggest using the IUS repositories (<a href="http://iuscommunity.org/Docs/ClientUsageGuide">IUS repo instructions</a>).  Note that IUS provides the PECL memcache extension, but not the PECL memcached extension.  Based on which PHP version you decide to use, you can install the PECL memcache extension with either:<br /><code><br />
# yum install php52-pecl-memcache<br /></code><br />
Or<br /><code><br />
# yum install php53u-pecl-memcache<br /></code>
</li>
</ul><h3> CentOS 6 / RHEL 6</h3>
<p>EL6 ships with PHP 5.3, though it is an older version than is available for EL6 at IUS.  If you are using the OS-provided PHP package, then you can install the PECL memcache extension from the base OS repo.  If you want the PECL memcached extension, it is not in the base OS repo, but is available in EPEL.  See the instructions linked from the CentOS 5 section above if you need to enable the EPEL repo.<br /><code><br />
# yum install php-pecl-memcache<br /></code><br />
Or, enable EPEL and then run:<br /><code><br />
# yum install php-pecl-memcached<br /></code></p>
<p>As with EL5, some people running EL6 will also want the latest PHP packages and can get them from the IUS repositories.  If you are running PHP from IUS under EL6, then you can install the PECL memcache extension with:<br /><code><br />
# yum install php53u-pecl-memcache<br /></code><br />
Similar to EL5, the IUS repo for EL6 does not include the PECL memcached module.</p>
<h2>PECL Memcache Configuration</h2>
<p>If you are using PECL memcache extension and will be using the clustering option of the Drupal Memcache module which utilizes multiple memcached instances, then it is important to set the hash strategy to "consistent" in the memcache extension configuration.  Edit /etc/php.d/memcache.ini and set (or un-comment) the following line:</p>
<pre>
memcache.hash_strategy=consistent
</pre><p>
If you are using the PECL memcached module, this configuration is done at the application level (e.g. in your Drupal settings.php).</p>
<p>Once you've installed the PECL memcache (or memcached) extension, you will need to reload httpd in order for PHP to see the new extension. You'll also need to reload httpd whenever you change the memcache.ini configuration file.<br /><code><br />
# service httpd reload<br /></code></p>
<h2>SELinux</h2>
<p>If you have SELinux enabled (you should!), I have an older blog post with <a href="http://sheltren.com/stop-disabling-selinux">instructions on configuring SELinux for Drupal</a>.</p>
<p>That's it, you're now good to go with PHP and memcache!</p>
</div></div></div><div class="field field-name-field-tags field-type-taxonomy-term-reference field-label-above clearfix"><h3 class="field-label">Tags: </h3><ul class="links"><li class="taxonomy-term-reference-0" rel="dc:subject"><a href="http://sheltren.com/tags/oss" typeof="skos:Concept" property="rdfs:label skos:prefLabel">oss</a></li><li class="taxonomy-term-reference-1" rel="dc:subject"><a href="http://sheltren.com/taxonomy/term/3" typeof="skos:Concept" property="rdfs:label skos:prefLabel">fedora</a></li><li class="taxonomy-term-reference-2" rel="dc:subject"><a href="http://sheltren.com/taxonomy/term/4" typeof="skos:Concept" property="rdfs:label skos:prefLabel">centos</a></li><li class="taxonomy-term-reference-3" rel="dc:subject"><a href="http://sheltren.com/taxonomy/term/5" typeof="skos:Concept" property="rdfs:label skos:prefLabel">memcache</a></li><li class="taxonomy-term-reference-4" rel="dc:subject"><a href="http://sheltren.com/taxonomy/term/6" typeof="skos:Concept" property="rdfs:label skos:prefLabel">drupal</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://blogs.osuosl.org/blog/2012/04/26/memcached-and-pecl-memcache-on-centos-and-fedora/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>cfengine 3.3.0 packages for Fedora / CentOS / RHEL</title>
		<link>http://sheltren.com/cfengine-3.3.0</link>
		<comments>http://sheltren.com/cfengine-3.3.0#comments</comments>
		<pubDate>Thu, 26 Apr 2012 16:06:50 +0000</pubDate>
		<dc:creator>jeff</dc:creator>
				<category><![CDATA[OSL Planet]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[As I've used cfengine less and less recently the packages in Fedora and EPEL have been a bit neglected.  At one point someone stepped up to update them, but then nothing ever came of it.  I've finally updated the packages to the latest upstream version...]]></description>
			<content:encoded><![CDATA[<div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even" property="content:encoded"><p>As I've used cfengine less and less recently the packages in Fedora and EPEL have been a bit neglected.  At one point someone stepped up to update them, but then nothing ever came of it.  I've finally updated the packages to the latest upstream version as of this writing (3.3.0) in Fedora 16, Fedora 17, Fedora Devel, and EPEL 6.  They should be pushed to the updates-testing repos for each of those releases soon if not already there.  There are some package changes since the last 3.x release, so any testing people can do would be appreciated.</p>
<p>I've uploaded EL6 and F17 RPMs here for reference: <a href="http://sheltren.com/downloads/cfengine/testing/">http://sheltren.com/downloads/cfengine/testing/</a></p>
<p>Note that these are quite different from the upstream-provided RPMs which simply dump everything in /var/cfengine.  The good news here is I've actually provided a source RPM for those that need to tweak the build.  Also, I hit some configure errors when attempting to build on EL5 which I haven't worked out yet -- looks like an upstream bug with the configure script to me, so there are no EL5 packages at the moment.</p>
<p>If anyone is willing to co-maintain these in Fedora and/or EPEL with me, please let me know.</p>
</div></div></div><div class="field field-name-field-tags field-type-taxonomy-term-reference field-label-above clearfix"><h3 class="field-label">Tags: </h3><ul class="links"><li class="taxonomy-term-reference-0" rel="dc:subject"><a href="http://sheltren.com/taxonomy/term/2" typeof="skos:Concept" property="rdfs:label skos:prefLabel">cfengine</a></li><li class="taxonomy-term-reference-1" rel="dc:subject"><a href="http://sheltren.com/tags/oss" typeof="skos:Concept" property="rdfs:label skos:prefLabel">oss</a></li><li class="taxonomy-term-reference-2" rel="dc:subject"><a href="http://sheltren.com/taxonomy/term/3" typeof="skos:Concept" property="rdfs:label skos:prefLabel">fedora</a></li><li class="taxonomy-term-reference-3" rel="dc:subject"><a href="http://sheltren.com/taxonomy/term/4" typeof="skos:Concept" property="rdfs:label skos:prefLabel">centos</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://blogs.osuosl.org/blog/2012/04/26/cfengine-3-3-0-packages-for-fedora-centos-rhel-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>cfengine 3.3.0 packages for Fedora / CentOS / RHEL</title>
		<link>http://sheltren.com/cfengine-3.3.0</link>
		<comments>http://sheltren.com/cfengine-3.3.0#comments</comments>
		<pubDate>Thu, 26 Apr 2012 16:06:50 +0000</pubDate>
		<dc:creator>jeff</dc:creator>
				<category><![CDATA[OSL Planet]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[As I've used cfengine less and less recently the packages in Fedora and EPEL have been a bit neglected.  At one point someone stepped up to update them, but then nothing ever came of it.  I've finally updated the packages to the latest upstream version...]]></description>
			<content:encoded><![CDATA[<div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even" property="content:encoded"><p>As I've used cfengine less and less recently the packages in Fedora and EPEL have been a bit neglected.  At one point someone stepped up to update them, but then nothing ever came of it.  I've finally updated the packages to the latest upstream version as of this writing (3.3.0) in Fedora 16, Fedora 17, Fedora Devel, and EPEL 6.  They should be pushed to the updates-testing repos for each of those releases soon if not already there.  There are some package changes since the last 3.x release, so any testing people can do would be appreciated.</p>
<p>I've uploaded EL6 and F17 RPMs here for reference: <a href="http://sheltren.com/downloads/cfengine/testing/">http://sheltren.com/downloads/cfengine/testing/</a></p>
<p>Note that these are quite different from the upstream-provided RPMs which simply dump everything in /var/cfengine.  The good news here is I've actually provided a source RPM for those that need to tweak the build.  Also, I hit some configure errors when attempting to build on EL5 which I haven't worked out yet -- looks like an upstream bug with the configure script to me, so there are no EL5 packages at the moment.</p>
<p>If anyone is willing to co-maintain these in Fedora and/or EPEL with me, please let me know.</p>
</div></div></div><div class="field field-name-field-tags field-type-taxonomy-term-reference field-label-above clearfix"><h3 class="field-label">Tags: </h3><ul class="links"><li class="taxonomy-term-reference-0" rel="dc:subject"><a href="http://sheltren.com/taxonomy/term/2" typeof="skos:Concept" property="rdfs:label skos:prefLabel">cfengine</a></li><li class="taxonomy-term-reference-1" rel="dc:subject"><a href="http://sheltren.com/tags/oss" typeof="skos:Concept" property="rdfs:label skos:prefLabel">oss</a></li><li class="taxonomy-term-reference-2" rel="dc:subject"><a href="http://sheltren.com/taxonomy/term/3" typeof="skos:Concept" property="rdfs:label skos:prefLabel">fedora</a></li><li class="taxonomy-term-reference-3" rel="dc:subject"><a href="http://sheltren.com/taxonomy/term/4" typeof="skos:Concept" property="rdfs:label skos:prefLabel">centos</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://blogs.osuosl.org/blog/2012/04/26/cfengine-3-3-0-packages-for-fedora-centos-rhel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Stop Disabling SELinux!</title>
		<link>http://sheltren.com/stop-disabling-selinux</link>
		<comments>http://sheltren.com/stop-disabling-selinux#comments</comments>
		<pubDate>Wed, 21 Dec 2011 23:36:15 +0000</pubDate>
		<dc:creator>jeff</dc:creator>
				<category><![CDATA[OSL Planet]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[I see a lot of people coming by #centos and similar channels asking for help when they’re experiencing a problem with their Linux system.  It amazes me how many people describe their problem, and then say something along the lines of, “and I disabl...]]></description>
			<content:encoded><![CDATA[<div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even" property="content:encoded"><p>I see a lot of people coming by #centos and similar channels asking for help when they’re experiencing a problem with their Linux system.  It amazes me how many people describe their problem, and then say something along the lines of, “and I disabled SELinux...”.  Most of the time SELinux has nothing to do with the problem, and if SELinux is the cause of the problem, why would you throw out the extra security by disabling it completely rather than configuring it to work with your application?  This may have made sense in the Fedora 3 days when selinux settings and tools weren’t quite as fleshed out, but the tools and the default SELinux policy have come a long way since then, and it’s very worthwhile to spend a little time to understand how to configure SELinux instead of reflexively disabling it.  In this post, I’m going to describe some useful tools for SELinux and walk through how to configure SELinux to work when setting up a Drupal web site using a local memcached server and a remote MySQL database server -- a pretty common setup for sites which receive a fair amount of traffic.</p>
<p>This is by no means a comprehensive guide to SELinux; there are many of those already!<br /><a href="http://wiki.centos.org/HowTos/SELinux">http://wiki.centos.org/HowTos/SELinux</a><br /><a href="http://fedoraproject.org/wiki/SELinux/Understanding">http://fedoraproject.org/wiki/SELinux/Understanding</a><br /><a href="http://fedoraproject.org/wiki/SELinux/Troubleshooting">http://fedoraproject.org/wiki/SELinux/Troubleshooting</a></p>
<h3>Too Long; Didn’t Read Version</h3>
<p>If you’re in a hurry to figure out how to configure SELinux for this particular type of setup, on CentOS 6, you should be able to use the following two commands to get things working with SELinux:<br /><code># setsebool -P httpd_can_network_connect_db 1<br />
# setsebool -P httpd_can_network_memcache 1<br /></code></p>
<p>Note that if you have files existing somewhere on your server and you move them to the webroot rather than untar them there directly, you may end up with SELinux file contexts set incorrectly on them which will likely deny access to apache to read those files.  If you are having a related problem, you’ll see something like this in your /var/log/audit/audit.log:<br /><code>type=AVC msg=audit(1324359816.779:66): avc:  denied  { getattr } for  pid=3872 comm="httpd" path="/var/www/html/index.php" dev=dm-0 ino=549169 scontext=root:system_r:httpd_t:s0 tcontext=root:object_r:user_home_t:s0 tclass=file<br /></code></p>
<p>You can solve this by resetting the webroot to its default file context using the restorecon command:<br /><code># restorecon -rv /var/www/html<br /></code></p>
<h3>Server Overview</h3>
<p>I’m going to start with a CentOS 6 system configured with SELinux in targeted mode, which is the default configuration.  I’m going to be using httpd, memcached, and PHP from the CentOS base repos, though the configuration wouldn’t change if you were to use the IUS PHP packages.  MySQL will be running on a remote server which gives improved performance, but means a bit of additional SELinux configuration to allow httpd to talk to a remote MySQL server.  I’ll be using Drupal 7 in this example, though this should apply to Drupal 6 as well without any changes.</p>
<h3>Initial Setup</h3>
<p>Here we will setup some prerequisites for the website.  If you already have a website setup you can skip this section.</p>
<p>We will be using tools such as audit2allow which is part of the policycoreutils-python package.  I believe this is typically installed by default, but if you did a minimal install you may not have it.<br /><code># yum install policycoreutils-python<br /></code></p>
<p>Install the needed apache httpd, php, and memcached packages:<br /><code># yum install php php-pecl-apc php-mbstring php-mysql php-pecl-memcache php-gd php-xml httpd memcached<br /></code></p>
<p>Startup memcached.  The CentOS 6 default configuration for memcached only listens on 127.0.0.1, this is great for our testing purposes.  The default of 64M of RAM may not be enough for a production server, but for this test it will be plenty. We’ll just start up the service without changing any configuration values:<br /><code># service memcached start<br /></code></p>
<p>Startup httpd.  You may have already configured apache for your needs, if not, the default config should be enough for the site we’ll be testing.<br /><code># service httpd start<br /></code><br />
If you are using a firewall, then you need to allow at least port 80 through so that you can access the website -- I won’t get into that configuration here.</p>
<p>Install Drupal.  I’ll be using the latest Drupal 7 version (7.9 as of this writing).  Direct link: <a href="http://ftp.drupal.org/files/projects/drupal-7.9.tar.gz">http://ftp.drupal.org/files/projects/drupal-7.9.tar.gz</a><br />
Download the tarball, and expand it to the apache web root.  I also use the --strip-components=1 argument to strip off the top level directory, otherwise it would expand into /var/www/html/drupal-7.9/<br /><code># tar zxf drupal-7.9.tar.gz -C /var/www/html --strip-components=1<br /></code><br />
Also, we need to get the Drupal site ready for install by creating a settings.php file writable by apache, and also create a default files directory which apache can write to.<br /><code># cd /var/www/html/sites/default/<br />
# cp default.settings.php settings.php<br />
# chgrp apache settings.php &amp;&amp; chmod 660 settings.php<br />
# install -d -m 775 -g apache files<br /></code></p>
<p>Setup a database and database user on your MySQL server for Drupal.  This would be something like this:<br /><code>mysql&gt; CREATE DATABASE drupal;<br />
mysql&gt; GRANT ALL ON drupal.* TO drupal_rw@web-server-ip-here IDENTIFIED BY 'somepassword';<br /></code></p>
<p>Test this out by using the mysql command line tool on the web host.<br /><code># mysql -u drupal_rw -p -h <your-db-hostname-or-ip-here> drupal<br /></your-db-hostname-or-ip-here></code></p>
<p>That should connect you to the remote MySQL server.  Be sure that is working before you proceed.</p>
<h3>Now for the Fun Stuff</h3>
<p>If you visit your new Drupal site at <a href="http://your-hostname-here">http://your-hostname-here</a>, you’ll be presented with the Drupal installation page.  Click ahead a few times, setup your DB info on the Database Configuration page -- you need to expand “Advanced Options” to get to the hostname field since it assumes localhost.  When you click the button to proceed, you’ll probably get an unexpected error that it can’t connect to your database -- this is SELinux doing its best to protect you!</p>
<h3>Allowing httpd to Connect to a Remote Database</h3>
<p>So what just happened?  We know the database was setup properly to allow access from the remote web host, but Drupal is complaining that it can’t connect.  First, you can look in /var/log/audit/audit.log which is where SELinux will log access denials.  If you grep for ‘httpd’ in the log, you’ll see something like the following:<br /><code># grep httpd /var/log/audit/audit.log<br />
type=AVC msg=audit(1322708342.967:16804): avc:  denied  { name_connect } for  pid=2724 comm="httpd" dest=3306 scontext=unconfined_u:system_r:httpd_t:s0 tcontext=system_u:object_r:mysqld_port_t:s0 tclass=tcp_socket<br /></code></p>
<p>That is telling you, in SELinux giberish language, that the httpd process was denied access to connect to a remote MySQL port.  For a better explanation of the denial and some potential fixes, we can use the ‘audit2why’ utility:<br /><code># grep httpd /var/log/audit/audit.log | audit2why<br />
type=AVC msg=audit(1322708342.967:16804): avc:  denied  { name_connect } for  pid=2724 comm="httpd" dest=3306 scontext=unconfined_u:system_r:httpd_t:s0 tcontext=system_u:object_r:mysqld_port_t:s0 tclass=tcp_socket</code></p>
<p>	Was caused by:<br />
	One of the following booleans was set incorrectly.<br />
	Description:<br />
	Allow HTTPD scripts and modules to connect to the network using TCP.</p>
<p>	Allow access by executing:<br />
	# setsebool -P httpd_can_network_connect 1<br />
	Description:<br />
	Allow HTTPD scripts and modules to connect to databases over the network.</p>
<p>	Allow access by executing:<br />
	# setsebool -P httpd_can_network_connect_db 1<br /></p>
<p>audit2why will analyze the denial message you give it and potentially explain ways to correct it if it is something you would like to allow.  In this case, there are two built in SELinux boolean settings that could be enabled for this to work.  One of them, httpd_can_network_connect, will allow httpd to connect to anything on the network.  This might be useful in some cases, but is not very specific.  The better option in this case is to enable httpd_can_network_connect_db which limits httpd generated network connections to only database traffic.  Run the following command to enable that setting:<br /><code># setsebool -P httpd_can_network_connect_db 1<br /></code></p>
<p>It will take a few seconds and not output anything.  Once that completes, go back to the Drupal install page, verify the database connection info, and click on the button to continue.  Now it should connect to the database successfully and proceed through the installation.  Once it finishes, you can disable apache write access to the settings.php file:<br /><code># chmod 640 /var/www/html/sites/default/settings.php<br /></code><br />
Then fill out the rest of the information to complete the installation.</p>
<h3>Allowing httpd to connect to a memcached server</h3>
<p>Now we want to setup Drupal to use memcached instead of storing cache information in MySQL.  You’ll need to download and install the Drupal memcache module available here: <a href="http://drupal.org/project/memcache">http://drupal.org/project/memcache</a><br />
Install that into your Drupal installation, and add the appropriate entries into settings.php.  For this site, I did that with the following:<br /><code># mkdir /var/www/html/sites/default/modules<br />
# tar zxf memcache-7.x-1.0-rc2.tar.gz -C /var/www/html/sites/default/modules<br /></code></p>
<p>Then edit settings.php and add the following two lines:<br /><code>$conf['cache_backends'][] = 'sites/default/modules/memcache/memcache.inc';<br />
$conf['cache_default_class'] = 'MemCacheDrupal';<br /></code></p>
<p>Now if you reload your site in your web browser, you’ll likely see a bunch of memcache errors -- just what you wanted!  I bet it’s SELinux at it again!  Check out /var/log/audit/audit.log again and you’ll see something like:<br /><code>type=AVC msg=audit(1322710172.987:16882): avc:  denied  { name_connect } for  pid=2721 comm="httpd" dest=11211 scontext=unconfined_u:system_r:httpd_t:s0 tcontext=system_u:object_r:memcache_port_t:s0 tclass=tcp_socket<br /></code></p>
<p>That’s very similar to the last message, but this one is for a memcache port.  What does audit2why have to say?<br /><code># grep -m 1 memcache /var/log/audit/audit.log | audit2why<br />
type=AVC msg=audit(1322710172.796:16830): avc:  denied  { name_connect } for  pid=2721 comm="httpd" dest=11211 scontext=unconfined_u:system_r:httpd_t:s0 tcontext=system_u:object_r:memcache_port_t:s0 tclass=tcp_socket</code></p>
<p>	Was caused by:<br />
	One of the following booleans was set incorrectly.<br />
	Description:<br />
	Allow httpd to act as a relay</p>
<p>	Allow access by executing:<br />
	# setsebool -P httpd_can_network_relay 1<br />
	Description:<br />
	Allow httpd to connect to memcache server</p>
<p>	Allow access by executing:<br />
	# setsebool -P httpd_can_network_memcache 1<br />
	Description:<br />
	Allow HTTPD scripts and modules to connect to the network using TCP.</p>
<p>	Allow access by executing:<br />
	# setsebool -P httpd_can_network_connect 1<br /></p>
<p>Again, audit2why gives us a number of options to fix this.  The best bet is to go with the smallest and most presice change for our needs.  In this case there’s another perfect fit: httpd_can_network_memcache.  Enable that boolean with the following command:<br /><code># setsebool -P httpd_can_network_memcache 1<br /></code></p>
<p>Success!  Now httpd can talk to memcache.  Reload your site a couple of times and you should no longer see any memcache errors.  You can be sure that Drupal is caching in memcache by connecting to the memcache CLI (telnet localhost 11211) and typing ‘stats’.  You should see some number greater than 0 for ‘get_hits’ and for ‘bytes’.</p>
<h3>What are all these booleans anyway?</h3>
<p>Now we’ve used a couple SELinux booleans to allow httpd to connect to memcached and MySQL.  You can see a full list of booleans which you can control by using the command ‘getsebool -a’.  They are basically a preset way for you to allow/deny certain pre-defined access controls.</p>
<h3>Restoring default file contexts</h3>
<p>As I mentioned briefly in the ‘TL;DR’ section, another common problem people experience is with file contexts.  If you follow my instructions exactly, you won’t have this problem because we untar the Drupal files directly into the webroot, so they will inherit the default file context for /var/www/html.  If, however, you were to untar the files in your home directory, and then use ‘mv’ or ‘cp’ to place them in /var/www/html, they will maintain the user_home_t context which apache won’t be able to read by default.  If this is happening to you, you will see the file denials logged in /var/log/audit/audit.log -- something like this:<br /><code>type=AVC msg=audit(1324359816.779:66): avc:  denied  { getattr } for  pid=3872 comm="httpd" path="/var/www/html/index.php" dev=dm-0 ino=549169 scontext=root:system_r:httpd_t:s0 tcontext=root:object_r:user_home_t:s0 tclass=file<br /></code></p>
<p>The solution in this case is to use restorecon to reset the file contexts back to normal:<br /><code># restorecon -rv /var/www/html<br /></code></p>
<p><strong>Update:</strong> It was noted that I should also mention another tool for debugging audit messages, 'sealert'.  This is provided in the setroubleshoot-server package and will also read in the audit log, similar to what I described with audit2why.<br /><code># sealert -a /var/log/audit/audit.log</code></p>
</div></div></div><div class="field field-name-field-tags field-type-taxonomy-term-reference field-label-above clearfix"><h3 class="field-label">Tags: </h3><ul class="links"><li class="taxonomy-term-reference-0" rel="dc:subject"><a href="http://sheltren.com/tags/oss" typeof="skos:Concept" property="rdfs:label skos:prefLabel">oss</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://blogs.osuosl.org/blog/2011/12/21/stop-disabling-selinux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CentOS Continuous Release</title>
		<link>http://sheltren.com/centos-cr</link>
		<comments>http://sheltren.com/centos-cr#comments</comments>
		<pubDate>Tue, 08 Nov 2011 16:03:35 +0000</pubDate>
		<dc:creator>jeff</dc:creator>
				<category><![CDATA[OSL Planet]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[The CentOS Continuous Release repository (“CR”) was first introduced for CentOS 5.6, and currently exists for both CentOS 5 and CentOS 6.  The CR repo is intended to provide package updates which have been released for the next point release upstre...]]></description>
			<content:encoded><![CDATA[<div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even" property="content:encoded"><p>The CentOS Continuous Release repository (“CR”) was first introduced for CentOS 5.6, and currently exists for both CentOS 5 and CentOS 6.  The CR repo is intended to provide package updates which have been released for the next point release upstream (from RHEL) which has not yet been officially released by CentOS yet due to delays around building, testing, and seeding mirrors for a new point release.  For example, this means that once RedHat releases RHEL 5.8, CentOS will include package updates from 5.8 base and updates in CentOS 5.7 CR repo until the time that CentOS is able to complete the release of CentOS 5.8.  For admins, this means less time without important security updates and the ability to be on the latest packages released in the latest RHEL point release.</p>
<h2>Details on the CR Repo</h2>
<p>What’s included in CR and how might it affect your current CentOS installs?  At this point, the CR repo is used <em>only</em> for package updates which are part of the next upstream point release.  For example, for CentOS 5.7, once Red Hat releases RHEL 5.8, the CR repo will contain updates from upstream base and updates repos.  When a new update for RHEL 5.8 is released, it will be built in the CentOS build system, go through a relatively minimal amount of QA by the CentOS QA team, and then will be pushed to the CentOS 5.7 CR repo.  This process will continue until the time that CentOS releases its own 5.8 release.  Once CentOS releases 5.8, the CR repo will be cleared out until the time that RedHat releases the next (5.9) point release.</p>
<p>The CR repo is not enabled by default, so it is up to a system administrator to enable it if desired.  That means, by default, you won’t see packages added to the CR repo.  Installing the repo is very easy as it’s now part of the CentOS extras repository which is enabled by default.  To enable CR, you simply have to:</p>
<pre>
yum install centos-release-cr
</pre><p>
If you don’t have CentOS Extras enabled, you can browse into the extras/ directory for the release of CentOS you’re currently running and download and install the centos-release-cr package by hand, or manually create a centos-cr.repo in /etc/yum.repos.d/</p>
<p>In my opinion, unless you have an internal process for testing/pushing updates, <b>you should absolutely be using the CR repo</b>.  Even if you do have your own local processes for updates, I would consider the CR repo to be part of CentOS updates for all intents and purposes, and pull your updates from there for testing/release.  The packages in the CR repo can fix known security issues which without the CR repo you won’t have access to until the next CentOS point release -- and that can sometimes take longer than we’d like!</p>
<h2>A New Proposal: Include CR by Default</h2>
<p>In a <a href="http://lists.centos.org/pipermail/centos-devel/2011-November/008268.html">recent post to the CentOS Developers list</a>, Karanbir Singh proposed moving the CR repo into the main release for 6.x.  What this would mean is for CentOS 6.x and onward, we would see the base OS and ISO directories be updated for each point release, but in general, updates would be pushed to a central <em>6/</em> directory, basically incorporating CR into what is currently considered <em>updates/</em>.</p>
<p>This proposal is different from the current CR setup in that it incorporates CR into the release by default, and puts less reliance on the old point release model.  This will help ensure that people are always running the latest security updates as well as take a bit of pressure off of CentOS developers and QA team when trying to build, test, and release the next point release.  If the package updates are already released and in use, point releases become less important (though still useful for new installs).</p>
<p>Incorporating CR more into the main release doesn’t mean that point releases will go away completely.  They will still include updated base packages and ISO images, typically with installer bug fixes and/or new and updated drivers.  In general, I see this as a good move:  it means more people will be getting security updates by default instead of waiting during the time lapse between upstream RHEL releases and the time it takes for CentOS to rebuild, test, and release that point release.  Having those packages available by default is great, especially for those admins who don’t pay close attention and wouldn’t otherwise enable the CR repo.  It should be noted that at this point, the incorporation of CR into the main release is only being discussed for CentOS 6.x onward and won’t change anything in the 5.x releases where people will still need to manually opt-in to the CR packages.</p>
<p>References:<br /><a href="http://wiki.centos.org/AdditionalResources/Repositories/CR">http://wiki.centos.org/AdditionalResources/Repositories/CR</a><br /><a href="http://lists.centos.org/mailman/listinfo/centos-cr-announce">http://lists.centos.org/mailman/listinfo/centos-cr-announce</a><br /><a href="http://lists.centos.org/pipermail/centos-devel/2011-November/008268.html">http://lists.centos.org/pipermail/centos-devel/2011-November/008268.html</a></p>
</div></div></div><div class="field field-name-field-tags field-type-taxonomy-term-reference field-label-above clearfix"><h3 class="field-label">Tags: </h3><ul class="links"><li class="taxonomy-term-reference-0" rel="dc:subject"><a href="http://sheltren.com/tags/oss" typeof="skos:Concept" property="rdfs:label skos:prefLabel">oss</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://blogs.osuosl.org/blog/2011/11/08/centos-continuous-release/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New Site</title>
		<link>http://sheltren.com/node/1</link>
		<comments>http://sheltren.com/node/1#comments</comments>
		<pubDate>Wed, 02 Nov 2011 18:10:27 +0000</pubDate>
		<dc:creator>jeff</dc:creator>
				<category><![CDATA[OSL Planet]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Updating the site and ended up dropping the old stories, at least for now...
]]></description>
			<content:encoded><![CDATA[<div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even" property="content:encoded"><p>Updating the site and ended up dropping the old stories, at least for now...</p>
</div></div></div>]]></content:encoded>
			<wfw:commentRss>http://blogs.osuosl.org/blog/2011/11/02/new-site/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Open Government Communities Survey; Be Counted</title>
		<link>http://www.bryantsblog.com/?p=1318</link>
		<comments>http://www.bryantsblog.com/?p=1318#comments</comments>
		<pubDate>Wed, 14 Sep 2011 16:13:04 +0000</pubDate>
		<dc:creator>Deborah Bryant</dc:creator>
				<category><![CDATA[citizen participation]]></category>
		<category><![CDATA[Communities]]></category>
		<category><![CDATA[open data]]></category>
		<category><![CDATA[open gov]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[OSL Planet]]></category>
		<category><![CDATA[Public Sector]]></category>
		<category><![CDATA[survey]]></category>
		<category><![CDATA[transparancy]]></category>

		<guid isPermaLink="false">http://www.bryantsblog.com/?p=1318</guid>
		<description><![CDATA[If you&#8217;re involved in Open Government, I encourage you to participate in this first informal open government communities survey. The objective of the short survey is to create a view of the broad community of constituents that comprise the open government movement, with a special interest in understanding the interplay and influence of open source [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re involved in Open Government, I encourage you to participate in this first informal <a href="http://www.bryantsblog.com/?page_id=1294" >open government communities survey</a>. The objective of the short survey is to create a view of the broad community of constituents that comprise the open government movement, with a special interest in understanding the interplay and influence of open source software and the open source community in forwarding their objectives.</p>
<p>The first set of responses collected by September 18th will travel to Northern Ireland for my presentation at the OpenGov Conference in Belfast on September 22nd, 2011. Results of the survey will be shared this fall on the Government Open Source Conference web site (goscon.org). Any questions? email <a href="mail:bryant.deb@gmail.com">me</a>.</p>
<p>Thanks in advance or your participation!</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fwww.bryantsblog.com%2F%3Fp%3D1318';
  addthis_title  = 'Open+Government+Communities+Survey%3B+Be+Counted';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://www.bryantsblog.com/?feed=rss2&#038;p=1318</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
