<?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>[blog.rayfoo] &#187; HOWTO</title>
	<atom:link href="http://blog.rayfoo.info/tag/howto/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.rayfoo.info</link>
	<description>Infosec, DFIR, tech geekery, thoughts and whatnot</description>
	<lastBuildDate>Wed, 25 Jan 2012 00:36:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Getting the Samsung Galaxy S to work with Android SDK on Ubuntu</title>
		<link>http://blog.rayfoo.info/2010/10/getting-the-samsung-galaxy-s-to-work-with-android-sdk-on-ubuntu</link>
		<comments>http://blog.rayfoo.info/2010/10/getting-the-samsung-galaxy-s-to-work-with-android-sdk-on-ubuntu#comments</comments>
		<pubDate>Sat, 02 Oct 2010 18:48:41 +0000</pubDate>
		<dc:creator>ray</dc:creator>
				<category><![CDATA[Everything]]></category>
		<category><![CDATA[adb]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[HOWTO]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[SDK]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://blog.rayfoo.info/?p=744</guid>
		<description><![CDATA[Just an info dump here. To get the Samsung Galaxy S working with the Android SDK in Ubuntu, some setup is needed, else you'll be getting errors like this: I did these on a Ubuntu Lucid Lynx, but this should work for other versions/distro of Linux too I think. 1) Change to root 2) Create [...]]]></description>
			<content:encoded><![CDATA[<p>Just an info dump here.</p>
<p>To get the Samsung Galaxy S working with the Android SDK in Ubuntu, some setup is needed, else you'll be getting errors like this:</p>
<pre class="brush: bash; title: ; notranslate">? adb devices
List of devices attached
????????????	no permissions</pre>
<p>I did these on a Ubuntu Lucid Lynx, but this should work for other versions/distro of Linux too I think.</p>
<p>1)<br />
Change to root</p>
<pre class="brush: bash; title: ; notranslate">? sudo -</pre>
<p>2)<br />
Create the needed file.  04e8 refers to the Vendor ID for the Samsung manufacturer.</p>
<pre class="brush: bash; title: ; notranslate"># echo 'SUBSYSTEM==&quot;usb&quot;, SYSFS{idVendor}==&quot;04e8&quot;, MODE=&quot;0666&quot;' &amp;gt;&amp;gt; /etc/udev/rules.d/51-android.rules</pre>
<p>3)<br />
Restart the udev service</p>
<pre class="brush: bash; title: ; notranslate"># /etc/init.d/udev restart</pre>
<p>4)<br />
Plug in the phone (make sure debugging mode is already enabled), and run adb as needed</p>
<pre class="brush: bash; title: ; notranslate">? adb devices
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
List of devices attached
[device-id]    device</pre>
<p>Hope this helps whoever needs this. <img src='http://blog.rayfoo.info/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.rayfoo.info/2010/10/getting-the-samsung-galaxy-s-to-work-with-android-sdk-on-ubuntu/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Doing geolocation lookups in command line</title>
		<link>http://blog.rayfoo.info/2010/07/doing-geolocation-lookups-in-command-line</link>
		<comments>http://blog.rayfoo.info/2010/07/doing-geolocation-lookups-in-command-line#comments</comments>
		<pubDate>Thu, 08 Jul 2010 09:41:40 +0000</pubDate>
		<dc:creator>ray</dc:creator>
				<category><![CDATA[Everything]]></category>
		<category><![CDATA[APT]]></category>
		<category><![CDATA[CLI]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[geolocation]]></category>
		<category><![CDATA[HOWTO]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://blog.rayfoo.info/?p=624</guid>
		<description><![CDATA[Did you know that it's possible to do your own geoip lookups from the linux command line? You need to install the geoip-bin package in Ubuntu/Debian's APT system: Then after which, lookups can be done as simply as: Note that the lookups are based on the GeoLite Country database.  For more detailed geoip lookups you [...]]]></description>
			<content:encoded><![CDATA[<p>Did you know that it's possible to do your own geoip lookups from the linux command line?</p>
<p>You need to install the geoip-bin package in Ubuntu/Debian's APT system:</p>
<pre class="brush: bash; title: ; notranslate">sudo apt-get install geoip-bin</pre>
<p>Then after which, lookups can be done as simply as:</p>
<pre class="brush: plain; title: ; notranslate">$ geoiplookup 8.8.8.8
GeoIP Country Edition: US, United States</pre>
<p>Note that the lookups are based on the <a href="http://www.maxmind.com/app/geoip_country">GeoLite Country</a> database.  For more detailed geoip lookups you will need to buy the better databases.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.rayfoo.info/2010/07/doing-geolocation-lookups-in-command-line/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Converting IDNs in Ubuntu</title>
		<link>http://blog.rayfoo.info/2010/07/converting-idns-in-ubuntu</link>
		<comments>http://blog.rayfoo.info/2010/07/converting-idns-in-ubuntu#comments</comments>
		<pubDate>Wed, 07 Jul 2010 15:56:06 +0000</pubDate>
		<dc:creator>ray</dc:creator>
				<category><![CDATA[Everything]]></category>
		<category><![CDATA[APT]]></category>
		<category><![CDATA[CLI]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[DNS]]></category>
		<category><![CDATA[HOWTO]]></category>
		<category><![CDATA[ICANN]]></category>
		<category><![CDATA[IDN]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[punycode]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://blog.rayfoo.info/?p=613</guid>
		<description><![CDATA[With the start of Internationalized domain names (IDNs) it sparked my interest since it requires conversion to punycode in order to continue working with existing DNS systems/applications, which work with ASCII. Taking a search through Ubuntu's APT system, to see whether any IDN related tools are available... There's the idn package!  Which allows encoding of IDNs [...]]]></description>
			<content:encoded><![CDATA[<p>With the start of <a href="http://en.wikipedia.org/wiki/Internationalized_domain_name">Internationalized domain names</a> (<a href="http://www.icann.org/en/topics/idn/">IDNs</a>) it sparked my interest since it requires conversion to <a href="http://en.wikipedia.org/wiki/Punycode">punycode</a> in order to continue working with existing DNS systems/applications, which work with ASCII.</p>
<p>Taking a search through Ubuntu's APT system, to see whether any IDN related tools are available...</p>
<pre class="brush: plain; title: ; notranslate">$ apt-cache search punycode

libidn11 - GNU Libidn library, implementation of IETF IDN specifications
libidn11-dev - Development files for GNU Libidn, an IDN library
idn - Command line and Emacs interface to GNU Libidn
libidn11-java - Java port of the GNU Libidn library, an IDN implementation
libidna-punycode-perl - encodes Unicode string in Punycode</pre>
<p>There's the idn package!  Which allows encoding of IDNs in punycode in the command line...</p>
<p>Doing an install...</p>
<pre class="brush: bash; title: ; notranslate">$ sudo apt-get install idn -y</pre>
<p>And trying it out!</p>
<pre class="brush: plain; title: ; notranslate">$ idn правительство.рф

libidn 1.15
Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Simon Josefsson.
GNU Libidn comes with NO WARRANTY, to the extent permitted by law.
You may redistribute copies of GNU Libidn under the terms of
the GNU Lesser General Public License.  For more information
about these matters, see the file named COPYING.LIB.
xn--80aealotwbjpid2k.xn--p1ai</pre>
<p>And resolving the domain...</p>
<pre class="brush: plain; title: ; notranslate">$ nslookup xn--80aealotwbjpid2k.xn--p1ai

Non-authoritative answer:
Name:	xn--80aealotwbjpid2k.xn--p1ai
Address: 95.173.135.62</pre>
<p>Note that resolving the domain directly results in rubbish!</p>
<pre class="brush: plain; title: ; notranslate">$ nslookup правительство.рф

Non-authoritative answer:
Name:	\208\191\209\128\208\176\208\178\208\184\209\130\208\181\208\187\209\140\209\129\209\130\208\178\208\190.\209\128\209\132
Address: 67.215.65.132</pre>
<p>So, basically from this we understand that applications will need to use the punycode encoded version of the IDN, NOT the original IDN, when resolving.  And there're tools out there already can do that for us.</p>
<p>Since Ubuntu has these <a href="http://packages.ubuntu.com/search?keywords=idn">packages</a>, Debian would also have the corresponding <a href="http://packages.debian.org/search?keywords=idn">packages</a> available too.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.rayfoo.info/2010/07/converting-idns-in-ubuntu/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting additional (IP/network/location) info along with your Splunk searches</title>
		<link>http://blog.rayfoo.info/2010/04/getting-additional-ipnetworklocation-info-along-with-your-splunk-searches</link>
		<comments>http://blog.rayfoo.info/2010/04/getting-additional-ipnetworklocation-info-along-with-your-splunk-searches#comments</comments>
		<pubDate>Mon, 19 Apr 2010 17:57:07 +0000</pubDate>
		<dc:creator>ray</dc:creator>
				<category><![CDATA[Everything]]></category>
		<category><![CDATA[commands]]></category>
		<category><![CDATA[geolocation]]></category>
		<category><![CDATA[HOWTO]]></category>
		<category><![CDATA[log analysis]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[Splunk]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://blog.rayfoo.info/?p=529</guid>
		<description><![CDATA[Chanced upon some of the info by accident (smack at the bottom of one part of the Splunk documentation...), but I can't find it now.  Going to share here anyway Some (or probably most/all) of your searches might involve public IP addresses, and more often than not we would want to have additional info along [...]]]></description>
			<content:encoded><![CDATA[<p>Chanced upon some of the info by accident (smack at the bottom of one part of the <a href="http://www.splunk.com/">Splunk</a> <a href="http://www.splunk.com/base/Documentation">documentation</a>...), but I can't find it now.  Going to share here anyway <img src='http://blog.rayfoo.info/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>Some (or probably most/all) of your searches might involve public IP addresses, and more often than not we would want to have additional info along with the IP address to work with.</p>
<p>Three of the things that we could do in Splunk automatically would be to get IP-location info, or to reverse lookup an IP to a domain, or to lookup a domain to an IP.</p>
<p><span id="more-529"></span></p>
<h1>1. Geolocation</h1>
<p>There're two ways to do geolocating of IPs: using the iplocation command, or to use the MAXMIND app.</p>
<h2>1a. iplocation</h2>
<p>The command iplocation is described as:</p>
<blockquote><p>Finds ips in _raw and looks up the IP location using the hostip.info database. IPs are extracted as ip1, ip2, etc. Cities and Countries are likewise extracted.</p></blockquote>
<p>What we only need to do is to pipe the search to iplocation and let it do the rest!  The lookups are done from the server on the fly, so make sure that the server is able to do whois/ns lookups on the network.</p>
<p style="text-align: center;"><span style="color: #339966;">index=myindex | iplocation</span></p>
<p><a href="http://blog.rayfoo.info/wp-content/uploads/2010/04/splunk-iplocation.png"><img class="aligncenter size-medium wp-image-530" title="splunk iplocation" src="http://blog.rayfoo.info/wp-content/uploads/2010/04/splunk-iplocation-300x138.png" alt="" width="300" height="138" /></a></p>
<h2>1b. MAXMIND app</h2>
<p>Like previously mentioned before: install the <a href="http://www.splunkbase.com/apps/All/4.x/Add-On/app:Geo+Location+Lookup+Script">MAXMIND app</a>, then pipe the field containing IPs to the lookup (the field name <em>must</em> be clientip, if not this will not work duh)</p>
<p>This can work with the server not having any internet connectivity, but the accuracy is entirely dependant on the cached MAXMIND database.</p>
<p style="text-align: center;"><span style="color: #339966;">index=myindex | lookup geoip clientip</span></p>
<p style="text-align: center;">or</p>
<p style="text-align: center;"><span style="color: #339966;">index=myindex2 | lookup geoip clientip as fieldwithip</span></p>
<p><a href="http://blog.rayfoo.info/wp-content/uploads/2010/04/splunk-geoiplookup.png"><img class="aligncenter size-medium wp-image-531" title="splunk geoiplookup" src="http://blog.rayfoo.info/wp-content/uploads/2010/04/splunk-geoiplookup-300x137.png" alt="" width="300" height="137" /></a></p>
<h2>2, 3. IP-hostname or hostname-IP</h2>
<p>These two items are pretty similar.  Spunk 4 comes with a lookup script called external_lookup.py, and the config is already in the default transforms.conf.  So we only need to use it!</p>
<p style="text-align: center;">Resolving IPs to hostnames:</p>
<p style="text-align: center;"><span style="color: #339966;">index=myindex | lookup dnslookup clientip</span></p>
<p><a href="http://blog.rayfoo.info/wp-content/uploads/2010/04/splunk-ip-to-hostname.png"><img class="aligncenter size-medium wp-image-532" title="splunk ip to hostname" src="http://blog.rayfoo.info/wp-content/uploads/2010/04/splunk-ip-to-hostname-300x136.png" alt="" width="300" height="136" /></a></p>
<p style="text-align: center;">Resolving hostnames to IPs:</p>
<p style="text-align: center;"><span style="color: #339966;">index=myindex | lookup dnslookup clienthost</span></p>
<p style="text-align: center;">(no screenshot, sorry <img src='http://blog.rayfoo.info/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> )</p>
<p style="text-align: center;"><span style="font-family: Consolas, Monaco, 'Courier New', Courier, monospace; color: #339966;"><span style="line-height: 18px; white-space: pre; font-size: small;"><br />
</span></span></p>
<p>Leave a comment if this helped, or if you want to ask anything!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.rayfoo.info/2010/04/getting-additional-ipnetworklocation-info-along-with-your-splunk-searches/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing Ubuntu 7.04 server in VirtualBox</title>
		<link>http://blog.rayfoo.info/2010/02/installing-ubuntu-7-04-server-in-virtualbox</link>
		<comments>http://blog.rayfoo.info/2010/02/installing-ubuntu-7-04-server-in-virtualbox#comments</comments>
		<pubDate>Fri, 05 Feb 2010 07:55:53 +0000</pubDate>
		<dc:creator>ray</dc:creator>
				<category><![CDATA[Everything]]></category>
		<category><![CDATA[HOWTO]]></category>
		<category><![CDATA[Metasploit]]></category>
		<category><![CDATA[Offensive Security]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[VirtualBox]]></category>
		<category><![CDATA[VMware Player]]></category>

		<guid isPermaLink="false">http://blog.rayfoo.info/?p=413</guid>
		<description><![CDATA[As part of the fiddling around with Metasploit, there came the need to install a victim box to test things on (we don't want to be attacking a live site don't we?  Especially one that we don't own...), so here's a modification of the instructions found at Offensive Security's walkthrough for our needs. I wanted [...]]]></description>
			<content:encoded><![CDATA[<p>As part of the fiddling around with <a href="http://www.metasploit.com/">Metasploit</a>, there came the need to install a victim box to test things on (we don't want to be attacking a live site don't we?  Especially one that we don't own...), so here's a modification of the instructions found at<a href="http://www.offensive-security.com/metasploit-unleashed/"> Offensive Security's walkthrough</a> for our needs.</p>
<p>I wanted to run the victim machines in VirtualBox instead of VMware Player, and after some experimentation and Googling around with the crashing <a href="http://www.virtualbox.org/ticket/289">issue</a>, here're the instructions on how to get things up and running.</p>
<p>Host OS: Ubuntu 9.10<br />
VirtualBox 3.1.2<br />
Guest OS: Ubuntu 7.04 Server</p>
<p><span id="more-413"></span></p>
<h2>Steps:</h2>
<p>1. Get only the server ISO, not the virtual machine. <a href="http://old-releases.ubuntu.com/releases/feisty/ubuntu-7.04-server-i386.iso">http://old-releases.ubuntu.com/releases/feisty/ubuntu-7.04-server-i386.iso</a></p>
<p>2. Add it into the list of CD/DVD images within the Virtual Media Manager in VirtualBox.</p>
<p>3. Create a new virtual machine with the following settings:<br />
Name: (up to you)<br />
Operation System: Linux<br />
Version: Ubuntu<br />
Base Memory Size: (up to you, the defaults of 384MB was ok for me)<br />
Boot Hard Disk: (up to you, create new or select pre-existing one)</p>
<p>4. Select the new virtual machine, then click on Settings to edit the settings for this virtual machine (duh).</p>
<p>5. Goto System &gt; Processor. Check the box labelled "Enable PAE/NX".  This is needed for this to work.</p>
<p>6. Goto the Storage section, select the "Empty" CD/DVD item, then select the 7.04 ISO you added earlier in step 1.  This will be needed for your install...</p>
<p>7. Goto the Network section.  Adapter 1 should be enabled for you already, change "Attached to" from "NAT" to "Host-only Adapter".  I do this since we want a vulnerable server and not get the latest updates.  If you have different needs set this option accordingly.</p>
<p>8. Edit any other hardware options as you wish and then press "Ok".</p>
<p>9. Start the virtual machine, it should boot up to the CD ISO.  Follow the steps for installing the ISO into the virtual disk.  If you're using "Host-only Adapter" as shown in step 7, it will prompt a bit with regards to empty route, no nameservers and no proxy.  This is normal, leave as blank and continue.</p>
<p>10. There!  I (hopefully) can haz vulnerable server!</p>
<p>Do leave a comment if this has helped, or if you have any other questions which I'll answer if I can, heh. <img src='http://blog.rayfoo.info/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>--------------------------------</p>
<h2>References:</h2>
<p>1. <a href="http://www.offensive-security.com/metasploit-unleashed/">Offensive Security's walkthrough on Metasploit</a>: Metasploit Unleashed &gt; 02 Required Materials &gt; Ubuntu 7.04</p>
<p>2. <a href="http://www.virtualbox.org/ticket/289">Ubuntu 7.04 Server Crashes when booting</a>: ... do a default install of Ububtu 7.04 Server. When install is complete, immediately after booting Ubuntu crashes: Int 14: CR2 c1000000 err 00000002 EIP c03f3c3e CS 00000060 flags 00000006 Stack: 373c0046 00000000 ffffffff c0490000 00001400 00000080 00400000 ffffff80</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.rayfoo.info/2010/02/installing-ubuntu-7-04-server-in-virtualbox/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting your server to send an email whenever anyone logs in</title>
		<link>http://blog.rayfoo.info/2009/09/getting-your-server-to-send-an-email-whenever-anyone-logs-in</link>
		<comments>http://blog.rayfoo.info/2009/09/getting-your-server-to-send-an-email-whenever-anyone-logs-in#comments</comments>
		<pubDate>Tue, 29 Sep 2009 16:32:18 +0000</pubDate>
		<dc:creator>ray</dc:creator>
				<category><![CDATA[Everything]]></category>
		<category><![CDATA[CLI]]></category>
		<category><![CDATA[email notification]]></category>
		<category><![CDATA[hardening]]></category>
		<category><![CDATA[HOWTO]]></category>
		<category><![CDATA[Linode]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[server administration]]></category>

		<guid isPermaLink="false">http://blog.rayfoo.info/?p=141</guid>
		<description><![CDATA[Running on a VPS like Linode give me plenty of control over what is run, and also plenty of chances to learn more about network administration (along with the heartaches). The code that I used was based from this forum post. This one presumes that your MTA has been setup properly. The original code was [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.linode.com/?r=b1394ed1dfb7ce948e9dadb668234b2e69a2c274"><img class="alignright size-full wp-image-142" title="Linode" src="http://blog.rayfoo.info/wp-content/uploads/2009/09/rubyinside-ad1-310x90.png" alt="rubyinside-ad1-310x90" width="310" height="90" /></a>Running on a VPS like <a href="http://www.linode.com/?r=b1394ed1dfb7ce948e9dadb668234b2e69a2c274">Linode</a> give me plenty of control over what is run, and also plenty of chances to learn more about network administration (along with the heartaches). <img src='http://blog.rayfoo.info/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<p>The code that I used was based from this <a href="http://www.linode.com/forums/archive/o_t/t_1358/securing_your_linode.html">forum post</a>.  This one presumes that your MTA has been setup properly.  The original code was for protecting your root account (i.e. when anyone logs into your server's root account, you get the notification).</p>
<p>(Note: it is usually not advisable to login as root.  Create a user account and give it sudoer rights instead.  I'd say that's advisable even for servers where there is only one person expected to login, which is you.)<br />
<span id="more-141"></span><br />
&nbsp;</p>
<h1>Protect only the root account</h1>
<p>If you want to protect only the root account, edit the file <code>/root/.bash_profile</code> or <code>/root/.profile</code> (the bash profile file takes precedence)</p>
<p>Add this line at the end:<br />
<code>echo 'ALERT - Root Shell Access on:' `date` `who` | mail -s "Alert: Root Login from `who | awk '{print $6}'`" youremailaddresshere</code><br />
&nbsp;</p>
<h1>Protect all accounts</h1>
<p>If you want to protect ALL accounts, which is better for high security requirements, or for paranoid people like me, you edit the <code>/etc/profile</code> file instead. (you will need root priviledges for this)</p>
<p>For me, I used this instead of the previous command:<br />
<code>echo 'ALERT - Shell Access:' `date` `who` | mail -s "Alert: Shell Access from `who | cut -d"(" -f2 | cut -d")" -f1`" youremailaddresshere</code></p>
<p>With this, you'll get a notification whenever anyone logs in.  The downside to this is that you may get too many emails on a server that has plenty of people logging in.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.rayfoo.info/2009/09/getting-your-server-to-send-an-email-whenever-anyone-logs-in/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting WordPress to work with memcached</title>
		<link>http://blog.rayfoo.info/2009/08/getting-wordpress-to-work-with-memcached</link>
		<comments>http://blog.rayfoo.info/2009/08/getting-wordpress-to-work-with-memcached#comments</comments>
		<pubDate>Sat, 22 Aug 2009 17:15:50 +0000</pubDate>
		<dc:creator>ray</dc:creator>
				<category><![CDATA[Everything]]></category>
		<category><![CDATA[HOWTO]]></category>
		<category><![CDATA[memcached]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://blog.rayfoo.info/?p=9</guid>
		<description><![CDATA[Wordpress can work with memcached as a cache, here's how to do it.]]></description>
			<content:encoded><![CDATA[<p>WordPress can work with memcached as a cache, and there are <a href="http://www.google.com/search?q=wordpress+memcached" target="_blank">plenty</a> of places to find instructions on how to do that.</p>
<p>I referred to <a href="http://ryan.wordpress.com/2005/12/23/memcached-backend/" target="_blank">Ryan</a>'s and <a href="http://mohanjith.net/blog/2008/10/using-memcached-with-wordpress-object-cache.html" target="_blank">Mohanjith</a>'s blog posts that detail this, and after some tweaks to get it up working with the most recent version of WordPress on PHP5, I've decided to write some instructions that are a little more recent <img src='http://blog.rayfoo.info/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p><span id="more-9"></span></p>
<h1>1. Install WordPress and memcached. (duh)</h1>
<p>Google for instructions on how to do that for your relevant distros, but I won't be covering that here.  I assume that your memcached server is listening on 127.0.0.1:11211.</p>
<h1>2. Copy object-cache.php into wp-content folder.</h1>
<p>I've mirrored Mohanjith's modified version <a href="http://blog.rayfoo.info/wp-content/uploads/2009/08/object-cache.txt">here</a>.  Do remember to rename it to object-cache.php, and make it readable by the PHP user account.</p>
<h1>3. Edit your wp-config.php file.</h1>
<p>Add these lines in:</p>
<p><code>global $memcached_servers;<br />
$memcached_servers = array('default' =&gt; array('127.0.0.1:11211'));<br />
global $blog_id;<br />
$blog_id = 'some_unique_identifier';</code></p>
<p>If you have different WordPress blogs using the same memcached cache, $blog_id MUST be unique across different blogs.  Else you can just leave it as it is <img src='http://blog.rayfoo.info/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<h1>4. Enjoy the speedup.</h1>
<p>There you're done!  You can verify that WordPress is using the memcached cache by issuing the "stats" command to memcached, which I probably will write how to in another post.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.rayfoo.info/2009/08/getting-wordpress-to-work-with-memcached/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

