<?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>Constant Shift &#187; Technology</title> <atom:link href="http://constantshift.com/category/technology/feed/" rel="self" type="application/rss+xml" /><link>http://constantshift.com</link> <description></description> <lastBuildDate>Sun, 22 Aug 2010 00:08:54 +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>Nginx Syntax Highlighting For Vim</title><link>http://constantshift.com/nginx-syntax-highlighting-for-vim/</link> <comments>http://constantshift.com/nginx-syntax-highlighting-for-vim/#comments</comments> <pubDate>Sun, 06 Jun 2010 00:39:29 +0000</pubDate> <dc:creator>TJ</dc:creator> <category><![CDATA[Technology]]></category> <category><![CDATA[bash]]></category> <category><![CDATA[nginx]]></category> <category><![CDATA[syntax highlighting]]></category> <category><![CDATA[vim]]></category><guid isPermaLink="false">http://constantshift.com/?p=213</guid> <description><![CDATA[I found this little gem by Evan Miller in the Vim scripts archive a few days ago and love it so far. If you&#8217;re working with Nginx configurations, even on a casual basis, it&#8217;s nice to have syntax highlighting. Although the Vim plugin directions are fairly straightforward, I thought I&#8217;d outline the complete process here. [...]]]></description> <content:encoded><![CDATA[<p>I found this little gem by <a href="http://www.vim.org/account/profile.php?user_id=12345" target="_blank">Evan Miller</a> in the Vim scripts archive a few days ago and love it so far. If you&#8217;re working with Nginx configurations, even on a casual basis, it&#8217;s nice to have syntax highlighting. Although the Vim plugin directions are fairly straightforward, I thought I&#8217;d outline the complete process here. Log into your box and running the following commands:</p><pre class="brush: bash;">$ /bin/mkdir -p ~/.vim/syntax/
$ cd ~/.vim/syntax/
$ wget http://www.vim.org/scripts/download_script.php?src_id=12990
$ mv download_script.php?src_id=12990 nginx.vim
$ touch ~/.vim/filetype.vim
$ echo &quot;au BufRead,BufNewFile /etc/nginx/* set ft=nginx&quot; &gt;&gt; ~/.vim/filetype.vim</pre><p><span id="more-213"></span></p><div id="attachment_216" class="wp-caption alignnone" style="width: 581px"><img class="size-full wp-image-216" title="Nginx Syntax Highlighting For Vim" src="http://205.186.144.142/wp-content/uploads/2010/06/nginx-vim21.gif" alt="Nginx Syntax Highlighting For Vim" width="571" height="582" /><p class="wp-caption-text">Nginx Syntax Highlighting For Vim</p></div> ]]></content:encoded> <wfw:commentRss>http://constantshift.com/nginx-syntax-highlighting-for-vim/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>Install PHP-FPM 5.3.2 on Ubuntu 10.04 (Lucid Lynx)</title><link>http://constantshift.com/install-php-fpm-5-3-2-on-ubuntu-10-04-lucid-lynx/</link> <comments>http://constantshift.com/install-php-fpm-5-3-2-on-ubuntu-10-04-lucid-lynx/#comments</comments> <pubDate>Mon, 31 May 2010 17:49:00 +0000</pubDate> <dc:creator>TJ</dc:creator> <category><![CDATA[Technology]]></category> <category><![CDATA[php]]></category> <category><![CDATA[php 5.3]]></category> <category><![CDATA[php-fpm]]></category> <category><![CDATA[php5-fpm]]></category><guid isPermaLink="false">http://constantshift.com/?p=211</guid> <description><![CDATA[A few weeks ago, we went through installing PHP-FPM on Ubuntu 9.10 (Karmic Koala). Now that (mt) Media Temple began offering Ubuntu 10.04 (Lucid Lynx) on their (ve) servers, I figured it was time to see if the installation process for Lucid was the same. It isn&#8217;t but fortunately, it&#8217;s even easier. If you&#8217;re working [...]]]></description> <content:encoded><![CDATA[<p>A few weeks ago, we went through <a href="http://constantshift.com/install-php-fpm-5-3-2-on-ubuntu-9-10/" target="_blank">installing PHP-FPM on Ubuntu 9.10</a> (Karmic Koala). Now that (mt) Media Temple began offering Ubuntu 10.04 (Lucid Lynx) on their (ve) servers, I figured it was time to see if the installation process for Lucid was the same. It isn&#8217;t but fortunately, it&#8217;s even easier.</p><p>If you&#8217;re working on a new (ve) server, we&#8217;ll only need 1 dependency met before we get started.</p><pre class="brush: bash;">$ aptitude install python-software-properties</pre><p>This package provides an abstraction of the used apt repositories. It allows you to easily manage your distribution and independent software vendor software sources. Since we&#8217;re going to be using a Launchpad PPA, we&#8217;ll need this tool to make adding packages easier. Personal Package Archives (PPA) allow you to upload Ubuntu source packages to be built and published as an apt repository by Launchpad. The one we&#8217;ll be using was brought to us by <a href="https://launchpad.net/~brianmercer" target="_blank">Brian Mercer</a>.</p><pre class="brush: bash;">$ add-apt-repository ppa:brianmercer/php</pre><p>You should see some gpg output. This is normal. Now that we&#8217;ve added the new apt repository, we need to update our sources list:</p><pre class="brush: bash;">$ aptitude -y update</pre><p>Now, install the preferred PHP packages. These are simply examples that I frequently use. The one you&#8217;ll need for this is example is php5-fpm:</p><pre class="brush: bash;">$ aptitude -y install php5-cli php5-common php5-mysql php5-suhosin php5-gd</pre><pre class="brush: bash;">$ aptitude -y install php5-fpm php5-cgi php-pear php5-memcache php-apc</pre><pre class="brush: bash;">$ service php5-fpm start</pre><p>Once you&#8217;ve started the PHP daemon, make sure the service is listening on port 9000:</p><pre class="brush: bash;">$ netstat -plan | grep :9000</pre>]]></content:encoded> <wfw:commentRss>http://constantshift.com/install-php-fpm-5-3-2-on-ubuntu-10-04-lucid-lynx/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>APC Plugin For Munin</title><link>http://constantshift.com/apc-plugin-for-munin/</link> <comments>http://constantshift.com/apc-plugin-for-munin/#comments</comments> <pubDate>Tue, 25 May 2010 07:59:48 +0000</pubDate> <dc:creator>TJ</dc:creator> <category><![CDATA[Technology]]></category> <category><![CDATA[apc]]></category> <category><![CDATA[git]]></category> <category><![CDATA[munin]]></category> <category><![CDATA[php]]></category><guid isPermaLink="false">http://constantshift.com/?p=208</guid> <description><![CDATA[If you&#8217;re like me, you want to monitor and graph every little piece of your server. Until recently, I&#8217;ve been relying on a simple PHP script to display APC statistics. Although the tool worked well, I wanted to integrate the statistics into Munin, as most all other server properties and system services are monitoring with [...]]]></description> <content:encoded><![CDATA[<p>If you&#8217;re like me, you want to monitor and graph every little piece of your server. Until recently, I&#8217;ve been relying on a simple PHP script to display APC statistics. Although the tool worked well, I wanted to integrate the statistics into Munin, as most all other server properties and system services are monitoring with it. The problem was that finding a suitable APC plugin for Munin proved to be very difficult. Fortunately I stumbled across <a href="http://geb.german-elite.net/blog.php?b=106" target="_new">this</a> German gem (Vielen Dank, dass Sie  meine deutsche Freundin!) that met my needs. To set this up on your system, just follow the directions below:</p><p>First, let&#8217;s set up the apcinfo.php file in the document root of your web server and retrieve the file from a private gist:</p><pre class="brush: bash;">$ cd /var/www/html
$ wget http://gist.github.com/raw/403135/8cbf9c71c5f82c2cda5af864c46f91910552e9f7/apcinfo.php</pre><p>Now, make the file executable:</p><pre class="brush: bash;">$ chmod +x apcinfo.php</pre><p>The script itself is very simple. It simply ouputs the total cache memory, memory available and memory used:</p><pre class="brush: php;">&lt;?php
$mem = apc_sma_info();
$mem_size = $mem['num_seg']*$mem['seg_size'];
$mem_avail= $mem['avail_mem'];
$mem_used = $mem_size-$mem_avail;
$out = array(
    'size: ' . sprintf(&quot;%.2f&quot;, $mem_size),
    'used: ' . sprintf(&quot;%.2f&quot;, $mem_used),
    'free: ' . sprintf(&quot;%.2f&quot;, $mem_avail)
    );

echo implode(' ', $out);</pre><p>To confirm that the script is working, check out /apcinfo.php on your site. You should see something like the following:</p><p style="text-align: center;"><em>size: 31457200.00 used: 19478104.00 free: 11979096.00</em></p><p>Now, let&#8217;s set up the Munin plugin that will use that information:</p><pre class="brush: bash;">$ cd /usr/share/munin/plugins
$ wget http://gist.github.com/raw/403127/51c7bf078d2ffd5b70da8b2380881648b3cc3481/apc
$ chmod +x apc
$ ln -s /usr/share/munin/plugins/apc /etc/munin/plugins/apc</pre><p>What that does is create the apc plugin, makes it executable and then symlinks it to the proper directory. Now, we&#8217;ll need to make sure Munin loads the new plugin. To do this, we&#8217;ll edit the <em>/etc/munin/plugin-conf.d/munin-node</em> to add the following:</p><pre class="brush: plain;">
[apc*]
user root
env.url http://example.com/apcinfo.php</pre><p>Obviously, you&#8217;ll want to replace example.com with the host you intend to use. Once the file has been updated and saved, restart Munin:</p><pre class="brush: bash;">$ /etc/init.d/munin-node restart</pre><p>Once the node is running, it&#8217;ll take a few minutes for Munin to update so don&#8217;t worry if you don&#8217;t see any new graphs right away. One thing to keep in mind is that you will need the <a href="http://search.cpan.org/~gaas/libwww-perl-5.836/lib/LWP/UserAgent.pm" target="_new">LWP::UserAgent</a> Perl module. If you are on a Debian/Ubuntu OS, just run the following to install it:</p><pre class="brush: bash;">$ aptitude install libwww-perl</pre><p>Now, go check your pretty graphs:</p><div id="attachment_209" class="wp-caption aligncenter" style="width: 513px"><img class="size-full wp-image-209" title="What an interesting graph!" src="http://205.186.144.142/wp-content/uploads/2010/05/apc1.gif" alt="What an interesting graph!" width="503" height="297" /><p class="wp-caption-text">What an interesting graph!</p></div> ]]></content:encoded> <wfw:commentRss>http://constantshift.com/apc-plugin-for-munin/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Simple Load Balancing Using Nginx</title><link>http://constantshift.com/simple-load-balancing-using-nginx/</link> <comments>http://constantshift.com/simple-load-balancing-using-nginx/#comments</comments> <pubDate>Fri, 23 Apr 2010 19:08:21 +0000</pubDate> <dc:creator>TJ</dc:creator> <category><![CDATA[Technology]]></category> <category><![CDATA[haproxy]]></category> <category><![CDATA[load balancer]]></category> <category><![CDATA[lvs]]></category> <category><![CDATA[nginx]]></category> <category><![CDATA[pound]]></category> <category><![CDATA[Ubuntu]]></category><guid isPermaLink="false">http://constantshift.com/?p=204</guid> <description><![CDATA[While the concept of load balancing has been around for a while, using Nginx to do this is fairly new to me. Other common load balancers in use today are LVS, HAProxy, Perlbal and Pound. In this example, I am using 3 (ve) servers from Media Temple, each running on Ubuntu 9.10. To get started, [...]]]></description> <content:encoded><![CDATA[<p>While the concept of load balancing has been around for a while, using Nginx to do this is fairly new to me. Other common load balancers in use today are <a title="LVS" href="http://www.linuxvirtualserver.org/" target="_blank">LVS</a>, <a title="HAProxy" href="http://haproxy.1wt.eu/" target="_blank">HAProxy</a>, <a title="Perlbal" href="http://www.danga.com/perlbal/" target="_blank">Perlbal</a> and <a title="Pound" href="http://www.apsis.ch/pound/" target="_blank">Pound</a>. In this example, I am using 3 <a href="http://www.mediatemple.net/webhosting/ve/" target="_new">(ve) servers</a> from Media Temple, each running on Ubuntu 9.10. To get started, log into the server you want to set up as the load balancer and install Nginx:</p><pre class="brush: bash;">
$ aptitude install nginx
</pre><p>Then we&#8217;ll need to make a new Nginx default virtual host, <em>/etc/nginx/sites-available/default</em>. In the two server directives under the upstream backend section, be sure to put in the IP addresses or hosts you are balancing:</p><pre class="brush: plain;">
upstream backend  {
  server 123.123.123.123;
  server 123.123.123.124;
}

server {
  location / {
    proxy_pass  http://backend;
  }
}</pre><p>This is the simplest configuration possible. After you&#8217;ve completed the proxy configuration, test and restart Nginx:</p><pre class="brush: bash;">
$ nginx -t
$ /etc/init.d/nginx restart</pre><p>At this point, requests handled by the load balancer will serve equal requests from each upstream server. The really nice thing is that if one of the upstream servers is not responding, the load balancer will automagically stop routing requests to it. So although the configuration has the unavailable server loaded, Nginx sees that it is down and then routes to all other available upstream servers. If all upstreams are down, Nginx will halt the proxy, simply showing a 502 http error. This also makes it a very useful tool for balancing mongrels for those running rails.</p><p>It&#8217;s also worth noting that you can add as many backend nodes as you want; I&#8217;m just using two as an example. This makes using a (ve) server an ideal choice; spin up a new (ve) and simply add it to the upstream pool. There are a few other configuration options that provide the ability to add weight to backends to force an uneven load distribution. You can also use <em>proxy_set_header</em> to make sure the user&#8217;s IP address is logged instead of localhost:</p><pre class="brush: plain;">
upstream backend  {
  server john.constantshift.com;
  server paul.constantshift.com;
  server ringo.constantshift.com;
  server george.constantshift.com weight=30; # George was always my favorite
}

server {
  server_name www.constantshift.com constantshift.com;
  location / {
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_pass  http://backend;
  }
}</pre><p>Nginx provides many other configuration directives so I would recommend checking the official Nginx documentation on the <a href="http://wiki.nginx.org/NginxHttpUpstreamModule" target="_blank">NginxHttpUpstreamModule</a> for more information. In the next post, we&#8217;ll look at using a few file synchronization tools like <a title="Unison" href="http://www.cis.upenn.edu/~bcpierce/unison/" target="_blank">Unison</a> and <a title="rsync" href="http://samba.anu.edu.au/rsync/" target="_blank">rsync</a> for data replication between backends.</p> ]]></content:encoded> <wfw:commentRss>http://constantshift.com/simple-load-balancing-using-nginx/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Install PHP-FPM 5.3.2 on Ubuntu 9.10</title><link>http://constantshift.com/install-php-fpm-5-3-2-on-ubuntu-9-10/</link> <comments>http://constantshift.com/install-php-fpm-5-3-2-on-ubuntu-9-10/#comments</comments> <pubDate>Sun, 28 Mar 2010 23:12:03 +0000</pubDate> <dc:creator>TJ</dc:creator> <category><![CDATA[Technology]]></category> <category><![CDATA[dotdeb]]></category> <category><![CDATA[php]]></category> <category><![CDATA[php 5.3]]></category> <category><![CDATA[php-fpm]]></category> <category><![CDATA[php5-fpm]]></category> <category><![CDATA[Ubuntu]]></category><guid isPermaLink="false">http://constantshift.com/?p=202</guid> <description><![CDATA[Until PHP-FPM is included in PHP core, installing PHP-FPM is kind of a pain. Fortunately, it looks like it will be included in PHP 5.4. For now, installing PHP-FPM now can be done in a few different ways: Using SVN. This version is based off of the 0.6.x series in Launchpad. This method is considered [...]]]></description> <content:encoded><![CDATA[<p>Until PHP-FPM is included in PHP core, installing PHP-FPM is kind of a pain. Fortunately, it looks like it will be included in PHP 5.4. For now, installing PHP-FPM now can be done in a few different ways:</p><ul><li>Using SVN. This version is based off of the 0.6.x series in <a href="https://launchpad.net/php-fpm" target="_blank">Launchpad</a>. This method is considered experimental and has a <a href="http://www.mail-archive.com/ubuntu-server-bugs@lists.ubuntu.com/msg14505.html" target="_blank">few</a> <a href="http://serverfault.com/questions/122417/how-to-install-php-fpm-and-php-on-ubuntu" target="_blank">known</a> <a href="https://bugs.launchpad.net/ubuntu/+source/php5/+bug/411890" target="_blank">issues</a> reported.</li></ul><pre class="brush: bash;">
$ svn co http://svn.php.net/repository/php/php-src/branches/PHP_5_3_FPM php_5_3_fpm
$ cd php_5_3_fpm
$ ./buildconf --force
$ ./configure --enable-fpm --with-foo --enable-bar...
$ make &amp;&amp; make install
</pre><ul><li>The stable <a href="http://constantshift.com/compiling-php-5-3-0-with-fpm/">patch</a> method works well however it still requires you to compile PHP manually. This is considered the most reliable method.</li></ul><ul><li>The easiest method is to use apt-get. This is what we&#8217;ll be using here.</li></ul><pre class="brush: bash;">
$ cd /tmp
$ wget http://us.archive.ubuntu.com/ubuntu/pool/main/k/krb5/libkrb53_1.6.dfsg.4~beta1-5ubuntu2_amd64.deb
$ wget http://us.archive.ubuntu.com/ubuntu/pool/main/i/icu/libicu38_3.8-6ubuntu0.2_amd64.deb
$ dpkg -i *.deb
$ echo &quot;deb http://php53.dotdeb.org stable all&quot; &gt;&gt; /etc/apt/sources.list
$ apt-get --force-yes update
$ apt-get --force-yes install php5-cli php5-common php5-mysql php5-suhosin
$ apt-get --force-yes install php5-fpm php5-cgi php-pear php5-memcache</pre><p>Use the &#8211;force-yes flag in the commands above to roll past the package warnings. Now, start the daemon and clean up the /tmp directory:</p><pre class="brush: bash;">
$ /etc/init.d/php5-fpm start
$ rm -rf /tmp/lib*</pre><p>To check if the install was successful, use the following:</p><pre class="brush: bash;">$ php -v</pre><p>You should see something like the following output:</p><pre class="brush: bash;">PHP 5.3.2-0.dotdeb.1 with Suhosin-Patch (cli) (built: Mar  9 2010 11:42:01)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
    with Suhosin v0.9.29, Copyright (c) 2007, by SektionEins GmbH</pre><p><strong>Notes:</strong></p><ul><li>To meet the required dependencies, you&#8217;ll need to install <em>libxml2-dev</em> and <em>libevent-dev</em> before you get started.</li></ul><ul><li>If you are running Karmic in 32-bit, replace <em>amd64</em> with <em>i386</em> in the  dependencies used above.</li></ul> ]]></content:encoded> <wfw:commentRss>http://constantshift.com/install-php-fpm-5-3-2-on-ubuntu-9-10/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>Nginx Error: Increase server_names_hash_bucket_size</title><link>http://constantshift.com/nginx-error-increase-server_names_hash_bucket_size/</link> <comments>http://constantshift.com/nginx-error-increase-server_names_hash_bucket_size/#comments</comments> <pubDate>Sat, 06 Feb 2010 01:40:16 +0000</pubDate> <dc:creator>TJ</dc:creator> <category><![CDATA[Technology]]></category> <category><![CDATA[nginx]]></category><guid isPermaLink="false">http://constantshift.com/nginx-error-increase-server_names_hash_bucket_size/</guid> <description><![CDATA[During an initial server build with Nginx, I was having trouble starting the web server. Testing the Nginx configuration, the reported error was: $ nginx -t 2010/02/05 17:18:23 [emerg] 12299#0: could not build the server_names_hash, you should increase server_names_hash_bucket_size: 32 2010/02/05 17:18:23 [emerg] 12299#0: the configuration file /etc/nginx/nginx.conf test failed The server_names_hash_bucket_size is one of [...]]]></description> <content:encoded><![CDATA[<p>During an initial server build with Nginx, I was having trouble starting the web server. Testing the Nginx configuration, the reported error was:</p><pre class="brush: bash;">$ nginx -t
2010/02/05 17:18:23 [emerg] 12299#0: could not build the server_names_hash, you should increase server_names_hash_bucket_size: 32
2010/02/05 17:18:23 [emerg] 12299#0: the configuration file /etc/nginx/nginx.conf test failed
</pre><p>The <em>server_names_hash_bucket_size</em> is one of the directives in the core HTTP module for Nginx. This directive assigns the size of basket in the hash-tables of the names of  servers. The hash bucket size is always equal to, or in multiples of, the size of the line of processor cache. As you can see from the error, the default on my Debian Lenny virtual machine was 32. After checking out the <a href="http://wiki.nginx.org/NginxHttpCoreModule#server_names_hash_bucket_size" target="_new">official documentation</a>, I found that I simply had to increase the default bucket size from 32 to 128 in the nginx.conf. Test the configuration again and make sure the output is clean:</p><pre class="brush: bash;">$ nginx -t
2010/02/05 17:22:57 [info] 21732#0: the configuration file /etc/nginx/nginx.conf syntax is ok
2010/02/05 17:22:57 [info] 21732#0: the configuration file /etc/nginx/nginx.conf was tested successfully</pre>]]></content:encoded> <wfw:commentRss>http://constantshift.com/nginx-error-increase-server_names_hash_bucket_size/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Fix PECL Error: &#039;/bin/sh: bad interpreter: Permission denied&#039;</title><link>http://constantshift.com/fix-pecl-error-binsh-bad-interpreter-permission-denied/</link> <comments>http://constantshift.com/fix-pecl-error-binsh-bad-interpreter-permission-denied/#comments</comments> <pubDate>Wed, 27 Jan 2010 08:41:14 +0000</pubDate> <dc:creator>TJ</dc:creator> <category><![CDATA[Technology]]></category> <category><![CDATA[php]]></category><guid isPermaLink="false">http://constantshift.com/?p=199</guid> <description><![CDATA[Continuing off my last post on PECL issues, I&#8217;ve run into additional problems installing PECL extensions on my CentOS 5.4 server. Now that PECL is able to at least run, I was seeing permission issues as it finished compiling: $ pecl install apc downloading APC-3.0.19.tgz &#8230; Starting to download APC-3.0.19.tgz (115,735 bytes) &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.done: 115,735 bytes [...]]]></description> <content:encoded><![CDATA[<p>Continuing off my <a href="http://constantshift.com/fixing-unsupported-protocol-error-with-pecl/" target="_self">last post</a> on PECL issues, I&#8217;ve run into additional problems installing PECL extensions on my CentOS 5.4 server. Now that PECL is able to at least run, I was seeing permission issues as it finished compiling:</p><pre class="brush: bash;">$ pecl install apc</pre><blockquote><p><em>downloading APC-3.0.19.tgz &#8230;<br /> Starting to download APC-3.0.19.tgz (115,735 bytes)<br /> &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.done: 115,735 bytes<br /> 47 source files, building<br /> running: phpize<br /> Configuring for:<br /> PHP Api Version: 20041225<br /> Zend Module Api No: 20060613<br /> Zend Extension Api No: 220060519<br /> /usr/local/bin/phpize: /tmp/pear/temp/APC/build/shtool: /bin/sh: bad interpreter: Permission denied<br /> Cannot find autoconf. Please check your autoconf installation and the $PHP_AUTOCONF environment variable. Then, rerun this script.</em></p><p><em>ERROR: &#8216;phpize&#8217; failed</em></p></blockquote><p>The problem is that for security reasons, the /tmp file system is mounted with the noexec flag. You can check this by executing the following command:</p><pre class="brush: bash;">$ mount | grep \/tmp
simfs on /tmp type simfs (rw,noexec)
simfs on /var/tmp type simfs (rw,noexec)</pre><p>To fix this, you can temporary remount the directory to make it executable. To do this, issue the following command:</p><pre class="brush: bash;">$ mount -o remount,exec /tmp</pre><p>Once you&#8217;ve installed the extension, remount the directory again to set it back to noexec:</p><pre class="brush: bash;">$ mount -o remount,noexec /tmp</pre>]]></content:encoded> <wfw:commentRss>http://constantshift.com/fix-pecl-error-binsh-bad-interpreter-permission-denied/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Fixing &#039;Unsupported Protocol&#039; Error with PECL</title><link>http://constantshift.com/fixing-unsupported-protocol-error-with-pecl/</link> <comments>http://constantshift.com/fixing-unsupported-protocol-error-with-pecl/#comments</comments> <pubDate>Wed, 27 Jan 2010 02:54:31 +0000</pubDate> <dc:creator>TJ</dc:creator> <category><![CDATA[Technology]]></category><guid isPermaLink="false">http://constantshift.com/?p=198</guid> <description><![CDATA[After installing PHP 5.2.10, I wanted to setup a few additional modules using PECL. I found soon after that I was unable to do so because of the following error: pear.php.net is using a unsupported protocal – This should never happen. install failed The problem seems to exhibit itself in corrupted PEAR installations with PHP [...]]]></description> <content:encoded><![CDATA[<p>After installing PHP 5.2.10, I wanted to setup a few additional modules using PECL. I found soon after that I was unable to do so because of the following error:</p><blockquote><p><em>pear.php.net is using a unsupported protocal – This should never happen. install failed</em></p></blockquote><p>The problem seems to exhibit itself in corrupted PEAR installations with PHP 5.2.9 and 5.2.10. To fix this, we&#8217;ll update the channels:</p><pre class="brush: bash;">$ mv /usr/local/lib/php/.channels /usr/local/lib/php/.channels.bak</pre><pre class="brush: bash;">$ pear update-channels</pre><p>After that, you should be good to go.</p> ]]></content:encoded> <wfw:commentRss>http://constantshift.com/fixing-unsupported-protocol-error-with-pecl/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>WordPress Permalinks in Nginx</title><link>http://constantshift.com/wordpress-permalinks-in-nginx/</link> <comments>http://constantshift.com/wordpress-permalinks-in-nginx/#comments</comments> <pubDate>Fri, 22 Jan 2010 19:37:40 +0000</pubDate> <dc:creator>TJ</dc:creator> <category><![CDATA[Technology]]></category> <category><![CDATA[nginx]]></category> <category><![CDATA[WordPress]]></category><guid isPermaLink="false">http://constantshift.com/wordpress-permalinks-in-nginx/</guid> <description><![CDATA[Setting up permalinks in WordPress is very easy in Apache. A few lines of mod_rewrite in the .htaccess and you&#8217;ve got pretty URLs. If you plan on using Nginx, the process is a bit different however the idea is the same. Essentially, you&#8217;ll want to add rewrite request directive in the virtual host configuration. This [...]]]></description> <content:encoded><![CDATA[<p>Setting up <a href="http://en.wikipedia.org/wiki/Permalink">permalinks</a> in WordPress is very easy in Apache. A few lines of mod_rewrite in the .htaccess and you&#8217;ve got pretty URLs. If you plan on using Nginx, the process is a bit different however the idea is the same. Essentially, you&#8217;ll want to add rewrite request directive in the virtual host configuration. This may vary depending on how you set up Nginx but this is the code you&#8217;ll need:</p><pre class="brush: plain;">if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php?q=$1 last;
break; }</pre><p>You can place the rewrite directive in the <a href="http://wiki.nginx.org/NginxHttpCoreModule#location">location</a> section. Here is what I am using with this blog:</p><pre class="brush: plain;">
location / {
    root   /var/www/constantshift.com/public/;
    index  index.php;
    if (!-e $request_filename) {
       rewrite ^/(.*)$ /index.php?q=$1 last;
       break;
    }
}</pre>]]></content:encoded> <wfw:commentRss>http://constantshift.com/wordpress-permalinks-in-nginx/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Configuring Munin Plugins for Varnish with Git</title><link>http://constantshift.com/configuring-varnish-plugins-for-munin-with-git/</link> <comments>http://constantshift.com/configuring-varnish-plugins-for-munin-with-git/#comments</comments> <pubDate>Sun, 27 Dec 2009 05:20:32 +0000</pubDate> <dc:creator>TJ</dc:creator> <category><![CDATA[Technology]]></category> <category><![CDATA[git]]></category> <category><![CDATA[munin]]></category> <category><![CDATA[nginx]]></category> <category><![CDATA[perl]]></category> <category><![CDATA[Varnish]]></category><guid isPermaLink="false">http://constantshift.com/?p=194</guid> <description><![CDATA[I&#8217;ve been using Varnish as a proxy to Nginx for some time and have really been impressed with some of the performance benefits I&#8217;ve seen. Although this site doesn&#8217;t generate enough traffic to warrant this type of setup, I&#8217;ve wanted to at least monitor and track cache hits and misses for Varnish. Enter Munin. Munin [...]]]></description> <content:encoded><![CDATA[<p>I&#8217;ve been using <a href="http://varnish.projects.linpro.no/">Varnish</a> as a proxy to <a href="http://wiki.nginx.org/Main">Nginx</a> for some time and have really been impressed with some of the performance benefits I&#8217;ve seen. Although this site doesn&#8217;t generate enough traffic to warrant this type of setup, I&#8217;ve wanted to at least monitor and track cache hits and misses for Varnish. Enter <a href="http://munin.projects.linpro.no/">Munin</a>.</p><p>Munin is a networked resource monitoring tool that can help analyze resource trends and &#8220;what just happened to kill our performance?&#8221; problems. It is designed to be very plug and play. A default installation provides a lot of graphs with almost no work. For my setup, I&#8217;ve got Munin, the grapher/gatherer, running on another (dv) Dedicated Virtual Server from (mt) Media Temple that does all the leg work. Then I&#8217;ve got Munin nodes running on a few different servers. The default resources monitored are network throughput, disk usage, MySQL, load, ram, entropy, etc.</p><p>To start monitoring Varnish, we&#8217;ll need to setup a Munin plugin that is available on <a href="http://github.com/basiszwo/munin-varnish">GitHub</a>. For this, you&#8217;ll need <a href="http://git-scm.com/">Git</a>:</p><pre class="brush: bash;">$ aptitude install git-core</pre><p>Navigate to your Munin&#8217;s plugin directory, usually /usr/share/munin/plugins:</p><pre class="brush: bash;">$ cd /usr/share/munin/plugins</pre><p>Now clone the repository with Git:</p><pre class="brush: bash;">$ git clone git://github.com/basiszwo/munin-varnish.git</pre><p>Now, let&#8217;s make things executable:</p><pre class="brush: bash;">$ chmod a+x /usr/share/munin/plugins/munin-varnish/varnish_*</pre><p>Then symlink the new plugins to the configuration directory, usually in /etc/munin:</p><pre class="brush: bash;">$ ln -s /usr/share/munin/plugins/munin-varnish/varnish_* /etc/munin/plugins/</pre><p>For most, this should be your final step. Change your Munin node configuration by adding the following to /etc/munin/plugin-conf.d/munin-node:</p><pre class="brush: plain;">[varnish*]
user root</pre><p>Restart the Munin node daemon and check the munin-node.log for errors:</p><pre class="brush: bash;">$ /etc/init.d/munin-node restart
$ tail -f /var/log/munin/munin-node.log
</pre><p>Not so fast. You&#8217;re missing a Perl module:</p><pre class="brush: bash;">Can't locate Net/Telnet.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.10.0 /usr/local/share/perl/5.10.0 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .) at /etc/munin/plugins/varnish_varnishstat_ line 2.</pre><p>No problem. Let&#8217;s install the <a href="http://search.cpan.org/~jrogers/Net-Telnet-3.03/lib/Net/Telnet.pm" target="_blank">Net::Telnet</a> Perl module:</p><pre class="brush: bash;">$ wget http://search.cpan.org/CPAN/authors/id/J/JR/JROGERS/Net-Telnet-3.03.tar.gz
$ tar -zxvf Net-Telnet-3.03.tar.gz
$ cd Net-Telnet-3.03
$ perl Makefile.PL
$ make
$ make test
$ make install</pre><p>If you are on a Debian/Ubuntu OS, you can simply also use the following to install the Net::Telnet Perl module</p><pre class="brush: bash;">$ aptitude install libnet-telnet-perl</pre><p>If the module is installed successfully, you should restart Munin node again and check for pretty graphs:</p><div id="attachment_195" class="wp-caption aligncenter" style="width: 449px"><img class="size-full wp-image-195" title="Varnish Graph" src="http://205.186.144.142/wp-content/uploads/2009/12/munin1.gif" alt="Varnish Graph" width="439" height="272" /><p class="wp-caption-text">Varnish Graph</p></div> ]]></content:encoded> <wfw:commentRss>http://constantshift.com/configuring-varnish-plugins-for-munin-with-git/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) (user agent is rejected)
Database Caching 9/17 queries in 0.010 seconds using disk
Object Caching 682/702 objects using disk
Content Delivery Network via Amazon Web Services: S3: constantshift.s3.amazonaws.com

Served from: constantshift.com @ 2010-09-07 16:45:16 -->