<?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>Linux, Open Source and Web 2.0 &#187; apache</title>
	<atom:link href="http://articles.itecsoftware.com/tag/apache/feed" rel="self" type="application/rss+xml" />
	<link>http://articles.itecsoftware.com</link>
	<description>Itec Software</description>
	<lastBuildDate>Mon, 06 Sep 2010 18:29:30 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Hot To Install Memcache And PHP Client On Mac Snow Leopard</title>
		<link>http://articles.itecsoftware.com/web-development/hot-to-install-memcache-and-php-client-on-mac-snow-leopard</link>
		<comments>http://articles.itecsoftware.com/web-development/hot-to-install-memcache-and-php-client-on-mac-snow-leopard#comments</comments>
		<pubDate>Mon, 08 Feb 2010 23:59:32 +0000</pubDate>
		<dc:creator>Peter</dc:creator>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[memcache]]></category>
		<category><![CDATA[memcached]]></category>
		<category><![CDATA[PECL]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[php5-memache]]></category>

		<guid isPermaLink="false">http://articles.itecsoftware.com/?p=346</guid>
		<description><![CDATA[I recently installed the memcached daemon on my MacBook Pro, incuding the necessary PHP client for development purposes. I just prefer to work locally instead of using a VM running Linux. And the process is actually quite simple and straight forward. Please note, I have included both clients, the old standard one and the newer [...]]]></description>
			<content:encoded><![CDATA[<p>I recently installed the memcached daemon on my MacBook Pro, incuding the necessary PHP client for development purposes. I just prefer to work locally instead of using a VM running Linux. And the process is actually quite simple and straight forward. Please note, I have included both clients, the old standard one and the newer PECL extension, because I deal with different applications and also lots of people seems to get confused when they install one version and their memcache classes cannot get instantiated and throw errors. So, if in doubt, just install both.</p>
<p>These are the five (four if you know which extension you want) components needed:</p>
<p>- libevent (requred library for memcached)</p>
<p>- memcached daemon</p>
<p>- libmemcached (required library for the php client)</p>
<p>- php extension (standard)</p>
<p>- php extension (PECL)</p>
<p>Now open your terminal and off we go:<span id="more-346"></span></p>
<p><em> Note: if you don&#8217;t want to install wget, you can alternatively use &#8220;curl -O&#8221;)</em></p>
<p><span style="color: #008000;"><strong><span style="color: #000000;">Installing libevent:</span></strong></span><br />
<span style="color: #008000;"><br />
$ cd /tmp<br />
$ wget http://www.monkey.org/~provos/libevent-1.4.13-stable.tar.gz (if you&#8217;re brave, you can try the 2.0 beta)<br />
$ tar zxvf libevent-1.4.13-stable.tar.gz<br />
$ ./configure<br />
$ make<br />
$ sudo make install</span></p>
<p><span style="color: #008000;"><strong><span style="color: #000000;">Installing memcached:</span></strong></span></p>
<p><span style="color: #008000;">$ wget http://memcached.googlecode.com/files/memcached-1.4.1.tar.gz<br />
$ tar xzvf memcached-1.4.1.tar.gz<br />
$ cd memcached-1.4.1<br />
$ ./configure<br />
$ make<br />
$ make test<br />
$ sudo make install</span><br />
<span style="color: #008000;">$ memcached -d -P pidfile -l 127.0.0.1</span> (this will start the memcached daemon)<br />
<span style="color: #008000;">$ ps aux | grep &#8216;memcached&#8217; <span style="color: #000000;">(this should confirm that memcached is running and how much memory is assigned to it)</span></span></p>
<p><strong><span style="color: #008000;"><span style="color: #000000;">Installing libmemcached:</span></span></strong></p>
<p><span style="color: #008000;">$ wget http://launchpad.net/libmemcached/1.0/0.34/+download/libmemcached-0.34.tar.gz<br />
$ tar -zxvf libmemcached-0.34.tar.gz<br />
$ cd libmemcached-0.34<br />
$ ./configure<br />
$ make<br />
$ sudo make install</span></p>
<p><strong><span style="color: #000000;">Installing PECL memcache extension:</span></strong></p>
<p><span style="color: #008000;">$ cd /tmp<br />
$ pecl download memcached<br />
$ tar xzvf memcached-1.0.0.tgz<br />
$ cd memcached-1.0.0<br />
$ phpize<br />
$ ./configure<br />
$ make<br />
$ sudo make install</span></p>
<p><strong><span style="color: #000000;">Installing PHP memcache extension:</span></strong></p>
<p><span style="color: #008000;">$ cd /tmp<br />
$ wget http://pecl.php.net/get/memcache-2.2.4.tgz<br />
$ tar -zxvf memcache-2.2.4.tgz<br />
$ cd memcache-2.2.4<br />
$ phpize &amp;&amp;<br />
$ ./configure<br />
$ make<br />
$ sudo make install</span></p>
<p>Once all the steps are completed successfully, ensure that the extension directory is specified as the same as the output of the terminal after the extensions installed. Otherwise correct in php.ini.</p>
<p>Also add the line(s) to load the extension(s) in the php.ini file, in the extension section:</p>
<p>extension=memcached.so<br />
extension=memcache.so</p>
<p>And finally restart apache:<br />
<span style="color: #008000;">$ sudo apachectl restart</span></p>
<p>And verify in phpinfo that memcache(d) is loaded and working.</p>

<div style="font-size:0px;height:0px;line-height:0px;margin:0;padding:0;clear:both"></div>]]></content:encoded>
			<wfw:commentRss>http://articles.itecsoftware.com/web-development/hot-to-install-memcache-and-php-client-on-mac-snow-leopard/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To Add PHP Mcrypt Module On Snow Leopard 10.6</title>
		<link>http://articles.itecsoftware.com/web-development/how-to-add-php-mcrypt-module-on-snow-leopard-10-6</link>
		<comments>http://articles.itecsoftware.com/web-development/how-to-add-php-mcrypt-module-on-snow-leopard-10-6#comments</comments>
		<pubDate>Tue, 03 Nov 2009 20:39:47 +0000</pubDate>
		<dc:creator>Peter</dc:creator>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[mcrypt]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://articles.itecsoftware.com/?p=322</guid>
		<description><![CDATA[These instructions assume that you have a working Apache 2.2 / PHP 5.3 in place and want to add the php mcrypt module. It will work as a fresh install, but keep in mind that additional configuration steps after these instructions are necessary to get your webserver working properly. Those additional steps are omitted here, as there [...]]]></description>
			<content:encoded><![CDATA[<p>These instructions assume that you have a working Apache 2.2 / PHP 5.3 in place and want to add the php mcrypt module. It will work as a fresh install, but keep in mind that additional configuration steps after these instructions are necessary to get your webserver working properly. Those additional steps are omitted here, as there are countless resources available on the Internet.</p>
<p>1. If you don&#8217;t already have the mcrypt module (in /usr/lib), d<span style="background-color: #ffffff;">ownload the <span style="text-decoration: underline;">libmcrypt</span> source code from sourceforge <a href="http://sourceforge.net/projects/mcrypt/files/Libmcrypt/" target="_blank">here</a>. Then extract the downloaded file in a Terminal and move inside the created directory. (cd libmcrypt-2.5.8 in my case)</span></p>
<p>2. Execute the following lines in one command in your Terminal, if you have a 64bit version of Apache/PHP:</p>
<p><span style="color: #003300;"><em><span style="color: #008000;">CFLAGS=&#8221;-arch x86_64&#8243; \<br />
CXXFLAGS=&#8221;-arch x86_64&#8243; \<br />
./configure &#8211;disable-posix-threads</span></em></span></p>
<p>(for 32 bit versions: ./configure &#8211;disable-posix-threads)</p>
<p><span id="more-322"></span></p>
<p>2. In your Terminal, run:</p>
<p><span style="color: #003300;"><em><span style="color: #008000;">make</span></em></span></p>
<p>3. If no errors, in your Terminal run:</p>
<p><span style="color: #003300;"><em><span style="color: #008000;">sudo make install</span></em></span></p>
<p>4. Download the PHP source code from PHP&#8217;s website <a href="http://www.php.net/downloads.php#v5" target="_blank">here</a>. Extract in a Terminal and move into the extracted directory.</p>
<p>5. In your Terminal, run the following lines in one command:</p>
<p><span style="color: #003300;"><em><span style="color: #008000;">export MACOSX_DEPLOYMENT_TARGET=10.6 \<br />
CFLAGS=&#8221;-arch x86_64&#8243; \<br />
CXXFLAGS=&#8221;-arch x86_64&#8243;</span></em></span></p>
<p><span style="color: #003300;"><em><span style="color: #008000;"><br />
./configure &#8211;prefix=/usr/local/php5<br />
&#8211;mandir=/usr/share/man<br />
&#8211;infodir=/usr/share/info<br />
&#8211;sysconfdir=/etc \<br />
&#8211;with-config-file-path=/etc \<br />
&#8211;with-zlib \<br />
&#8211;with-zlib-dir=/usr \<br />
&#8211;with-openssl \<br />
&#8211;with-iconv=/usr \<br />
&#8211;enable-exif \<br />
&#8211;enable-ftp \<br />
&#8211;enable-mbstring \<br />
&#8211;enable-mbregex \<br />
&#8211;with-mcrypt \<br />
&#8211;enable-sockets \<br />
&#8211;with-mysql=/usr/local/mysql \<br />
&#8211;with-pdo-mysql=/usr/local/mysql \<br />
&#8211;with-mysqli=/usr/local/mysql/bin/mysql_config \<br />
&#8211;with-apxs2=/usr/sbin/apxs</span></em></span></p>
<p>6. Correct a bug in Makefile.</p>
<p>As a result of a bug in PHP 5.2.9 and 5.3.0, we&#8217;ll need to correct the file <span style="text-decoration: underline;">Makefile</span> generated by the configure phase. Let&#8217;s add ‘-lresolv‘ at the end of the line that begins with ‘EXTRA_LIBS‘. Leave a space and add it like &#8221; &#8230;   -lz -licucore -lm -lresolv to whatever is there already. Do not alter the exiting text, simply add it.</p>
<p>7. In your Terminal, run:</p>
<p><span style="color: #003300;"><em><span style="color: #008000;">make</span></em></span></p>
<p>8. If no errors, run:</p>
<p><span style="color: #003300;"><em><span style="color: #008000;">sudo make install</span></em></span></p>
<p>At this point, restart apache and check your configuration with phpinfo(). Look for mcrypt as it should appear as an enabled module.</p>

<div style="font-size:0px;height:0px;line-height:0px;margin:0;padding:0;clear:both"></div>]]></content:encoded>
			<wfw:commentRss>http://articles.itecsoftware.com/web-development/how-to-add-php-mcrypt-module-on-snow-leopard-10-6/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to install MySQL Server, PHP and Apache on a Mac</title>
		<link>http://articles.itecsoftware.com/web-development/how-to-install-mysql-server-php-and-apache-on-a-mac</link>
		<comments>http://articles.itecsoftware.com/web-development/how-to-install-mysql-server-php-and-apache-on-a-mac#comments</comments>
		<pubDate>Sat, 24 Oct 2009 19:39:50 +0000</pubDate>
		<dc:creator>Peter</dc:creator>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Snow Leopard]]></category>

		<guid isPermaLink="false">http://articles.itecsoftware.com/?p=301</guid>
		<description><![CDATA[These instructions lead you thru the installation of the latest LAMP Stack on MacOS X Snow Leopard. 1 &#8211; Download the installation image from MySQL website here. Then double-click to mount and open the disk image. 2 &#8211; Install MySQL Server by double clicking the package &#8220;mysql-5.1.*****.pkg&#8221; and follow the menu, accepting the default values, [...]]]></description>
			<content:encoded><![CDATA[<p>These instructions lead you thru the installation of the latest LAMP Stack on MacOS X Snow Leopard.</p>
<p>1 &#8211; Download the installation image from MySQL website <a href="http://dev.mysql.com/downloads/mysql/5.1.html#macosx-dmg" target="_blank">here</a>. Then double-click to mount and open the disk image.</p>
<p>2 &#8211; Install MySQL Server by double clicking the package &#8220;mysql-5.1.*****.pkg&#8221; and follow the menu, accepting the default values, unless you want to change something and know exactly what you&#8217;re doing.</p>
<p>3 &#8211; Install MySQL Startup Item by double-clicking the package &#8220;MySQLStartupitem.pkg&#8221; and follow the menu.</p>
<p>4 &#8211; Install MySQL Preference Pane by double-clicking the file &#8220;MySQL.prefPane&#8221; and follow the menu. This item will simplify the management of your SQL Server. You can now use the &#8220;System Preferences&#8221; panel to start and stop the database server.</p>
<p>5 &#8211; Enable the php module in your apache config file. You might know that Snow Leopard already ships with Apache 2.2 and PHP 5.3, but it needs a couple of tweaks to make it work smoothly. So, open /etc/apache2/httpd.conf and search for &#8220;php5_module&#8221;. Remove the comment (#) in front of the line, save and close the file, then restart apache (sudo apachectl restart)</p>
<p><span id="more-301"></span></p>
<p>6 &#8211; Testing Apache/PHP. Let&#8217;s create an info file so we know what we got. Navigate to /Library/WebServer/Documents and create a file called phpinfo.php. Put the following line into the file, save and close. &#8220;&lt;?php phpinfo(); ?&gt;&#8221;. Now open your favorite browser and hit it (http://localhost/phpinfo.php). You should see a page like the one below, which shows you configuration details, modules enabled and other useful information.</p>
<p><img class="size-medium wp-image-307  alignleft" style="margin: 10px;" title="php-info-page" src="http://articles.itecsoftware.com/wp-content/uploads/2009/10/php-info-page-300x195.png" alt="PHP Info Page" width="300" height="195" /></p>
<p>7 &#8211; There is no php.ini out of the box (as you may have discovered by looking at the phpinfo page), but there is a sample file called &#8220;php.ini.default&#8221; which we&#8217;re going to use. Copy this file and save it as php.ini.</p>
<p>8 &#8211; Set the default time zone. As PHP 5.3 requires the timezone to be set, let&#8217;s do this inside php.ini, so we don&#8217;t have to worry about it anymore. You can always override it in your application&#8217;s bootstrap, if needed. Open /etc/php.ini and search for &#8220;[Date]&#8220;. Uncomment the line &#8220;date.timezone = &#8221; and add your timezone. Check the <a href="http://www.php.net/manual/en/timezones.php" target="_blank">php manual</a> for acceptable values. (example: date.timezone = &#8216;America/Los Angeles&#8217;)</p>
<p>And that&#8217;s it. You should now have a fully functional LAMP stack with Apache, PHP and MySQL server.</p>

<div style="font-size:0px;height:0px;line-height:0px;margin:0;padding:0;clear:both"></div>]]></content:encoded>
			<wfw:commentRss>http://articles.itecsoftware.com/web-development/how-to-install-mysql-server-php-and-apache-on-a-mac/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Nginx and memcached module</title>
		<link>http://articles.itecsoftware.com/web-development/nginx-and-memcached-module</link>
		<comments>http://articles.itecsoftware.com/web-development/nginx-and-memcached-module#comments</comments>
		<pubDate>Fri, 17 Jul 2009 20:31:35 +0000</pubDate>
		<dc:creator>Peter</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[SEO]]></category>
		<category><![CDATA[Shell Scripting]]></category>
		<category><![CDATA[Useful Stuff]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[memcache]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://articles.itecsoftware.com/?p=148</guid>
		<description><![CDATA[With nginx memcache module, we serve more pages faster with less hardware. It's a nobrainer.]]></description>
			<content:encoded><![CDATA[<p><a rel="nofollow" href="http://www.danga.com/memcached/" target="_blank">Memcache</a> is traditionally used as a module inside server side scripts, such as <a rel="nofollow" href="http://www.php.net" target="_blank">PHP</a>, ASP, ColdFusion and others. And it&#8217;s doing a terrific job, as long as it&#8217;s implemented correctly.</p>
<p>But if we look under the hood of the actual <a rel="nofollow" href="http://www.danga.com/memcached/" target="_blank">Memcache</a> application, and I&#8217;m not talking about the PHP or ASP extension, but rather the executable that&#8217;s running as a daemon under linux, for example, it is a rather simple database like application running in memory. Now there are two basic actions that need to be performed to use it, one is writing info into memcache, the other is reading it. In a typical scenario, there are many reads for one write, that&#8217;s the whole point, isn&#8217;t it. But what if we can isolate the reading from the server side scripts, and let a small high speed module do that for us.</p>
<p><span id="more-148"></span></p>
<p>That&#8217;s where <a rel="nofollow" href="http://nginx.net/" target="_blank">Nginx</a> and it&#8217;s <a rel="nofollow" href="http://wiki.nginx.org/NginxHttpMemcachedModule" target="_blank">Memcache Module</a> comes in. We use PHP to fill up the cache and then let Nginx serve that content to the requesting client. According to lead architect Peter Gilg, this configuration is used at <a rel="nofollow" href="http://www.mademan.com/" target="_blank">Mademan.com</a>, a lifestyle site serving up to 1 million pageviews/day.</p>
<p>To be more specific, we&#8217;ll have nginx listen on port 80. If a request comes in, it checks memcache if the requested page is in memory and serves it directly to the client, or sends it to <a rel="nofollow" href="http://apache.org/" target="_blank">Apache</a> (on port 88 for example) to produce the page. At the same time apache inserts the page into memcache, so it&#8217;s available to nginx for the next request.  A sample configuration nginx script would look something like this:</p>
<pre class="code"><a href="http://wiki.nginx.org/NginxHttpCoreModule#server"><span class="kw3">server</span></a> <span class="br0">{</span>
  <a rel="nofollow" href="http://wiki.nginx.org/NginxHttpCoreModule#location"><span class="kw3">location</span></a> / <span class="br0">{</span>
    <a rel="nofollow" href="http://wiki.nginx.org/NginxHttpRewriteModule#set"><span class="kw22">set</span></a> <span class="re0">$memcached_key</span> <span class="re0">$uri</span>;
    <a rel="nofollow" href="http://wiki.nginx.org/NginxHttpMemcachedModule#memcached_pass"><span class="kw20">memcached_pass</span></a>     name:<span class="nu0">11211</span>;
    <a rel="nofollow" href="http://wiki.nginx.org/NginxHttpCoreModule#default_type"><span class="kw3">default_type</span></a>       text/html;
    <a rel="nofollow" href="http://wiki.nginx.org/NginxHttpCoreModule#error_page"><span class="kw3">error_page</span></a>         <span class="nu0">404</span> = /fallback;
  <span class="br0">}</span>

  <a rel="nofollow" href="http://wiki.nginx.org/NginxHttpCoreModule#location"><span class="kw3">location</span></a> = /fallback <span class="br0">{</span>
    <a rel="nofollow" href="http://wiki.nginx.org/NginxHttpProxyModule#proxy_pass"><span class="kw21">proxy_pass</span></a> backend;
  <span class="br0">}</span>
<span class="br0">}</span></pre>
<p><span style="text-decoration: underline;"><strong>Additional Resources:</strong></span> <a rel="nofollow" href="http://nginx.net/" target="_blank">Nginx</a> <a rel="nofollow" href="http://www.danga.com/memcached/" target="_blank">Memcache</a> <a rel="nofollow" href="http://apache.org/" target="_blank">Apache</a><script type="text/javascript"><!--
google_ad_client = "pub-5075229468189091";
google_ad_slot = "2446713154";
google_ad_width = 468;
google_ad_height = 15;
// --></script><br />
<script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"></script></p>

<div style="font-size:0px;height:0px;line-height:0px;margin:0;padding:0;clear:both"></div>]]></content:encoded>
			<wfw:commentRss>http://articles.itecsoftware.com/web-development/nginx-and-memcached-module/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (enhanced)

Served from: articles.itecsoftware.com @ 2010-09-07 21:29:14 -->