<?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>Technology: Learn and Share &#187; Caching</title>
	<atom:link href="http://crazytoon.com/category/caching/feed/" rel="self" type="application/rss+xml" />
	<link>http://crazytoon.com</link>
	<description>Enterprise level solutions, LAMP, Linux, Apache, MySQL, PHP, Perl, Windows, Cache, Optimization</description>
	<lastBuildDate>Fri, 16 Jul 2010 20:24:40 +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>Memcached:  How do you install memcached?  (CentOS 64 bit, Linux, Redhat, Fedora)</title>
		<link>http://crazytoon.com/2008/01/20/memcached-how-do-you-install-memcached-centos-64-bit-linux-redhat-fedora/</link>
		<comments>http://crazytoon.com/2008/01/20/memcached-how-do-you-install-memcached-centos-64-bit-linux-redhat-fedora/#comments</comments>
		<pubDate>Sun, 20 Jan 2008 22:52:32 +0000</pubDate>
		<dc:creator>Sunny Walia</dc:creator>
				<category><![CDATA[Caching]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Enterprise level solutions]]></category>
		<category><![CDATA[Linux Apache MySQL PHP]]></category>

		<guid isPermaLink="false">http://crazytoon.com/2008/01/20/memcached-how-do-you-install-memcached-centos-64-bit-linux-redhat-fedora/</guid>
		<description><![CDATA[ [updated 5/16/2010]
Memcached is a very popular open source object caching server.  It was developed to speed up livejournal.com by Danga Interactive.  We use memcached for a lot of our sites.  We use it for different purposes but one main purpose is to cache query results so we don&#8217;t have to keep hitting database.  [...]]]></description>
			<content:encoded><![CDATA[<p> [updated 5/16/2010]</p>
<p>Memcached is a very popular open source object caching server.  It was developed to speed up livejournal.com by Danga Interactive.  We use memcached for a lot of our sites.  We use it for different purposes but one main purpose is to cache query results so we don&#8217;t have to keep hitting database.  As most of the people who work with databases know it is costly to keep hitting database for same information over and over.</p>
<p>When you run the Memcached daemon, it runs and listens on a specific port.  One of the things Memcached does lack is security.  Memcached will let anybody who can make a connection to its port have full access to all objects.  So you would have to run a firewall to block unauthorized access.  It is usually wise to do put firewall on it even if you trust everybody on the same network since accidents do happen.  That said, let&#8217;s get memcached installed!</p>
<p>Let&#8217;s get libevent which is required by Memcached:</p>
<p>wget http://monkey.org/~provos/libevent-1.3e.tar.gz<br />
tar zxpfv libevent*<br />
cd libevent*<br />
./configure<br />
make install</p>
<p>Now let&#8217;s download the newest Memcached source (at time of update to this post 1.4.5 was the latest)</p>
<p>wget http://memcached.googlecode.com/files/memcached-1.4.5.tar.gz<br />
tar zxpfv memcached*<br />
cd memcached*<br />
./configure<br />
make install</p>
<p>Let&#8217;s add Memcached user to run daemon as since we don&#8217;t need it to run as root privileges.</p>
<p>adduser memcached</p>
<p>We will start the server to use 48 megs of ram (-m 48), listen on ip 10.0.0.2 (-l 10.0.0.2) and run on port 11211 (-p 11211) as user memcached (-u memcached)</p>
<p>./memcached -u memcached -d -m 48 -l 10.0.0.2 -p 11211</p>
<p>If you get the following error (which you will get if you are doing this under CentOS 64 bit):</p>
<p>./memcached: error while loading shared libraries: libevent-1.3e.so.1: cannot open shared object file: No such file or directory</p>
<p>You can fix this by simply doing this:</p>
<p>ln -s /usr/local/lib/libevent-1.3e.so.1 /lib64/</p>
<p>That is all there is to it.  You can see if daemon is running by telneting to the port.</p>
<p>————————————-<br />
<small>DISCLAIMER: Please be smart and use code found on internet carefully. Make backups often. And yeah.. last but not least.. I am not responsible for any damage caused by this posting. <strong>Use at your own risk</strong>.</small></p>
]]></content:encoded>
			<wfw:commentRss>http://crazytoon.com/2008/01/20/memcached-how-do-you-install-memcached-centos-64-bit-linux-redhat-fedora/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>Mcache:  Install and configure mcache (msession) to be used for session caching in PHP.</title>
		<link>http://crazytoon.com/2007/05/23/mcache-install-and-configure-mcache-msession-to-be-used-for-session-caching-in-php/</link>
		<comments>http://crazytoon.com/2007/05/23/mcache-install-and-configure-mcache-msession-to-be-used-for-session-caching-in-php/#comments</comments>
		<pubDate>Wed, 23 May 2007 23:45:25 +0000</pubDate>
		<dc:creator>Sunny Walia</dc:creator>
				<category><![CDATA[Caching]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Enterprise level solutions]]></category>
		<category><![CDATA[Linux System]]></category>
		<category><![CDATA[Notes for self]]></category>
		<category><![CDATA[Redhat]]></category>
		<category><![CDATA[System admin]]></category>

		<guid isPermaLink="false">http://crazytoon.com/2007/05/23/mcache-install-and-configure-mcache-msession-to-be-used-for-session-caching-in-php/</guid>
		<description><![CDATA[Installing mcache, previously known as msession, on CentOS 32 bit system.
If you are on 64 bit system, you will get errors, lots of them.  I went through and fixed &#8220;some&#8221; errors by modifying code but it was just taking too much time so I decided not to go 64 bit route.  But below are the [...]]]></description>
			<content:encoded><![CDATA[<p>Installing <strong>mcache</strong>, previously known as <strong>msession</strong>, on CentOS 32 bit system.</p>
<p>If you are on 64 bit system, you will get errors, lots of them.  I went through and fixed &#8220;some&#8221; errors by modifying code but it was just taking too much time so I decided not to go 64 bit route.  But below are the efforts I made.  Maybe somebody can help with rest of the steps.   Following instructions work fine with 32 bit systems. For more help look at the <a href="http://www.mohawksoft.org/?q=node/8">MCache Handbook</a>.<br />
Thank you <a href="http://www.mohawksoft.org">Mohawk Software</a> for all your efforts developing this!</p>
<p>Web site: <a href="http://www.mohawksoft.org/?q=node/32">http://www.mohawksoft.org/?q=node/32</a><br />
PHP reference:  <a href="http://us2.php.net/manual/en/ref.msession.php">http://us2.php.net/manual/en/ref.msession.php</a></p>
<p><code>yum install ncurses-devel #otherwise you might see errors about no such file curses.h</code></p>
<p><code>wget http://www.mohawksoft.org/download/mcache-070415-M2.0b6.tar.gz<br />
wget http://www.mohawksoft.org/download/phoenix-070415-M2.0b6.tar.gz<br />
tar zxf mcache*.gz<br />
tar zxf phoenix*.gz<br />
cd phoenix<br />
ln -s Linux.mak config/config.mak<br />
make dirs<br />
make links<br />
make butils<br />
export PATH=$PATH:/opt/mohawk/bin<br />
make libs<br />
vi sqldrv/Makefile # about line 24, comment out POSTGRES=1 and ODBC=1<br />
cd ../mcac*<br />
make server<br />
vi tools/Makefile # after line which says: CARGS+=-DBINDIR=\"$(BINDIR)\"<br />
                  # add:  CARGS+=-DSBINDIR=\"$(SBINDIR)\"<br />
make utils<br />
ln -s /opt/mohawk/lib/libphoenix.so.2.2.2 /lib/<br />
/opt/mohawk/sbin/mcache &amp;</code></p>
<p>In your php.ini, add:   <br />
<code>[Session]<br />
; Use mcache as the save handler<br />
session.save_handler = mcache<br />
; Set the host which runs the mcache daemon<br />
session.save_path = localhost</code></p>
<p>Let us test if mcache server is running:</p>
<p><code>/opt/mohawk/bin/mping</code><br />
You should see:<br />
<code>Usage: /opt/mohawk/bin/mping host<br />
Pings a session daemon<br />
Using localhost<br />
<strong>localhost:8086 is alive</strong></code></p>
<p>Great! You mcache server is now up and running and listening for connections.</p>
<p>You can add above command to your start up scripts so server will run next time you reboot.  Easiest way to achieve this is to add that command to end of /etc/rc.local</p>
<p>32 bit installation is now complete! </p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>I could not get 64 bit install to go but here are my notes for whoever wants to try it.  If you get it working, please come back and comment on how you got it installed.</p>
<p>64 bit install notes:First error:  <em>CPU you selected does not support x86-64 instruction set<br />
</em>to fix this, edit config/unixgcc.mak and remove all instances of -mtune=pentium3</p>
<p>Following are code changes to fix some other errors:</p>
<p>line 83 in phmalloc.h<br />
virtual void *memdup(void *mem, unsigned int cb);<br />
to<br />
virtual void *memdup(void *mem, size_t cb);</p>
<p>line 446 in mexpat.cpp<br />
static void *xmlalloc(void *context, unsigned int cb)<br />
to<br />
static void *xmlalloc(void *context, size_t cb)</p>
<p>static void *xmlrealloc(void *context, void *p, unsigned int cb)<br />
to<br />
static void *xmlrealloc(void *context, void *p, size_t cb)</p>
]]></content:encoded>
			<wfw:commentRss>http://crazytoon.com/2007/05/23/mcache-install-and-configure-mcache-msession-to-be-used-for-session-caching-in-php/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>
