<?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>Life on Ubuntu</title>
	<atom:link href="http://lifeonubuntu.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://lifeonubuntu.com</link>
	<description>Ubuntu tips, tricks and solutions</description>
	<lastBuildDate>Fri, 24 May 2013 02:28:22 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>NetBeans Search Results Files Open in Output Panel Instead of Main Panel</title>
		<link>http://lifeonubuntu.com/netbeans-search-opens-in-wrong-panel/</link>
		<comments>http://lifeonubuntu.com/netbeans-search-opens-in-wrong-panel/#comments</comments>
		<pubDate>Wed, 01 May 2013 14:03:39 +0000</pubDate>
		<dc:creator>Editor</dc:creator>
				<category><![CDATA[NetBeans]]></category>

		<guid isPermaLink="false">http://lifeonubuntu.com/?p=276</guid>
		<description><![CDATA[I sometimes use NetBeans for PHP projects on my Windows laptop. I recently ran into a really annoying problem when doing a &#8220;Find in Projects&#8221; search. The search works fine, but when I double-click on a search result, the source file opens in the output panel right next to the search results. It should, of [...]<div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href='http://lifeonubuntu.com/firefox-dropdown-menus-are-flickering-on-2nd-monitor/' rel='bookmark' title='Firefox dropdown menus are flickering on 2nd monitor'>Firefox dropdown menus are flickering on 2nd monitor</a> <small>The Problem: Firefox Menus Flicker and Go Blank Had a...</small></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[</p>
<p>I sometimes use NetBeans for PHP projects on my Windows laptop. I recently ran into a really annoying problem when doing a &#8220;Find in Projects&#8221; search.  The search works fine, but when I double-click on a search result, the source file opens in the output panel right next to the search results.  It should, of course, be opening in the main window with the other source file.</p>
<p>This was driving me nuts, until I finally found the solution:</p>
<p><em>Reset the windows from the menu with Windows &#8211;> Reset Windows</em></p>
<p>That solved the problem instantly.</p>
<p>FYI, I think weird symptom started happening after I accidentally un-docked and then re-docked the output panel or the search results tab.</p>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href='http://lifeonubuntu.com/firefox-dropdown-menus-are-flickering-on-2nd-monitor/' rel='bookmark' title='Firefox dropdown menus are flickering on 2nd monitor'>Firefox dropdown menus are flickering on 2nd monitor</a> <small>The Problem: Firefox Menus Flicker and Go Blank Had a...</small></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://lifeonubuntu.com/netbeans-search-opens-in-wrong-panel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>W3 Total Cache Not Showing Config Tabs for WordPress Multisite Network</title>
		<link>http://lifeonubuntu.com/w3tc-not-working-wordpress-multisite-network/</link>
		<comments>http://lifeonubuntu.com/w3tc-not-working-wordpress-multisite-network/#comments</comments>
		<pubDate>Fri, 05 Apr 2013 15:42:54 +0000</pubDate>
		<dc:creator>Editor</dc:creator>
				<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://lifeonubuntu.com/?p=263</guid>
		<description><![CDATA[We&#8217;ve been using the WordPress W3 Total Cache plugin to speed up our WordPress sites. It rocks. And after a long hiatus, the author Frederick Townes finally updated it and now he&#8217;s giving it lots of attention. Thanks Frederick. Now it rocks even more!!! But&#8230; when we first upgraded, it didn&#8217;t seem to work. The [...]<div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href='http://lifeonubuntu.com/php-apc-how-to-monitor-usage-and-config-for-optimum-performance/' rel='bookmark' title='PHP APC: How to Monitor Usage and Config for Optimum Performance'>PHP APC: How to Monitor Usage and Config for Optimum Performance</a> <small>APC is the Alternative PHP Cache. It&#8217;s a handy caching...</small></li>
<li><a href='http://lifeonubuntu.com/how-to-upgrade-apc-on-ubunutu/' rel='bookmark' title='How to Upgrade APC on Ubunutu'>How to Upgrade APC on Ubunutu</a> <small>APC &#8212; the Alternative PHP Cache &#8212; is a handy...</small></li>
<li><a href='http://lifeonubuntu.com/how-to-password-protect-wordpress-admin-or-any-apache-directory/' rel='bookmark' title='How to Password Protect WordPress Admin (or Any) Apache Directory'>How to Password Protect WordPress Admin (or Any) Apache Directory</a> <small>If you are running WordPress, it&#8217;s a good idea to...</small></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[</p>
<p>We&#8217;ve been using the WordPress W3 Total Cache plugin to speed up our WordPress sites. It rocks.  And after a long hiatus, the author Frederick Townes finally updated it and now he&#8217;s giving it lots of attention.  Thanks Frederick.  Now it rocks even more!!!</p>
<p>But&#8230; when we first upgraded, it didn&#8217;t seem to work. </p>
<h2>The Proglem: W3 Total Cache Not Working on Multisite Install</h2>
<p>You should not that we run a WordPress multisite network.  We use W3TC on only a few sites, and it always worked great.</p>
<p>But, when we upgraded to the new and improved W3TC, the WP admin showed only a title page Dashboard.  And annoyingly, its primary purpose seemed to be selling us premium services.  (No worries Frederick, we know you deserve to get paid!)</p>
<p>There were no config tabs or menus, and we couldn&#8217;t figure out if it was even running or not.</p>
<p>Bummer!</p>
<h2>The Solution: Change the Network Config Setting</h2>
<p>The solution turned out to be very easy, albeit darn hard to find.</p>
<p>To fix the problem, go to your Network Admin site and configure W3TC there.  On the Performance &#8211;> General Settings Tab, scroll down to the Miscellaneous section near the bottom.  There, you need to uncheck &#8220;Use single network configuration file for all sites.&#8221;</p>
<p>Hit save, and BINGO! You should be all set.</p>
<div id="attachment_265" class="wp-caption aligncenter" style="width: 710px"><img src="http://lifeonubuntu.com/files/2013/04/w3tc-network-config.png" alt="W3TC Multisite Network Config" width="700" height="521" class="size-full wp-image-265" />
<p class="wp-caption-text">Uncheck the box and W3TC will work as expected on WordPress Multisite Network installations.</p>
</div>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href='http://lifeonubuntu.com/php-apc-how-to-monitor-usage-and-config-for-optimum-performance/' rel='bookmark' title='PHP APC: How to Monitor Usage and Config for Optimum Performance'>PHP APC: How to Monitor Usage and Config for Optimum Performance</a> <small>APC is the Alternative PHP Cache. It&#8217;s a handy caching...</small></li>
<li><a href='http://lifeonubuntu.com/how-to-upgrade-apc-on-ubunutu/' rel='bookmark' title='How to Upgrade APC on Ubunutu'>How to Upgrade APC on Ubunutu</a> <small>APC &#8212; the Alternative PHP Cache &#8212; is a handy...</small></li>
<li><a href='http://lifeonubuntu.com/how-to-password-protect-wordpress-admin-or-any-apache-directory/' rel='bookmark' title='How to Password Protect WordPress Admin (or Any) Apache Directory'>How to Password Protect WordPress Admin (or Any) Apache Directory</a> <small>If you are running WordPress, it&#8217;s a good idea to...</small></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://lifeonubuntu.com/w3tc-not-working-wordpress-multisite-network/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Photoshop Tips, Tricks, and Shortcut Keys</title>
		<link>http://lifeonubuntu.com/photoshop-tips-tricks-and-shortcut-keys/</link>
		<comments>http://lifeonubuntu.com/photoshop-tips-tricks-and-shortcut-keys/#comments</comments>
		<pubDate>Sun, 17 Mar 2013 19:28:01 +0000</pubDate>
		<dc:creator>Editor</dc:creator>
				<category><![CDATA[Photoshop]]></category>

		<guid isPermaLink="false">http://lifeonubuntu.com/?p=252</guid>
		<description><![CDATA[I use Adobe Photoshop on a pretty regular basis. But I still find I need to look things up from time to time. Sometimes I look things up because I&#8217;ve been doing it &#8220;the way I know how,&#8221; but I know that that must be a better (usually faster and easier) way and I am [...]<div class='yarpp-related-rss yarpp-related-none'>

No related posts.
</div>
]]></description>
				<content:encoded><![CDATA[</p>
<p>I use Adobe Photoshop on a pretty regular basis.  But I still find I need to look things up from time to time.  </p>
<p>Sometimes I look things up because I&#8217;ve been doing it &#8220;the way I know how,&#8221; but I know that that must be a better (usually faster and easier) way and I am finally taking the time to find it.  Sometimes &#8212; and most annoyingly &#8212; it&#8217;s something I have used dozens of times but I use too infrequently to remember.</p>
<p>So, this is my personal list of things I&#8217;ve had to look up once or twice, plus things I am sick of repeatedly looking up. Perhaps you&#8217;ll find it useful, too <img src='http://lifeonubuntu.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<h2>How to Create the Copyright Symbol</h2>
<p>I&#8217;ve looked this up a million times because I just can&#8217;t remember the numbers.  Here&#8217;s how:</p>
<p>On the numeric keypad (not the top row of numbers, but the separate numeric keypad), hold down the ALT key and type 0169.</p>
<h2>How to Create a Bullet Symbol</h2>
<p>This is the same as the copyright symbol, except the code is 0149:</p>
<p>Hold the ALT key and type 0149. (Note that it only appears once you finish typing the number and then let go of the ALT key.)</p>
<h2>How to Resize a Layer</h2>
<p>On the Edit menu &#8211;> Free Transform.</p>
<p>Or, much easier, CTRL-T</p>
<p>You can resize, flip, rotate, etc.  When you are done changing the layer, press the enter key to accept the changes.  Or press escape to cancel.</p>
<h2>How to Select All Layers in a Photoshop Document</h2>
<p>You can select all the layers in by clicking CTRL-ALT-A.  (Command-Option-A on a Mac)</p>
<p>Then you can do things like right-click, choose duplicate, and copy all the layers from one document to another!</p>
<h2>How to Turn Guidelines on and Off</h2>
<p>You don&#8217;t turn them on and off.  You &#8220;Hide&#8221; and show them with CTRL-H.</p>
<h2>How to Remove (or Minimize) the Seam Between Layers</h2>
<p>This is helpful for stitching images together to make a panorama.  But it&#8217;s also very useful if you are trying to make an image a bit wider by copying and pasting the sides to extend it in the direction that you want.</p>
<p>Select the layers and then choose Edit &#8211;> Auto-Blend Layers.</p>
<h2>Soften the Edges of a Layer After Changing the Background Color</h2>
<div id="attachment_281" class="wp-caption alignright" style="width: 162px"><a href="http://lifeonubuntu.com/files/2013/03/apple-soften-edges.jpg"><img src="http://lifeonubuntu.com/files/2013/03/apple-soften-edges.jpg" alt="Soften layer edges after changing the background" width="152" height="96" class="size-full wp-image-281" /></a>
<p class="wp-caption-text">The before and after images.  Inner glow removed the residual white edges.</p>
</div>
<p>I had an apple on a white background and I had to change the background to white.  I used the magic eraser tool with a high tolerance and anti-alias, but it came out with white edges.</p>
<p>The fix? Add an inner glow to the layer.  In this case, I set the blend mode to &#8220;darken.&#8221;  For the inner glow color, I used the color picker to pick a red from the apple.</p>
<div class='yarpp-related-rss yarpp-related-none'>
<p>No related posts.</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://lifeonubuntu.com/photoshop-tips-tricks-and-shortcut-keys/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Password Protect WordPress Admin (or Any) Apache Directory</title>
		<link>http://lifeonubuntu.com/how-to-password-protect-wordpress-admin-or-any-apache-directory/</link>
		<comments>http://lifeonubuntu.com/how-to-password-protect-wordpress-admin-or-any-apache-directory/#comments</comments>
		<pubDate>Fri, 25 Jan 2013 18:09:42 +0000</pubDate>
		<dc:creator>Editor</dc:creator>
				<category><![CDATA[apache]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://lifeonubuntu.com/?p=243</guid>
		<description><![CDATA[If you are running WordPress, it&#8217;s a good idea to lock down the WordPress admin. Sure, it&#8217;s password protected already. But you can (and should) add some extra security to lessen your vulnerability to any newly discovered PHP or WordPress security bugs. Background We recently enhanced our own WordPress security and added an extra layer [...]<div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href='http://lifeonubuntu.com/what-is-the-apache-directive-order-of-precedence/' rel='bookmark' title='What is the Apache directive order of precedence?'>What is the Apache directive order of precedence?</a> <small>I am trying to implement some mod_rewrite RewriteRules using WordPressMU....</small></li>
<li><a href='http://lifeonubuntu.com/how-to-change-your-password-from-the-command-line/' rel='bookmark' title='How to change your password from the command line'>How to change your password from the command line</a> <small>To change your own password from the command line: To...</small></li>
<li><a href='http://lifeonubuntu.com/setup-wp-wpmu-for-atomic-version-switch-and-revert/' rel='bookmark' title='Setup WordPress or WPMU to make an atomic version switch &#8212; AND allow you to revert'>Setup WordPress or WPMU to make an atomic version switch &#8212; AND allow you to revert</a> <small>I have a new WordPress MU (WPMU) install and I...</small></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[</p>
<p>If you are running WordPress, it&#8217;s a good idea to lock down the WordPress admin.  Sure, it&#8217;s password protected already.  But you can (and should) add some extra security to lessen your vulnerability to any newly discovered PHP or WordPress security bugs.</p>
<h2>Background</h2>
<p>We recently enhanced our own WordPress security and added an extra layer of authentication. Other sites like Mashable do the same thing: <a href="http://mashable.com/wp-admin/" title="Mashable WordPress Admin" target="_blank">Mashable WordPress Admin</a>.</p>
<p>We found lot&#8217;s of web articles that show you how to do this. But we didn&#8217;t like their methods.  They all use .htaccess, but we think it&#8217;s cleaner and clearer to put the authorization in the Apache config file for yours site.  Also, the <a href="http://httpd.apache.org/docs/trunk/howto/htaccess.html" title="Apache docs recommend against using .htaccess" target="_blank">Apache docs recommend against using .htaccess</a>:</p>
<p><em>You should avoid using .htaccess files completely if you have access to httpd main server config file. Using .htaccess files slows down your Apache http server. Any directive that you can include in a .htaccess file is better set in a Directory block, as it will have the same effect with better performance.</em></p>
<p>So here is how we did it.  And these instructions will be helpful for locking down any Apache directory, even if you aren&#8217;t running WordPress.</p>
<h2>How to Password Protect WordPress Admin (or Any) Apache Directory</h2>
<p>First, you need to create a password file that contains user(s) and password(s).</p>
<p>Note that the passwords must be encrypted.  You can use this site to encrypt the password(s): <a href="http://www.htaccesstools.com/htpasswd-generator/" title="htpasswd generator" target="_blank">HTACCESS Tools &#8211; HTPASSWD Generateor</a></p>
<p>Create a new file and put it somewhere outside of the web root.  We put ours in a file called &#8220;passwords&#8221; in this directory: /home/putYourUserNameHere/.htpasswds/public_html/wp-admin/</p>
<p>Put the user names and encrypted passwords in the file, separated by a colon.  If you are including more than one user, put each user on a separate line:</p>
<pre class="brush: plain; title: ; notranslate">
some_user_name:$apr1$.TDNi1lH$4Q8eciJYOw0w//Dgr8YaD/
another_user_name:$apr1$760eN1Rw$krIuuPpceOIcQSak4tmqG1
</pre>
<p>After you create this file, add the following to your Apache config file:</p>
<pre class="brush: plain; title: ; notranslate">
        # Block access to wp admin
        &lt;Files wp-login.php&gt;
                AuthName &quot;Admins Only&quot;
                AuthUserFile /home/putYourUserNameHere/.htpasswds/public_html/wp-admin/passwords
                AuthGroupFile /dev/null
                AuthType basic
                require valid-user
        &lt;/Files&gt;
        &lt;Location /wp-admin/&gt;
                AuthName &quot;Admins Only&quot;
                AuthUserFile /home/putYourUserNameHere/.htpasswds/public_html/wp-admin/passwords
                AuthGroupFile /dev/null
                AuthType basic
                require valid-user
        &lt;/Location&gt;
</pre>
<p>And that&#8217;s it.</p>
<p>Note that this locks down both the wp-admin and the login page itself.  And, it only works if you have access to the Apache config file. If you don&#8217;t, this site offers some alternatives:<br />
<a href="http://www.wpbeginner.com/wp-tutorials/how-to-password-protect-your-wordpress-admin-wp-admin-directory/" target="_blank">www.wpbeginner.com/wp-tutorials/how-to-password-protect-your-wordpress-admin-wp-admin-directory/</a>.</p>
<h2>Additional Tweak to Fix WordPress Ajax Functionality</h2>
<p>The lock down method above may break some WordPress Ajax functionality.  If you are using that functionality and it breaks, you can fix it by adding this to your Apache config file:</p>
<pre class="brush: plain; title: ; notranslate">
&lt;Files admin-ajax.php&gt;
    Order allow,deny
    Allow from all
    Satisfy any 
&lt;/Files&gt;
</pre>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href='http://lifeonubuntu.com/what-is-the-apache-directive-order-of-precedence/' rel='bookmark' title='What is the Apache directive order of precedence?'>What is the Apache directive order of precedence?</a> <small>I am trying to implement some mod_rewrite RewriteRules using WordPressMU....</small></li>
<li><a href='http://lifeonubuntu.com/how-to-change-your-password-from-the-command-line/' rel='bookmark' title='How to change your password from the command line'>How to change your password from the command line</a> <small>To change your own password from the command line: To...</small></li>
<li><a href='http://lifeonubuntu.com/setup-wp-wpmu-for-atomic-version-switch-and-revert/' rel='bookmark' title='Setup WordPress or WPMU to make an atomic version switch &#8212; AND allow you to revert'>Setup WordPress or WPMU to make an atomic version switch &#8212; AND allow you to revert</a> <small>I have a new WordPress MU (WPMU) install and I...</small></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://lifeonubuntu.com/how-to-password-protect-wordpress-admin-or-any-apache-directory/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>301 Redirect from Bare Domain to Full WWW Domain</title>
		<link>http://lifeonubuntu.com/301-redirect-from-bare-domain-to-full-www-domain/</link>
		<comments>http://lifeonubuntu.com/301-redirect-from-bare-domain-to-full-www-domain/#comments</comments>
		<pubDate>Thu, 24 Jan 2013 17:52:35 +0000</pubDate>
		<dc:creator>Editor</dc:creator>
				<category><![CDATA[apache]]></category>
		<category><![CDATA[mod_rewrite]]></category>
		<category><![CDATA[performance]]></category>

		<guid isPermaLink="false">http://lifeonubuntu.com/?p=237</guid>
		<description><![CDATA[We recently set up Google Pagespeed Service for one of our WordPress sites. The site was setup with a &#8220;bare&#8221; domain name. That is, it had no subdomain. For example: http://healthfitnessexperts.com Google&#8217;s Pagespeed Service can&#8217;t handle bare domains. Like many content delivery networks (CDNs) and similar services, Pagespeed requires a subdomain like www. For example: [...]<div class='yarpp-related-rss yarpp-related-none'>

No related posts.
</div>
]]></description>
				<content:encoded><![CDATA[</p>
<p>We recently set up Google Pagespeed Service for one of our WordPress sites.  The site was setup with a &#8220;bare&#8221; domain name.  That is, it had no subdomain.  For example:</p>
<p><a href="http://healthfitnessexperts.com" title="Health and Fitness Experts">http://healthfitnessexperts.com</a></p>
<p>Google&#8217;s Pagespeed Service can&#8217;t handle bare domains.  Like many content delivery networks (CDNs) and similar services, Pagespeed requires a subdomain like www.  For example:</p>
<p><a href="http://www.healthfitnessexperts.com" title="Health and Fitness Experts">http://www.healthfitnessexperts.com</a></p>
<p>We switched the domain name using the handy <a href="http://wordpress.org/extend/plugins/wordpress-mu-domain-mapping/" title="Domain Mapping Plugin">WordPress Domain Mapping Plugn</a>.  But we needed to 301 permanent redirect all traffic from the bare domain to the www domain.</p>
<p>To do the 301 redirect, we just added this at the beginning of our .htaccess file:</p>
<pre class="brush: plain; title: ; notranslate">
RewriteEngine On
RewriteCond %{HTTP_HOST} ^healthfitnessexperts.com
RewriteRule (.*) http://www.healthfitnessexperts.com/$1 [R=301,L]
</pre>
<p>Done. That was easy.</p>
<p>(Of course, this all assumes that your DNS is setup correctly, and that you are using Apache with mod-rewrite installed. Otherwise, you have a few more hoops you need to jump through.)</p>
<div class='yarpp-related-rss yarpp-related-none'>
<p>No related posts.</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://lifeonubuntu.com/301-redirect-from-bare-domain-to-full-www-domain/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Restarting Apache Gracefully</title>
		<link>http://lifeonubuntu.com/restarting-apache-gracefully/</link>
		<comments>http://lifeonubuntu.com/restarting-apache-gracefully/#comments</comments>
		<pubDate>Fri, 28 Dec 2012 15:54:21 +0000</pubDate>
		<dc:creator>Editor</dc:creator>
				<category><![CDATA[apache]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://lifeonubuntu.com/?p=234</guid>
		<description><![CDATA[If you are restarting the web server on a live website, you should do it gracefully. A graceful restart tells the web sever to finish any active connections before restarting. This means that active visitors to your site will be able to finish downloading anything already in progress before the server restarts. If you are [...]<div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href='http://lifeonubuntu.com/how-to-upgrade-apc-on-ubunutu/' rel='bookmark' title='How to Upgrade APC on Ubunutu'>How to Upgrade APC on Ubunutu</a> <small>APC &#8212; the Alternative PHP Cache &#8212; is a handy...</small></li>
<li><a href='http://lifeonubuntu.com/php-apc-how-to-monitor-usage-and-config-for-optimum-performance/' rel='bookmark' title='PHP APC: How to Monitor Usage and Config for Optimum Performance'>PHP APC: How to Monitor Usage and Config for Optimum Performance</a> <small>APC is the Alternative PHP Cache. It&#8217;s a handy caching...</small></li>
<li><a href='http://lifeonubuntu.com/how-to-install-php-gd2-library-on-ubuntu/' rel='bookmark' title='How to install PHP GD2 library on Ubuntu'>How to install PHP GD2 library on Ubuntu</a> <small>I needed to install the PHP GD2 library to support...</small></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[</p>
<p>If you are restarting the web server on a live website, you should do it gracefully.</p>
<p>A graceful restart tells the web sever to finish any active connections before restarting.  This means that active visitors to your site will be able to finish downloading anything already in progress before the server restarts.</p>
<p>If you are running Apache, you do this with the graceful command:</p>
<pre class="brush: plain; title: ; notranslate">
$ sudo /etc/init.d/apache2 graceful
</pre>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href='http://lifeonubuntu.com/how-to-upgrade-apc-on-ubunutu/' rel='bookmark' title='How to Upgrade APC on Ubunutu'>How to Upgrade APC on Ubunutu</a> <small>APC &#8212; the Alternative PHP Cache &#8212; is a handy...</small></li>
<li><a href='http://lifeonubuntu.com/php-apc-how-to-monitor-usage-and-config-for-optimum-performance/' rel='bookmark' title='PHP APC: How to Monitor Usage and Config for Optimum Performance'>PHP APC: How to Monitor Usage and Config for Optimum Performance</a> <small>APC is the Alternative PHP Cache. It&#8217;s a handy caching...</small></li>
<li><a href='http://lifeonubuntu.com/how-to-install-php-gd2-library-on-ubuntu/' rel='bookmark' title='How to install PHP GD2 library on Ubuntu'>How to install PHP GD2 library on Ubuntu</a> <small>I needed to install the PHP GD2 library to support...</small></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://lifeonubuntu.com/restarting-apache-gracefully/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Upgrade APC on Ubunutu</title>
		<link>http://lifeonubuntu.com/how-to-upgrade-apc-on-ubunutu/</link>
		<comments>http://lifeonubuntu.com/how-to-upgrade-apc-on-ubunutu/#comments</comments>
		<pubDate>Fri, 28 Dec 2012 15:42:08 +0000</pubDate>
		<dc:creator>Editor</dc:creator>
				<category><![CDATA[apache]]></category>
		<category><![CDATA[apc]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://lifeonubuntu.com/?p=223</guid>
		<description><![CDATA[APC &#8212; the Alternative PHP Cache &#8212; is a handy caching utility for use with PHP. We use it with W3 Total Cache to speed up our WordPress sites. I recently had a little trouble remembering how to upgrade APC to a more current version on our Ubuntu installations. We had installed APC with pecl, [...]<div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href='http://lifeonubuntu.com/failed-ubuntu-apt-get-upgrade-corrupts-the-available-file/' rel='bookmark' title='Failed Ubuntu apt-get upgrade corrupts the available file'>Failed Ubuntu apt-get upgrade corrupts the available file</a> <small>I was upgrading Ubuntu packages with The upgrade failed with...</small></li>
<li><a href='http://lifeonubuntu.com/php-apc-how-to-monitor-usage-and-config-for-optimum-performance/' rel='bookmark' title='PHP APC: How to Monitor Usage and Config for Optimum Performance'>PHP APC: How to Monitor Usage and Config for Optimum Performance</a> <small>APC is the Alternative PHP Cache. It&#8217;s a handy caching...</small></li>
<li><a href='http://lifeonubuntu.com/restarting-apache-gracefully/' rel='bookmark' title='Restarting Apache Gracefully'>Restarting Apache Gracefully</a> <small>If you are restarting the web server on a live...</small></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[</p>
<p>APC &#8212; the Alternative PHP Cache &#8212; is a handy caching utility for use with PHP.  We use it with W3 Total Cache to speed up our WordPress sites.</p>
<p>I recently had a little trouble remembering how to upgrade APC to a more current version on our Ubuntu installations.  We had installed APC with pecl, so here is how I (eventually) upgraded APC:</p>
<pre class="brush: plain; title: ; notranslate">
$ sudo pecl install -f apc
</pre>
<p>The trick was the -f flag, which tells pecl to force overwriting of newer installed packages.</p>
<p>Once pecl finished, I had to restart Apache:</p>
<pre class="brush: plain; title: ; notranslate">
$ sudo /etc/init.d/apache2 graceful
</pre>
<p>Super easy &#8212; in hindsight!</p>
<hr />
<p>UPDATE: The latest upgrade failed on me a few times.</p>
<p>First, I got error &#8220;sh: phpize: not found.&#8221;  I fixed that with:</p>
<pre class="brush: plain; title: ; notranslate">
$ sudo apt-get install php5-dev
</pre>
<p>Then I got error &#8220;pcre.h: No such file or directory.&#8221;  That was fixed with:</p>
<pre class="brush: plain; title: ; notranslate">
$ sudo apt-get install libpcre3-dev
</pre>
<p>One more try, and I successfully upgraded to APC 3.1.13.</p>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href='http://lifeonubuntu.com/failed-ubuntu-apt-get-upgrade-corrupts-the-available-file/' rel='bookmark' title='Failed Ubuntu apt-get upgrade corrupts the available file'>Failed Ubuntu apt-get upgrade corrupts the available file</a> <small>I was upgrading Ubuntu packages with The upgrade failed with...</small></li>
<li><a href='http://lifeonubuntu.com/php-apc-how-to-monitor-usage-and-config-for-optimum-performance/' rel='bookmark' title='PHP APC: How to Monitor Usage and Config for Optimum Performance'>PHP APC: How to Monitor Usage and Config for Optimum Performance</a> <small>APC is the Alternative PHP Cache. It&#8217;s a handy caching...</small></li>
<li><a href='http://lifeonubuntu.com/restarting-apache-gracefully/' rel='bookmark' title='Restarting Apache Gracefully'>Restarting Apache Gracefully</a> <small>If you are restarting the web server on a live...</small></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://lifeonubuntu.com/how-to-upgrade-apc-on-ubunutu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP APC: How to Monitor Usage and Config for Optimum Performance</title>
		<link>http://lifeonubuntu.com/php-apc-how-to-monitor-usage-and-config-for-optimum-performance/</link>
		<comments>http://lifeonubuntu.com/php-apc-how-to-monitor-usage-and-config-for-optimum-performance/#comments</comments>
		<pubDate>Fri, 28 Dec 2012 15:32:44 +0000</pubDate>
		<dc:creator>Editor</dc:creator>
				<category><![CDATA[apache]]></category>
		<category><![CDATA[apc]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://lifeonubuntu.com/?p=224</guid>
		<description><![CDATA[APC is the Alternative PHP Cache. It&#8217;s a handy caching utility for use with PHP. We use it with W3 Total Cache on our WordPress installations. It runs OK &#8220;out of the box.&#8221; But you likely need to tune the config a bit to get the most out of it. The most common tweak is [...]<div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href='http://lifeonubuntu.com/how-to-upgrade-apc-on-ubunutu/' rel='bookmark' title='How to Upgrade APC on Ubunutu'>How to Upgrade APC on Ubunutu</a> <small>APC &#8212; the Alternative PHP Cache &#8212; is a handy...</small></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[</p>
<p>APC is the Alternative PHP Cache.  It&#8217;s a handy caching utility for use with PHP.  We use it with W3 Total Cache on our WordPress installations.</p>
<p>It runs OK &#8220;out of the box.&#8221;  But you likely need to tune the config a bit to get the most out of it.  The most common tweak is to increase the shared memory allocation from the default 32M to something higher.  But what&#8217;s the right number?</p>
<p>If you already have APC installed and running, the first step is to install the APC monitoring script.  Assuming your web root is at /var/www/, you can easily install it like this:</p>
<pre class="brush: plain; title: ; notranslate">
$ sudo cp /usr/share/doc/php-apc/apc.php.gz /var/www
$ sudo gzip -d /var/www/apc.php.gz
</pre>
<p><em><strong>NOTE</strong> that you likely want to lock this file down a bit so that it&#8217;s not accessible to the entire world!</em></p>
<p>To use the script, you need to edit it to change the default password:</p>
<pre class="brush: plain; title: ; notranslate">
$ sudo vim /var/www/apc.php
</pre>
<p>Once installed you can access the script in your browser at http://[your domain or ip address]/apc.php</p>
<p>Then take a look at the Cache Full Count stat in the the File Cache Information section.  This shows how often APC is filling the cache. In other words, how often is APC running out of memory.  You want this to be a low number, as close to zero as possible.</p>
<p>You can also look at the Memory Usage pie chart and the Hits &#038; Misses bar graph.  You want to see at least a small cushion of available (green) memory in the pie chart.  You also want to minimize the fragmentation.  On Hits &#038; Misses, you want a very high hit rate and a very small miss rate.  Note that if you just restarted Apache, the miss rate might be low until you have had some traffic.  Over time, the hit rate should be increasing. Our production ht rate is in the high 90 percent.</p>
<p>If the Cache Full Count is high (or increasing), the memory pie chart shows little memory and high fragmentation, or the hit rate is low, you need to increase memory.  To do this, edit the config file. Note that it&#8217;s likely almost empty:</p>
<pre class="brush: plain; title: ; notranslate">
$ sudo vim /etc/php5/apache2/conf.d/apc.ini
1

Increase the memory by adding (or changing) apc.shm configuration parameter.  Here is our config file, that sets the memory to 128M:

1
extension=apc.so
apc.shm_size=64
apc.stat=1
</pre>
<p>You'll need to restart apache after you make this change:</p>
<pre class="brush: plain; title: ; notranslate">
$ sudo /etc/init.d/apache2 graceful
</pre>
<p>Once you make this change, check the APC monitor script.  With a little tweaking, you'll find the right value for your site that keeps the cache full count low and the hit rate high.</p>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href='http://lifeonubuntu.com/how-to-upgrade-apc-on-ubunutu/' rel='bookmark' title='How to Upgrade APC on Ubunutu'>How to Upgrade APC on Ubunutu</a> <small>APC &#8212; the Alternative PHP Cache &#8212; is a handy...</small></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://lifeonubuntu.com/php-apc-how-to-monitor-usage-and-config-for-optimum-performance/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Failed Ubuntu apt-get upgrade corrupts the available file</title>
		<link>http://lifeonubuntu.com/failed-ubuntu-apt-get-upgrade-corrupts-the-available-file/</link>
		<comments>http://lifeonubuntu.com/failed-ubuntu-apt-get-upgrade-corrupts-the-available-file/#comments</comments>
		<pubDate>Wed, 27 Jun 2012 01:41:07 +0000</pubDate>
		<dc:creator>Editor</dc:creator>
				<category><![CDATA[ubuntu server]]></category>

		<guid isPermaLink="false">http://lifeonubuntu.com/?p=219</guid>
		<description><![CDATA[I was upgrading Ubuntu packages with The upgrade failed with a segmentation fault. I tried again, but found I had a corrupted /var/lib/dpkg/available file. I first go this error: I edited the available file and fixed the problem. But then I got this: I made more edits and got more errors. It then realized that [...]<div class='yarpp-related-rss yarpp-related-none'>

No related posts.
</div>
]]></description>
				<content:encoded><![CDATA[</p>
<p>I was upgrading Ubuntu packages with</p>
<pre class="brush: plain; title: ; notranslate">
sudo apt-get update
sudo apt-get upgrade
</pre>
<p>The upgrade failed with a segmentation fault.  I tried again, but found I had a corrupted /var/lib/dpkg/available file.  I first go this error:</p>
<pre class="brush: plain; title: ; notranslate">
dpkg: parse error, in file '/var/lib/dpkg/available' near line 872 package 'ubuntu-serverguide':
 `Depends' field, reference to `libc6': version contains ` '
E: Sub-process /usr/bin/dpkg returned an error code (2)
</pre>
<p>I edited the <em>available</em> file and fixed the problem.  But then I got this:</p>
<pre class="brush: plain; title: ; notranslate">
Preconfiguring packages ...
dpkg: parse error, in file '/var/lib/dpkg/available' near line 872 package 'ubuntu-serverguide':
 field name `Conflicts8' must be followed by colon
E: Sub-process /usr/bin/dpkg returned an error code (2)
</pre>
<p>I made more edits and got more errors.  It then realized that the file was corrupted.  Bummer.</p>
<p>I didn&#8217;t know how to recover.  But with a little research, I discovered that apt-get doesn&#8217;t actually need the <em>available</em> file.  You can back it up, create an empty one, and then apt-get will recreate it:</p>
<pre class="brush: plain; title: ; notranslate">
cd /var/lib/dpkg/
sudo mv available available.bak.fjl
sudo touch available

sudo apt-get update
sudo apt-get upgrade
</pre>
<p>Presto.  The upgrade succeeded and I got a fresh <em>available</em> file in the process.  Problem solved.</p>
<div class='yarpp-related-rss yarpp-related-none'>
<p>No related posts.</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://lifeonubuntu.com/failed-ubuntu-apt-get-upgrade-corrupts-the-available-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to automagically get friendly URLs in Rails 3</title>
		<link>http://lifeonubuntu.com/how-to-automagically-get-friendly-urls-in-rails-3/</link>
		<comments>http://lifeonubuntu.com/how-to-automagically-get-friendly-urls-in-rails-3/#comments</comments>
		<pubDate>Mon, 02 Apr 2012 18:48:23 +0000</pubDate>
		<dc:creator>Editor</dc:creator>
				<category><![CDATA[Ruby on Rails Tips]]></category>

		<guid isPermaLink="false">http://lifeonubuntu.com/?p=212</guid>
		<description><![CDATA[By default, Rails uses ID&#8217;s in URLs. For example, let&#8217;s say we have a list of categories stored in the categories table of the database. The &#8220;Super Cool&#8221; category is stored with categories#id = 5. To view that category our URL will look like: http://yourAwesomeDomain.com/category/5 That works great, but it&#8217;s not very user friendly. It&#8217;s [...]<div class='yarpp-related-rss yarpp-related-none'>

No related posts.
</div>
]]></description>
				<content:encoded><![CDATA[</p>
<p>By default, Rails uses ID&#8217;s in URLs.  For example, let&#8217;s say we have a list of categories stored in the categories table of the database.  The &#8220;Super Cool&#8221; category is stored with categories#id = 5.  To view that category our URL will look like:</p>
<p>http://yourAwesomeDomain.com/category/5</p>
<p>That works great, but it&#8217;s not very user friendly.  It&#8217;s also not very good for SEO purposes.  A better URL would use a human-readable and search-engine-decipherable slug instead of an ID.  For example:</p>
<p>http://yourAwesomeDomain.com/category/super-cool</p>
<p>How do we get that?  Easy!</p>
<p>First, add a column named &#8220;slug&#8221; to the categories table:</p>
<pre class="brush: plain; title: ; notranslate">
# \db\migrate\20120402020611_create_categories.rb

class CreateCategories &lt; ActiveRecord::Migration
  def change
    create_table :categories do |t|
      t.string :name
      t.string :slug
      t.timestamps
    end
  end
end
</pre>
<p>Next, add these lines to your category model:</p>
<pre class="brush: plain; title: ; notranslate">
# \app\models\category.rb

class Category &lt; ActiveRecord::Base
  before_create :generate_slug
  attr_protected :slug

  def generate_slug
    self.slug = name.parameterize
  end

  def to_param
    slug
  end

end
</pre>
<p>Bam!  You are done.  Your rails helpers and other logic will now automagically use slugs instead ID&#8217;s.  For example:</p>
<pre class="brush: plain; title: ; notranslate">
@my_new_cat =  Category.create(:name =&gt; 'Super Cool')
=&gt;  #&lt;Category id: 3, name: &quot;Super Cool&quot;, slug: &quot;super-cool&quot;, created_at: &quot;2012-04-02 18:43:08&quot;, updated_at: &quot;2012-04-02 18:43:08&quot;&gt;

category_path(@my_new_cat)
=&gt; /category/super-cool

link_to(@my_new_cat.name, @my_new_cat)
=&gt; &lt;a href=&quot;/category/super-cool&quot;&gt;Super Cool&lt;/a&gt;
</pre>
<p>And in your controller, you can find the category by searching with the slug:</p>
<pre class="brush: plain; title: ; notranslate">
# \app\controllers\category_controller.rb

class CategoryController &lt; ApplicationController
  def show
    @category = Category.find_by_slug(params[:id])
  end
end
</pre>
<p>Pretty cool, huh?</p>
<div class='yarpp-related-rss yarpp-related-none'>
<p>No related posts.</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://lifeonubuntu.com/how-to-automagically-get-friendly-urls-in-rails-3/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using apc
Database Caching 8/105 queries in 0.057 seconds using apc
Object Caching 1796/1854 objects using apc

 Served from: lifeonubuntu.com @ 2013-06-20 05:06:13 by W3 Total Cache -->