<?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>ReadyState4 &#187; memcached</title>
	<atom:link href="http://readystate4.com/category/memcached/feed/" rel="self" type="application/rss+xml" />
	<link>http://readystate4.com</link>
	<description>JavaScript, Web Development, Ruby, and Technology.</description>
	<lastBuildDate>Fri, 04 Jun 2010 19:42:44 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Installing memcached on OS X 10.5.4 Leopard</title>
		<link>http://readystate4.com/2008/08/19/installing-memcached-on-os-x-1054-leopard/</link>
		<comments>http://readystate4.com/2008/08/19/installing-memcached-on-os-x-1054-leopard/#comments</comments>
		<pubDate>Tue, 19 Aug 2008 22:42:09 +0000</pubDate>
		<dc:creator>Mauvis</dc:creator>
				<category><![CDATA[memcached]]></category>

		<guid isPermaLink="false">http://readystate4.com/2008/08/19/installing-memcached-on-os-x-1054-leopard/</guid>
		<description><![CDATA[I used the guide here to install Memcached on my Macbook Pro, but seeing how it was written over 3 years old I decided to write an updated version for installing on OSX Leopard. Here goes:
Beforehand: You need to install Xcode 3.0 Developer Tools. If you don&#8217;t have it installed it&#8217;s on the Leopard Install [...]]]></description>
			<content:encoded><![CDATA[<p>I used the guide <a href="http://www.petercooper.co.uk/archives/000693.html" title="Installing memcached on OS X 10.4 Tiger">here</a> to install Memcached on my Macbook Pro, but seeing how it was written over 3 years old I decided to write an updated version for installing on OSX Leopard. Here goes:</p>
<p>Beforehand: You need to install Xcode 3.0 Developer Tools. If you don&#8217;t have it installed it&#8217;s on the Leopard Install CD that came with your Mac. You also have to install the X11 windowing environment on the same disc.</p>
<ol>
<li>If you don&#8217;t have it already, download Macports:<br />
<a href="http://www.macports.org/install.php">http://www.macports.org/install.php</a></p>
<p>Here&#8217;s the Leopard universal binary direct link:<br />
<a href="http://svn.macports.org/repository/macports/downloads/MacPorts-1.6.0/MacPorts-1.6.0-10.5-Leopard.dmg">http://svn.macports.org/repository/macports/downloads/MacPorts-1.6.0/MacPorts-1.6.0-10.5-Leopard.dmg</a> (416kb)</li>
<li>Macports will install itself to <code>/opt/local/bin</code> but on my machine I didn&#8217;t have a PATH variable set there so if you type &#8220;port&#8221; in your terminal and don&#8217;t get anything either, continue following this step, else just continue on to the next one.
<p>Open up terminal and type: </p>
<pre>nano .bash_profile (return key)</pre>
<p>Find the first unused line and type:</p>
<pre>PATH=$PATH:/opt/local/bin</pre>
<p>To save your changes press <code>ctrl-o</code> (return key) and <code>ctrl-x</code> to quit.<br />
Refresh your profile by typing: </p>
<pre>. .bash_profile</pre>
</li>
<li>To test that your Macports is working (and to update to the newest version):
<pre>sudo port -v selfupdate</pre>
</li>
<li>Install libevent. It&#8217;s a dependency of memcached:
<pre>sudo port install libevent</pre>
</li>
<li>Install memcached:
<pre>sudo port install memcached</pre>
</li>
<li>Set an environment variable to stop libevent using kqueue (should force it to use select, which is slower, but actually works). I have no idea what this does, just following the original guide, but it&#8217;s related to <a href="http://blog.segment7.net/articles/2006/03/02/fast-memcached-on-os-x">making memcached faster</a> :
<p>Open up terminal and type: </p>
<pre>nano .bash_profile (return key)</pre>
<p>Find the first unused line and type: </p>
<pre>EVENT_NOKQUEUE=yes</pre>
<p>To save your changes press <code>ctrl-o</code> (return key) and <code>ctrl-x</code> to quit.<br />
Refresh your profile by typing: </p>
<pre>. .bash_profile</pre>
</li>
<li>Run memcached (this gives it 24MB of memory max, and puts it on port 11211 &#8211; note that specifying a hostname will not work on OS X):
<pre>memcached -d -m 24 -p 11211</pre>
</li>
<li>Telnet to your memcache to make sure it&#8217;s working:
<pre>telnet localhost 11211</pre>
<p>If you see &#8220;Connected to localhost&#8221;, you&#8217;re connected.</p>
<p>Type <code>quit</code> to close the connection and try reconnecting again to make sure you did step 6 properly.</p>
<p>You&#8217;re done!</li>
</ol>
<p>To stop memcached, type this in your console:</p>
<pre>killall memcached</pre>
<p>To start memcached in verbose mode (so it outputs what it&#8217;s doing) add <code>-vv</code> to the startup script.</p>
<p>Feel free to create a bash script to startup memcached with your right settings, mine looks like this:</p>
<pre style="margin-bottom: 15px;">
#!/usr/bin/env bash

memcached -d -m 24 -p 11211
echo "memcached started..."
</pre>
<p><strong>Related links:</strong><br />
<a href="http://www.petercooper.co.uk/archives/000693.html">Installing memcached on OS X 10.4 Tiger</a><br />
<a href="http://www.macports.org/install.php">Installing Macports</a><br />
<a href="http://www.danga.com/memcached/">Memcached homepage</a></p>
<p><strong>Further reading:</strong><br />
<a href="http://www.lullabot.com/articles/setup-memcached-mamp-sandbox-environment">Setup a Memcached-Enabled MAMP Sandbox Environment</a><br />
<a href="http://www.rubynaut.net/articles/2008/02/12/install-ruby-memcached-on-macosx">Install ruby memcached on MacOSX</a></p>
]]></content:encoded>
			<wfw:commentRss>http://readystate4.com/2008/08/19/installing-memcached-on-os-x-1054-leopard/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
