<?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>Tech4Him - Technology with Integrity &#187; Articles</title>
	<atom:link href="http://blog.tech4him.com/topics/article/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.tech4him.com</link>
	<description>A Christian technology chaos wrangler and his thoughts</description>
	<lastBuildDate>Wed, 24 Mar 2010 23:15:39 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>ESXi 4, Moving VMs to new Storage</title>
		<link>http://blog.tech4him.com/2010/03/esxi-4-moving-vms-to-new-storage/</link>
		<comments>http://blog.tech4him.com/2010/03/esxi-4-moving-vms-to-new-storage/#comments</comments>
		<pubDate>Wed, 24 Mar 2010 23:15:39 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[esxi]]></category>
		<category><![CDATA[free]]></category>
		<category><![CDATA[md3000i]]></category>
		<category><![CDATA[san]]></category>
		<category><![CDATA[vmfs]]></category>
		<category><![CDATA[vmware]]></category>

		<guid isPermaLink="false">http://blog.tech4him.com/?p=948</guid>
		<description><![CDATA[As previously discussed, we recently purchased an MD3000i iSCSI SAN from Dell. We are running the &#8220;free&#8221; VSphere ESXi 4 on 3 hosts. That&#8217;s right, no VCenter, no VCB, no VMotion, no SVM. So, how does one best approach moving these VM guests from local storage to our new lovely SAN? Well, we looked into [...]]]></description>
			<content:encoded><![CDATA[<p>As <a id="aptureLink_2qk6IeDHi4" href="../2010/03/dell-md3000i-and-r710-shiny-and-new/">previously discussed</a>, we recently purchased an MD3000i iSCSI SAN from Dell. We are running the &#8220;free&#8221; VSphere ESXi 4 on 3 hosts. That&#8217;s right, no VCenter, no VCB, no VMotion, no SVM. So, how does one best approach moving these VM guests from local storage to our new lovely SAN? Well, we looked into the following possibilities:<span id="more-948"></span></p>
<ol>
<li>Upgrade and <a id="aptureLink_bpOxGkat45" href="http://www.slideshare.net/championsg/navigating-the-new-vsphere-licensing-landscape">purchase licenses for VSphere</a>, VCenter, etc&#8230;</li>
<li>Use the VI client data store browse &#8220;Move&#8221; functionality</li>
<li>Try out a third party product like Veeam FastSCP</li>
<li>Try standard TAR/GZ combined with cp command</li>
<li>Try vmkfstools disk cloning</li>
</ol>
<p>One important note. While testing some of these options, we became aware of a complicating factor. If you have created your disks as Thin provisioned and are moving to storage that has a different block size, the vmdk will become thick provisioned. This means that the &#8220;entire&#8221; contents of the fully thick provisioned disk will be moved, not just the used space.</p>
<h2>Upgrade and Purchase VSphere Infrastructure Licenses</h2>
<p>This option is one we continue to re-evaluate every 6-8 months. Working in a non-profit, we are always evaluating how to be the best stewards of the resources we&#8217;ve been provided. One of those resources is obviously financial resources. This seems like the only real option for moving running VMs.</p>
<p>While having VSphere Enterprise in place would make this process of migrating to new storage easier, we just cannot justify the long term expense. Our small environment just does not need what you pay for over the long haul.</p>
<p>As such, we ruled this out. Some downtime is perfectly acceptable in this organization.</p>
<h2>Use VI Client Datastore Browse/Move Functionality</h2>
<p><a href="http://blog.tech4him.com/wp-content/uploads/20100324-VI-Client-Data-Browser.png"><img class="alignleft size-medium wp-image-953" style="border: 1px solid black; margin: 8px;" title="20100324 VI Client Data Browser" src="http://blog.tech4him.com/wp-content/uploads/20100324-VI-Client-Data-Browser-300x151.png" alt="" width="300" height="151" /></a>When using the VI Client, you can browse the VMFS datastores similar to a Windows Explorer window. This is accessed by viewing the storage configuration of the host in the VI Client. Right-clicking the particular datastore and choosing browse.</p>
<p>Obviously, this function does not work on running VMs. As a matter of fact, in one of our tests, we actually caused a problem doing so. This is a &#8220;move&#8221; not a copy. If the move fails mid-way through, some files will have been moved while others are still in their original location. Now you&#8217;ve got a bigger mess on your hands.</p>
<p>So, this option means the VM has to be powered off. Ok, we can deal with that. The other downside was that, as explained above, the new vmdk is thick provisioned and therefore, much more data is transferring that is really necessary.</p>
<h2>Test 3rd Party Product Like Veeam FastSCP</h2>
<p><a href="http://blog.tech4him.com/wp-content/uploads/20100324-Veeam-FastSCP.png"><img class="alignright size-medium wp-image-954" style="border: 0pt none; margin: 8px;" title="20100324 Veeam FastSCP" src="http://blog.tech4him.com/wp-content/uploads/20100324-Veeam-FastSCP-300x230.png" alt="" width="300" height="230" /></a>I really do like the folks over at <a id="aptureLink_trsgG6If96" href="http://www.veeam.com/">Veeam</a>. I have used the monitoring /reporting product and like there licensing models. We thought we&#8217;d check out <a id="aptureLink_5GjLxUf0tc" href="http://www.veeam.com/vmware-esxi-fastscp.html">their free FastSCP</a> product. Why? Well because is says &#8220;Fast&#8221; in the name. <img src='http://blog.tech4him.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>The tool worked great. It did everything is said it would do. Like the other options, the VMs need to be powered down. We even tested copying between different ESXi hosts. Worked great. The only downside was the lack of speed. Yeah really! We did some reading and it appears that this may be a throttling of the ESXi product, not Veeam FastSCP. Bummer.</p>
<h2>Try standard TAR/GZ combined with cp command</h2>
<p><a href="http://blog.tech4him.com/wp-content/uploads/20100324-tar-failure.png"><img class="alignleft size-medium wp-image-955" style="border: 0pt none; margin: 8px;" title="20100324 tar failure" src="http://blog.tech4him.com/wp-content/uploads/20100324-tar-failure-300x81.png" alt="" width="300" height="81" /></a>&#8220;Wow&#8221;, I though as I was researching. Why don&#8217;t we just tar/gzip everything and then copy to the new storage location and then untar. Well, not so fast our ESXi said to m as it spewed out an error that &#8220;tar: cannot store file &#8216;xxxxxxxxxxx.vmdk&#8217; of size #########, aborting&#8221;. Yuck~!</p>
<p>It appears that BusyBox, the underlying unsupported ESXi console has a limitation of 4GB in ESXi3.5 and 8GB in ESXi 4. Therefore, trying to tar a 100GB vmdk file went no where fast. Check this option off the list.</p>
<h2>Try vmkfstools disk cloning</h2>
<p>This, we thought, is an interesting idea. Yes, the VMs still need to be powered off but perhaps this will shorten the downtime by lowering the amount of data that gets copied. See, as we talk about earlier, going to storage of a different block size will mean yout thin provisioned disks will begin thick. As such, the total size of the thick disk has to be transferred. This could siginificantly increase the copy time if you have lots of unused space on a disk.</p>
<p><a href="http://blog.tech4him.com/wp-content/uploads/20100324-vmkfstools-example-success.png"><img class="alignright size-medium wp-image-957" style="border: 1px solid black; margin: 8px;" title="20100324 vmkfstools example success" src="http://blog.tech4him.com/wp-content/uploads/20100324-vmkfstools-example-success-300x45.png" alt="" width="300" height="45" /></a>The vmkfstools utility has a feature known as cloning. This allows you to make a clone copy of a vmdk disk to anyVMFS datastore. Now that&#8217;s all good but where this got us jazzed was the ability to force that newly cloned disk to be created as a thin provisioned disk. Eureka!</p>
<p>Now, first, make sure you remove all snapshots in the vm. Those are just going to cause us a headache.</p>
<p>So a command like this does the deed:<br />
<code>vmkfstools -i /vmfs/volumes/source/vmname/vmname.vmdk -d thin /vmfs/volumes/dest/vmname/vmname.vmdk<br />
</code></p>
<blockquote><p><em>Note: you need to do this against the vmname.vmdk NOT the vmname-flat.vmdk. Be forwarned.</em></p></blockquote>
<p>Some small scale, non-scientific testing gave us around 1.3GB per minute in transfer speed. Again, this is not true i/o but rather therate used for calculating down time for our migration project by taking the amount of used space on the source drive/time to create cloned drive = transfer rate.</p>
<p>Now, when the vmdks are moved, don&#8217;t forget to cp all the other VM files in the VM directories!</p>
<p>This looks to be the path we will be taking and thought we&#8217;d share how we arrived here.</p>
<img src="http://blog.tech4him.com/?ak_action=api_record_view&id=948&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://blog.tech4him.com/2010/03/esxi-4-moving-vms-to-new-storage/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Dell MD3000i and R710 &#8211; Shiny and New</title>
		<link>http://blog.tech4him.com/2010/03/dell-md3000i-and-r710-shiny-and-new/</link>
		<comments>http://blog.tech4him.com/2010/03/dell-md3000i-and-r710-shiny-and-new/#comments</comments>
		<pubDate>Thu, 18 Mar 2010 22:53:10 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Links/Resources]]></category>
		<category><![CDATA[dell]]></category>
		<category><![CDATA[esxi]]></category>
		<category><![CDATA[idrac]]></category>
		<category><![CDATA[md3000i]]></category>
		<category><![CDATA[r710]]></category>
		<category><![CDATA[san]]></category>
		<category><![CDATA[vmware]]></category>

		<guid isPermaLink="false">http://blog.tech4him.com/?p=924</guid>
		<description><![CDATA[Well, the time finally came. We bit the bullet and purchased a new Dell PowerEdge R710 and an MD3000i SAN for the office. The R710 will be a new VSphere ESXi 4 host that will take on a bulk of the production VM&#8217;s while one of the remaining 2950&#8217;s will remain a smaller production host [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.tech4him.com/wp-content/uploads/P1020983.jpg"><img class="alignleft size-medium wp-image-925" style="border: 1px solid black; margin: 8px;" title="P1020983" src="http://blog.tech4him.com/wp-content/uploads/P1020983-300x236.jpg" alt="MD3000i and Dell Poweredge R710 mounted." width="300" height="236" /></a>Well, the time finally came. We bit the bullet and purchased a new <a id="aptureLink_hCyM6UtDdt" href="http://www.dell.com/us/en/enterprise/servers/server-poweredge-r710/pd.aspx?refid=server-poweredge-r710&amp;cs=555&amp;s=biz">Dell PowerEdge R710</a> and an <a id="aptureLink_bLYLP1Uv0w" href="http://www.dell.com/us/en/enterprise/storage/pvaul_md3000i/pd.aspx?refid=pvaul_md3000i&amp;cs=555&amp;s=biz">MD3000i SAN</a> for the office. The R710 will be a new <a id="aptureLink_RyUIbc3vQk" href="http://www.vmware.com/products/esxi/">VSphere ESXi 4</a> host that will take on a bulk of the production VM&#8217;s while one of the remaining 2950&#8217;s will remain a smaller production host and the third 2950 will be a test and development box.</p>
<p>So you can see the MD3000i with the faceplate off directly below the new R710. I&#8217;m tempted to leave the faceplate off so that the executives and visitors see more lights when they look in. For some reason, non-technical people tend to have a first reaction to hardware such that more lights is mo&#8217; better. <img src='http://blog.tech4him.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> <span id="more-924"></span></p>
<p><a href="http://blog.tech4him.com/wp-content/uploads/Dell-PowerConnect-Summary.png"><img class="alignright size-medium wp-image-928" style="border: 0pt none; margin: 8px;" title="Dell PowerConnect Summary" src="http://blog.tech4him.com/wp-content/uploads/Dell-PowerConnect-Summary-300x143.png" alt="" width="300" height="143" /></a>Along with these two pieces of hardware, we went ahead and got a <a id="aptureLink_zs7XEvwIti" href="http://www.dell.com/us/en/enterprise/networking/pwcnt_5424/pd.aspx?refid=pwcnt_5424&amp;cs=555&amp;s=biz">Dell PowerConnect 5424</a> iSCSI optimized switch. This will be dedicated to the storage segment for the time being. Configuration of the switch meant actually going back to the rack. Initial configuration must be done via serial cable (included). Once you configure the management IP address and administrator credentials, the rest of the configuration can be done via the web based management tool.</p>
<p><a href="http://blog.tech4him.com/wp-content/uploads/Dell-R710-DRAC-Summary.png"><img class="alignleft size-thumbnail wp-image-929" style="border: 0pt none; margin: 8px;" title="Dell R710 DRAC Summary" src="http://blog.tech4him.com/wp-content/uploads/Dell-R710-DRAC-Summary-150x150.png" alt="" width="150" height="150" /></a>Now the R710 was purchased with the nice <a id="aptureLink_MQtvMeQu2C" href="http://www.delltechcenter.com/page/lifecycle+controller">iDRAC</a>. This web based, out of band, management tool is wonderful. No client to load. You can configure, manage and review just about anything at the hardware level here.</p>
<p>One of the things I really liked about the new iDRAC is the console redirection or virtual KVM functionality. Of course, this allows you to run a java application the is the server console, however, it also allows you to map client resources as virtual media for the server.</p>
<p><a href="http://blog.tech4him.com/wp-content/uploads/Dell-DRAC-KVM-Virtual-Media.png"><img class="alignright size-thumbnail wp-image-930" style="border: 0pt none; margin: 8px;" title="Dell DRAC KVM Virtual Media" src="http://blog.tech4him.com/wp-content/uploads/Dell-DRAC-KVM-Virtual-Media-150x150.png" alt="" width="150" height="150" /></a>In our case, we mapped the VMWare Vsphere ESXi 4 ISO image to the R710 server. We booted to it and installed the operating system without so much as a single walk back to the serer rack. This is much akin to the VMWare ability to mount client CD/DVD drives or ISO images as media for the guest operating systems. The difference here is that this is for the physical hardware. Lights out operations, indeed!</p>
<p><a href="http://blog.tech4him.com/wp-content/uploads/md3000i-Storage-Manager-Summary.png"><img class="alignleft size-thumbnail wp-image-931" style="border: 0pt none; margin: 8px;" title="md3000i Storage Manager Summary" src="http://blog.tech4him.com/wp-content/uploads/md3000i-Storage-Manager-Summary-150x150.png" alt="" width="150" height="150" /></a>Finally, the MD3000i is configured with the <a id="aptureLink_dcprywcZIQ" href="http://dell.driversdown.com/dell-drivers-downloads/Dell-MD3000i-Configuration-Utility_21455.shtml">Dell MD3000i Configuration Utility</a>. Downloading this zip file was easy enough, extracted the contents and ran the SAConfig.bat file. The wizard walks you through the process. We had already wired the management ports on the MD3000i to our LAN while leaving the controllers on the storage network. The Wizard easily identified the unit, asked us for information on how we wanted to configure ip addresses and the like and then applied the configuration to the MD3000i. 5 minutes later we used the Modular Disk Storage Manager to begin the configuration process.</p>
<p>Dell will be helping with the final configuration next week but already setting up iSCSI to the ESXi hosts has been fairly painless following the <a id="aptureLink_EtfppEsgJi" href="http://www.delltechcenter.com/page/VMware+ESX+4.0+and+PowerVault+MD3000i">documented processes</a> outlined by Dell and VMWare.</p>
<img src="http://blog.tech4him.com/?ak_action=api_record_view&id=924&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://blog.tech4him.com/2010/03/dell-md3000i-and-r710-shiny-and-new/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Why I Love Linode Disk Image Options</title>
		<link>http://blog.tech4him.com/2010/03/why-i-love-linode-disk-image-options/</link>
		<comments>http://blog.tech4him.com/2010/03/why-i-love-linode-disk-image-options/#comments</comments>
		<pubDate>Fri, 12 Mar 2010 10:38:48 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[administration]]></category>
		<category><![CDATA[disk]]></category>
		<category><![CDATA[linode]]></category>

		<guid isPermaLink="false">http://blog.tech4him.com/?p=903</guid>
		<description><![CDATA[This is just a quick post on another feature of Linodes I really adore. Disk image options allow you to do a number tasks with multiple disk images. One thing that is a huge help for me is the ability to resize a disk image. Now to do this, your linode needs to be powered [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.tech4him.com/wp-content/uploads/Linode-Disk-Image-Options-1.png"><img class="alignright size-medium wp-image-904" style="border: 0pt none; margin: 8px;" title="Linode Disk Image Options 1" src="http://blog.tech4him.com/wp-content/uploads/Linode-Disk-Image-Options-1-300x103.png" alt="" width="300" height="103" /></a>This is just a quick post on another feature of Linodes I really adore. <a href="http://library.linode.com/linode-manager/managing-disk-images">Disk image options</a> allow you to do a number tasks with multiple disk images. One thing that is a huge help for me is the ability to resize a disk image. Now to do this, your linode needs to be powered off.</p>
<p><span id="more-903"></span>Now, don&#8217;t forget that it your SSH into your LISH console, you can see everything going on even with your Linode powered off. Click the Image Options link for the image you wish to resize.</p>
<p><a href="http://blog.tech4him.com/wp-content/uploads/Linode-Disk-Image-Options-2.png"><img class="alignleft size-medium wp-image-905" style="margin: 8px; border: 0pt none;" title="Linode Disk Image Options 2" src="http://blog.tech4him.com/wp-content/uploads/Linode-Disk-Image-Options-2-300x125.png" alt="" width="300" height="125" /></a>Now, simply type the new disk image size. If you enter a larger number, the image will be expanded. If smaller, the disk image will be shrunk. Additionally, there is no need to worry if you try to shrink or expand beyond what is possible. The resize process will simply fail in such cases and return your disk image to its previous size.</p>
<p>This ability to resize disk images provides a very useful utility to squeeze the full potential of a linode as it evolves over time.</p>
<p>Call me a Linode fan boy! <img src='http://blog.tech4him.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<img src="http://blog.tech4him.com/?ak_action=api_record_view&id=903&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://blog.tech4him.com/2010/03/why-i-love-linode-disk-image-options/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Drupal 5 to 6 Form Migration #TREE Attribute</title>
		<link>http://blog.tech4him.com/2010/03/drupal-5-to-6-form-migration-tree-attribute/</link>
		<comments>http://blog.tech4him.com/2010/03/drupal-5-to-6-form-migration-tree-attribute/#comments</comments>
		<pubDate>Thu, 11 Mar 2010 04:12:23 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[drupal]]></category>
		<category><![CDATA[module]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://blog.tech4him.com/?p=910</guid>
		<description><![CDATA[Today was spent working on creating a Drupal 6 version of a custom Drupal 5 module as part of a Drupal upgrade project. This module is similar to the image_attach module that is a contrib module package with the Image module. The difference is that the module allows you to designate categories for images by [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://farm1.static.flickr.com/72/183313765_12a606d998.jpg"><img class="alignright" title="Tree" src="http://farm1.static.flickr.com/72/183313765_12a606d998.jpg" alt="" width="350" height="199" /></a>Today was spent working on creating a Drupal 6 version of a custom Drupal 5 module as part of a Drupal upgrade project. This module is similar to the image_attach module that is a contrib module package with the <a href="http://drupal.org/project/image">Image module</a>. The difference is that the module allows you to designate categories for images by content_type and allows for the upload, selection, removal and ordering of images in each &#8220;image category&#8221;.<span id="more-910"></span></p>
<p><a href="http://blog.tech4him.com/wp-content/uploads/20100310-images_attach-screenshot.png"><img class="alignleft size-medium wp-image-913" style="border: 1px solid black; margin: 8px;" title="20100310 images_attach screenshot" src="http://blog.tech4him.com/wp-content/uploads/20100310-images_attach-screenshot-212x300.png" alt="" width="212" height="300" /></a>Now, one of the biggest challenges is that there are multiple instances of the &#8220;image_attach&#8221; sections on a single content edit form, one for each category. The Drupal 5 version handled this by naming these by appending the category name to the fields. This allows the submitted form value for &#8220;iids&#8221; to be an array of categories. Each category itself being an array of image iid values.</p>
<p>For the life of me, my Drupal 6 version of this functionality failed to maintain the category arrays. After some frustrated hair pulling (hmmm&#8230;. no wonder my hair is so short), I remembered to take a look at the <a href="http://api.drupal.org/api/drupal/developer--topics--forms_api.html/6">FAPI docs</a>.</p>
<p>http://api.drupal.org/api/drupal/developer&#8211;topics&#8211;forms_api.html/6</p>
<blockquote><p><span style="color: #800080;"><em>An important thing to note:</em> notice that <code>$form['access']</code> has a <code>'#tree' =&gt; TRUE</code> attribute. this setting retains  the full tree structure for all elements under it when it is passed to <code>$form_state['values']</code>.  you must explicitly declare this anywhere you wish to retain an array&#8217;s  full hierarchy when it is passed.</span></p></blockquote>
<p>So, Drupal 6 collapses form elements where possible by default. By adding the #tree attribute, the hierarchy of form elements is maintained in the form_state submitted. Eureka!</p>
<p>Here&#8217;s an example of what I was getting without the #tree attribute:</p>
<p><a href="http://blog.tech4him.com/wp-content/uploads/20100310-Drupal-Without-Form-Tree.png"><img class="aligncenter size-medium wp-image-911" title="20100310 Drupal Without Form Tree" src="http://blog.tech4him.com/wp-content/uploads/20100310-Drupal-Without-Form-Tree-300x281.png" alt="form_state values without #tree" width="300" height="281" /></a></p>
<p>And now with the #tree attribute set to true, the form hierarchy is retain and not collapsed:</p>
<p><a href="http://blog.tech4him.com/wp-content/uploads/20100310-Drupal-With-Form-TREE-on.png"><img class="aligncenter size-medium wp-image-912" title="20100310 Drupal With Form TREE on" src="http://blog.tech4him.com/wp-content/uploads/20100310-Drupal-With-Form-TREE-on-285x300.png" alt="form_state values with #tree" width="285" height="300" /></a></p>
<p>I&#8217;m sure most of you doing Drupal development are saying &#8220;Duh!&#8221;. Well, let&#8217;s just say I really didn&#8217;t know. <img src='http://blog.tech4him.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Thought I&#8217;d throw it on the blog so I don&#8217;t forget.</p>
<p>Blessings.</p>
<img src="http://blog.tech4him.com/?ak_action=api_record_view&id=910&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://blog.tech4him.com/2010/03/drupal-5-to-6-form-migration-tree-attribute/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linode StackScripts and LAMP Servers</title>
		<link>http://blog.tech4him.com/2010/03/linode-stackscripts-and-lamp-servers/</link>
		<comments>http://blog.tech4him.com/2010/03/linode-stackscripts-and-lamp-servers/#comments</comments>
		<pubDate>Tue, 09 Mar 2010 03:16:45 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[lamp]]></category>
		<category><![CDATA[linode]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://blog.tech4him.com/?p=891</guid>
		<description><![CDATA[On February 8th, 2010 Linode.com announced the availability of StackScripts. The StackScripts are described as:
StackScripts™ provide a  flexible way to customize our distribution templates. They’re very easy  to use — find a StackScript, answer its questions, and click deploy.  When the deployment is first booted, the script is executed and does its [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.tech4him.com/wp-content/uploads/20103008-StackScript-Start.png"><img class="alignleft size-medium wp-image-895" style="border: 1px solid black; margin: 8px;" title="StackScript Start" src="http://blog.tech4him.com/wp-content/uploads/20103008-StackScript-Start-300x204.png" alt="" width="300" height="204" /></a>On February 8th, 2010 <a href="http://blog.linode.com/2010/02/09/introducing-stackscripts/">Linode.com announced the availability of StackScripts</a>. The StackScripts are described as:</p>
<blockquote><p><a href="http://www.linode.com/stackscripts/">StackScripts</a>™ provide a  flexible way to customize our distribution templates. They’re very easy  to use — find a StackScript, answer its questions, and click deploy.  When the deployment is first booted, the script is executed and does its  thing. You can even watch its progress by viewing the console.</p>
<p><span id="more-891"></span></p></blockquote>
<p>As so many things with Linode.com and its community there is a public library of the <a href="http://www.linode.com/stackscripts/">Stackscripts</a> available for a variety of purposes. Anything a from a standard LAMP setup to WordPress, Drupal and TRAC/SVN setups.</p>
<p>Already having a Linode up and running, I have also been thinking about re-doing the setup of ourLAMP server. Seeing this as an opportunity to both rebuild our LAMP server and test StackScripts, I set out to give it a try.</p>
<p>We already had a Linode configuration and a disk image actively running. The good news was that when you choose to deploy a new distribution via a stackscript, it will create both a new Linode configuration as well as a new disk image. Doing so keeps you from having to remove the currently running setup.</p>
<p><a href="http://blog.tech4him.com/wp-content/uploads/20100308-Stackscript-LAMP.png"><img class="alignright size-medium wp-image-892" style="border: 1px solid black; margin: 8px;" title="Stackscript LAMP" src="http://blog.tech4him.com/wp-content/uploads/20100308-Stackscript-LAMP-300x195.png" alt="" width="300" height="195" /></a>One of the standard Linode LAMP StackScripts provide a form like the image to the left when executed to deploy a new distribution. MySQL user and password, creation of a default database, as well as root O/S password and such. dec</p>
<p>Once the configuration is created, you now only need to boot into the new configuration. If you are logged into your LISH console, you will see the distribution go through the automated process of the StackScript. In our test case, an Ubuntu 8.04 LTS kernel was booted and installed, system updates installed and applied, postfix installed for local loopback only, MySQL installed and tuned, php installed and tuned and apache2 installed and tuned.</p>
<p>Pretty cool so far. Now, there is plenty left to do to get a fairly decent LAMP going that in our case would run Drupal.</p>

<p>Create a new non-root admin  user account called myadminuser and add to the admin group:</p>
<pre>adduser myadminuser
usermod -G admin myadminuser</pre>
<blockquote><p>NOTE: Looks like the admin group is already part of sudoers so your new account has sudo privileges.</p></blockquote>
<p>Update the timezone:</p>
<pre>sudo dpkg-reconfigure tzdata</pre>
<p>Secure MySQL services in a quick fashion:</p>
<pre>sudo mysql_secure_installation</pre>
<p>Enable a few Apache2 modules:</p>
<pre>sudo a2enmod deflate
sudo a2enmod expires
sudo a2enmod cache
sudo /etc/init.d/apache2 force-reload</pre>
<p>Add a few PHP tools:</p>
<pre>sudo apt-get install php5-gd
sudo apt-get install php5-curl
sudo apt-get install php5-cli</pre>
<p>Secure SSH daemon by changing the port for SSH and disallow root login:</p>
<pre>sudo vim /etc/ssh/sshd_config
-- # Protocol 1
-- Protocol 2
-- ListenAddress 10.54.55.104 #your IP
-- Port 5502 # New port different than 22 and &lt; 65535
-- PermitRootLogin no
-- X11Forwarding no

sudo /etc/init.d/ssh restart</pre>
<p>Install the firewall and configure:</p>
<pre>sudo apt-get install ufw
sudo ufw default deny
sudo ufw allow http/tcp
sudo ufw allow 5502/tcp
sudo ufw enable
sudo ufw status verbose</pre>
<p>Configured PostFix by following pieces of our<a href="http://blog.tech4him.com/2009/08/linode-setup-domain-email-forwarding/"> previous post on PostFix and domain forwarding</a>.</p>
<pre>sudo vim main.cf
-- See article referenced
sudo vim virtual
-- See article referenced
sudo postmap virtual
sudo ufw allow 25/tcp
sudo postconf -e "inet_interfaces = all"
sudo /etc/init.d/postfix restart</pre>

<p>Lastly upon reboot we noticed that mysqld was failing. The problem was that mysqld was not binding correctly. We editing the my.cnf file and added BindAddress 127.0.0.1 above our existing BindAddress 10.54.55.104. This allows mysqld to bind and listen to both local loopback and the external IP (if needed)</p>
<p>At this point, we had not installed APC or MemCached yet. Performance was quite good with this setup and the minimal memory available to this test Linode. We ran six(6) Drupal , one (1) WordPress and one (1) CMS Made simple site with sub-second response times under fairly good load.</p>
<p>Kudos to Linode.com on their StackScript concept. I can certainly see this being very appealing for providers needing to crank out Linodes with a standard configuration for customers.</p>
<p>Blessings.</p>
<img src="http://blog.tech4him.com/?ak_action=api_record_view&id=891&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://blog.tech4him.com/2010/03/linode-stackscripts-and-lamp-servers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OpenPublish Demo at ADUG</title>
		<link>http://blog.tech4him.com/2010/02/openpublish-demo-at-adug/</link>
		<comments>http://blog.tech4him.com/2010/02/openpublish-demo-at-adug/#comments</comments>
		<pubDate>Fri, 19 Feb 2010 15:35:28 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Links/Resources]]></category>
		<category><![CDATA[drupal]]></category>
		<category><![CDATA[openpublish]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://blog.tech4him.com/?p=883</guid>
		<description><![CDATA[This video is from Atlanta Drupal User Group (ADUG) member Kent Lester,  and his presentation on Open Publish &#8211; the Drupal distribution created  by Phase2 Technology.

 
]]></description>
			<content:encoded><![CDATA[<p>This video is from <a href="http://www.mediacurrent.com/adug-meetup-video-footage-open-publish-and-drupal-gardens-demos" target="_blank">Atlanta Drupal User Group (ADUG)</a> member Kent Lester,  and his presentation on Open Publish &#8211; the Drupal distribution created  by Phase2 Technology.</p>
<p><span id="more-883"></span></p>
<p><embed type="application/x-shockwave-flash" width="640" 	height="504" 	allowfullscreen="true" 	allowscriptaccess="always" 	src="http://www.archive.org/flow/flowplayer.commercial-3.0.5.swf" 	w3c="true" 	flashvars='config={"key":"#$b6eb72a0f2f1e29f3d4","playlist":[{"url":"http://www.archive.org/download/DrupalOpenpublish-KentLester/format=Thumbnail?.jpg","autoPlay":true,"scaling":"fit"},{"url":"http://www.archive.org/download/DrupalOpenpublish-KentLester/DrupalOpenpublish-KentLester02092010_512kb.mp4","autoPlay":false,"accelerated":true,"scaling":"fit","provider":"h264streaming"}],"clip":{"autoPlay":false,"accelerated":true,"scaling":"fit","provider":"h264streaming"},"canvas":{"backgroundColor":"0x000000","backgroundGradient":"none"},"plugins":{"audio":{"url":"http://www.archive.org/flow/flowplayer.audio-3.0.3-dev.swf"},"controls":{"playlist":false,"fullscreen":true,"gloss":"high","backgroundColor":"0x000000","backgroundGradient":"medium","sliderColor":"0x777777","progressColor":"0x777777","timeColor":"0xeeeeee","durationColor":"0x01DAFF","buttonColor":"0x333333","buttonOverColor":"0x505050"},"h264streaming":{"url":"http://www.archive.org/flow/flowplayer.h264streaming-3.0.5.swf"}},"contextMenu":[{"View+DrupalOpenpublish-KentLester+at+archive.org":"function()"},"-","Flowplayer 3.0.5"]}'> </embed></p>
<img src="http://blog.tech4him.com/?ak_action=api_record_view&id=883&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://blog.tech4him.com/2010/02/openpublish-demo-at-adug/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://www.archive.org/download/DrupalOpenpublish-KentLester/DrupalOpenpublish-KentLester02092010_512kb.mp4&amp;quot" length="305389662" type="video/mp4" />
		</item>
		<item>
		<title>MySQLCheck For Quick Repair</title>
		<link>http://blog.tech4him.com/2010/02/mysqlcheck-for-quick-repair/</link>
		<comments>http://blog.tech4him.com/2010/02/mysqlcheck-for-quick-repair/#comments</comments>
		<pubDate>Mon, 15 Feb 2010 13:49:29 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://blog.tech4him.com/?p=880</guid>
		<description><![CDATA[Thanks to this tip on the Taragana blog, I was introduced to the mysqlcheck command. In a pinch, the following command will check, repair and optimize all tables in all databases on your MySQL server instance.
mysqlcheck -u root -p --auto-repair --check --optimize --all-databases
mysqlcheck is available in MySQL 3.23.38 and later.
The official documentation for mysqlcheck says: [...]]]></description>
			<content:encoded><![CDATA[<p>Thanks to <a href="http://blog.taragana.com/index.php/archive/mysql-tip-how-to-check-repair-optimize-all-tables-in-all-databases/" target="_blank">this tip on the Taragana blog</a>, I was introduced to the mysqlcheck command. In a pinch, the following command will check, repair and optimize all tables in all databases on your MySQL server instance.</p>
<p><code>mysqlcheck -u root -p --auto-repair --check --optimize --all-databases</code></p>
<p>mysqlcheck is available in MySQL 3.23.38 and later.</p>
<p>The <a href="http://dev.mysql.com/doc/refman/5.0/en/mysqlcheck.html" target="_blank">official documentation</a> for mysqlcheck says: <em>&#8220;The <a title="4.5.3. mysqlcheck — A Table Maintenance Program" href="http://dev.mysql.com/doc/refman/5.0/en/mysqlcheck.html"><strong>mysqlcheck</strong></a> client performs table         maintenance: It checks, repairs, optimizes, or analyzes tables.&#8221; </em>Now, this must be run on a MySQL instance that is currently running, unlike the myisamchk tool. So, you may want to stop all access to your instance. If you are using it for websites, perhaps kill HTTPD for a few minutes some other means.</p>
<img src="http://blog.tech4him.com/?ak_action=api_record_view&id=880&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://blog.tech4him.com/2010/02/mysqlcheck-for-quick-repair/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing APC on MediaTemple DV 3.5 for Drupal</title>
		<link>http://blog.tech4him.com/2009/12/installing-apc-on-mediatemple-dv-3-5-for-drupal/</link>
		<comments>http://blog.tech4him.com/2009/12/installing-apc-on-mediatemple-dv-3-5-for-drupal/#comments</comments>
		<pubDate>Fri, 11 Dec 2009 19:16:13 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[apc]]></category>
		<category><![CDATA[cache]]></category>
		<category><![CDATA[drupal]]></category>
		<category><![CDATA[mediatemple]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://blog.tech4him.com/?p=870</guid>
		<description><![CDATA[We have a few sites that exist on a MediaTemple DV 3.5 server. We&#8217;ve long been concerned about the lack of performance we are getting on this DV versus sites on a smaller Linode.com DV. We are not here to debate that today.
What we have done is to install APC on the MediaTemple DV in [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.tech4him.com/wp-content/uploads/3815370381_4dde638066.jpg"><img class="alignleft size-medium wp-image-871" style="margin: 8px;" title="3815370381_4dde638066" src="http://blog.tech4him.com/wp-content/uploads/3815370381_4dde638066-224x300.jpg" alt="3815370381_4dde638066" width="224" height="300" /></a>We have a few sites that exist on a MediaTemple DV 3.5 server. We&#8217;ve long been concerned about the lack of performance we are getting on this DV versus sites on a smaller <a href="http://linode.com" target="_blank">Linode.com</a> DV. We are not here to debate that today.</p>
<p>What we have done is to install APC on the MediaTemple DV in order to improve performance to some degree by taking advantage of op_code caching.  Now, this is not a silver bullet for performance folks. This is just one piece of a total tuning exercise. Be forewarned.</p>
<p><span id="more-870"></span>[<em>Note: You are on your own as with anything we present. We do not warranty nor represent explicitly nor implied that this will actually work for you. In fact, you might just hose things up badly. Don't call us, we warned you.  <img src='http://blog.tech4him.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  </em>]</p>
<h2>1. Install Developer Tools and Enable Root Access</h2>
<p>Log into your MediaTemple Account Center and go to the “Root Access &amp; Developer Tools” page. If Root access is not enabled, you&#8217;ll need to enable it. Be sure to set a massively secure password on this!</p>
<p>Also, if the developer tools have not yet been installed, then click the button to install them. Wait until the installation has finished before proceeding.</p>
<h2>2. Install APC</h2>
<p>Use your favorite SSH client to log into your server via SSH. Once you have logged in, you will perform the following commands:</p>
<ul>
<li>cd /usr/local/src</li>
<li>wget http://pecl.php.net/get/APC-3.0.19.tgz</li>
<li>gunzip -c APC-3.0.19.tgz | tar xf -</li>
<li>cd APC-3.0.19</li>
<li>/usr/bin/phpize</li>
<li>./configure –enable-apc –enable-apc-mmap –with-apxs2=/usr/sbin/apxs –with-php-config=/usr/bin/php-config</li>
<li>make</li>
<li>make install</li>
</ul>
<h2>3. Let PHP know about APC</h2>
<p>Now perform the following actions to modify your APC installation. (Thanks to <a href="http://www.timlinden.com/blog/server/installing-apc-cache-on-media-temple/" target="_blank">TimLinden</a> for the details)</p>
<ul>
<li>vi +/extension_dir /etc/php.ini</li>
<li>press i</li>
<li>press enter to start a new line</li>
<li>type extension = “apc.so”</li>
<li>press esc and then type :wq to exit and save (if you mess up type :q! to quit without saving)</li>
</ul>
<h2>4. Drupal APC customization</h2>
<p>Thanks to an <a href="http://2bits.com/articles/high-php-execution-times-drupal-and-tuning-apc-includeonce-performance.html" target="_blank">article from 2bits</a>, we made the following modifications to the php.ini to set some specific APC configuration options.</p>
<ul>
<li>vi +/extension_dir /etc/php.ini</li>
<li>press down arrow</li>
<li>press down arrow</li>
<li>press i</li>
<li>press enter to start a new line</li>
<li>type apc.apc.stat = 0</li>
<li>press enter</li>
<li>type apc.include_once_override = 1</li>
<li>press enter</li>
<li>type apc.shm_size = 64</li>
<li>press enter</li>
<li>press esc and then type :wq to exit and save (if you mess up type :q! to quit without saving)</li>
<li>service httpd stop</li>
<li>service httpd start</li>
</ul>
<p>For those that don&#8217;t need key press by key press instructions for the php.ini, here is what we added to the php.ini</p>
<pre>extension = “apc.so”
apc.apc.stat = 0
apc.include_once_override = 1
apc.shm_size = 64</pre>
<p>Hopefully this will help you get things started. Obviously, we are still testing and tweaking but this has provided some good improvements for a few sites that are located on a MediaTemple DV 3.5 server.</p>
<img src="http://blog.tech4him.com/?ak_action=api_record_view&id=870&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://blog.tech4him.com/2009/12/installing-apc-on-mediatemple-dv-3-5-for-drupal/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Fix Your Hosed Admin Menu</title>
		<link>http://blog.tech4him.com/2009/12/fix-your-hosed-admin-menu/</link>
		<comments>http://blog.tech4him.com/2009/12/fix-your-hosed-admin-menu/#comments</comments>
		<pubDate>Thu, 10 Dec 2009 04:48:09 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[drupal]]></category>
		<category><![CDATA[drupal 6]]></category>
		<category><![CDATA[menu]]></category>
		<category><![CDATA[module]]></category>

		<guid isPermaLink="false">http://blog.tech4him.com/?p=863</guid>
		<description><![CDATA[Here&#8217;s a quick fix. We have a site that has been through a number of migrations, moves and upgrades. We use the Admin module that provide a nice UI for site administration. Somewhere along the way, the admin menu items got completely hosed.


Note that we have no &#8220;Content&#8221; menu in administration. Also, notice that in [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a quick fix. We have a site that has been through a number of migrations, moves and upgrades. We use the <a href="http://drupal.org/project/admin" target="_blank">Admin module</a> that provide a nice UI for site administration. Somewhere along the way, the admin menu items got completely hosed.</p>
<p><span id="more-863"></span></p>
<div id="attachment_864" class="wp-caption aligncenter" style="width: 310px"><a href="http://blog.tech4him.com/wp-content/uploads/Admin-Menu-Hosed.png"><img class="size-medium wp-image-864" title="Admin Menu Hosed" src="http://blog.tech4him.com/wp-content/uploads/Admin-Menu-Hosed-300x171.png" alt="Admin Menu Hosed" width="300" height="171" /></a><p class="wp-caption-text">Admin menu completely hosed.</p></div>
<p style="text-align: center;">
<p>Note that we have no &#8220;Content&#8221; menu in administration. Also, notice that in the screenshot, we are in the Configuration menu but only have a single configuration item. That certainly doesn&#8217;t look right. <img src='http://blog.tech4him.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>So after a bit of Googling  we first tried truncating the cache_menu table without success. Finally we decided to try a simple thought. We disabled the Admin menu. Then we re-enabled the Admin menu and Voila, our admin menus have been fixed. Go Figure.</p>
<div id="attachment_865" class="wp-caption aligncenter" style="width: 310px"><a href="http://blog.tech4him.com/wp-content/uploads/Admin-Menu-Fixed.png"><img class="size-medium wp-image-865" title="Admin Menu Fixed" src="http://blog.tech4him.com/wp-content/uploads/Admin-Menu-Fixed-300x203.png" alt="Admin menu all fixed." width="300" height="203" /></a><p class="wp-caption-text">Admin menu all fixed.</p></div>
<p>Just goes to show that sometimes the basic troubleshooting steps can fix something that looks worse than it really is.</p>
<img src="http://blog.tech4him.com/?ak_action=api_record_view&id=863&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://blog.tech4him.com/2009/12/fix-your-hosed-admin-menu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Parent Feed Title in FeedAPI Item Node</title>
		<link>http://blog.tech4him.com/2009/10/parent-feed-title-in-feedapi-item-node/</link>
		<comments>http://blog.tech4him.com/2009/10/parent-feed-title-in-feedapi-item-node/#comments</comments>
		<pubDate>Thu, 29 Oct 2009 22:35:58 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[drupal]]></category>
		<category><![CDATA[feedapi]]></category>
		<category><![CDATA[openpublish]]></category>
		<category><![CDATA[templates]]></category>
		<category><![CDATA[theme]]></category>

		<guid isPermaLink="false">http://blog.tech4him.com/?p=853</guid>
		<description><![CDATA[We recently began testing the installation profile for Drupal called OpenPublish. The good folks at Phase 2 Technology have opened this installation profile (distribution) up for all to use with some key features for the semantic web. This post is not to go over or compares features with other similar distributions. Instead this is more [...]]]></description>
			<content:encoded><![CDATA[<p>We recently began testing the installation profile for <a href="http://drupal.org" target="_blank">Drupal</a> called <a href="http://www.opensourceopenminds.com/openpublish" target="_blank">OpenPublish</a>. The good folks at <a href="http://www.phase2technology.com/" target="_blank">Phase 2 Technology</a> have opened this installation profile (distribution) up for all to use with some key features for the semantic web. This post is not to go over or compares features with other similar distributions. Instead this is more about how to get the parent feed title into the template for a node created from a feed-item with the <a href="http://drupal.org/project/feedapi" target="_blank">feedapi module</a>.</p>
<p><span id="more-853"></span></p>
<p><a href="http://blog.tech4him.com/wp-content/uploads/drupal_by_line_parent_feed.png"><img class="alignright size-medium wp-image-854" title="drupal_by_line_parent_feed" src="http://blog.tech4him.com/wp-content/uploads/drupal_by_line_parent_feed-300x101.png" alt="drupal_by_line_parent_feed" width="300" height="101" /></a>Let&#8217;s jump right in. The scenario is that we have a content type of article. The node-article.tpl.php displays the Drupal node author as part of the by line of the article. In our case, we wanted to change this.</p>
<p>Instead, we will have articles created by staff, as well as articles automatically generated from RSS feeds. It is important for us to honor our partners by not showing the article as being authored by us, but instead to change the authored by line to give credit to the originating feed source where appropriate.</p>

<p>Enough talk, let&#8217;s see details.</p>
<p>First, we need to make the parent feed&#8217;s title and link available as a variable for the templates. We did this in Drupal 6 by adding to the existing template.php file. Using the <a href="http://drupal.org/node/223430" target="_blank"><em>phptemplate_preprocess_node</em></a> hook, we can add variables that can be accessed in node templates. (Note: If you are following along in an OpenPublish distribution, this function does not exist in the standard template.php file. You will need to add it.)</p>
<p>Keep in mind that when you use feedapi/feedapi node module to turn a feed item into a node, the <em>$node</em> object does not have all the details about the parent feed that generated the feed-item. It does however contain the <em>nid</em> (node id) of the feed that generated it. Soooo&#8230; in our custom code, we need to get this parent feed nid, load the feed title and url and then stuff the link into a variable to use in our node template.</p>
<p>Here is the function as added to the template.php:</p>
<pre>/**
* Override or insert PHPTemplate variables into the node templates.
*/
function phptemplate_preprocess_node(&amp;$vars) {</pre>
<pre>  // 20091029 Added for Parent Feed Title Link
 if ($vars['node']-&gt;feedapi_node-&gt;feed_nids) {
    $parent_feed_node_id = array_values($vars['node']-&gt;feedapi_node-&gt;feed_nids);
    $parent_feed_node = node_load($parent_feed_node_id[0]);
    $vars['parent_feed_link'] = l($parent_feed_node-&gt;title, $parent_feed_node-&gt;feed-&gt;url);
  }</pre>
<pre>}</pre>
<p>Just a note that the array index of <em>feed_nids</em> is not zero based but instead, the array index is the same number as the <em>nid</em>. That makes doing the typical <em>$vars['node']-&gt;feedapi_node-&gt;feed_nids[0]</em> impossible. That is where the php <em>array_values()</em> function comes to the rescue. It takes all the array values from <em>feed_nids</em> and created a zero base indexed array.</p>
<p>Now, we have a variable called <em>$parent_feed_link</em> that is available in our template files. So, our next step is to use it. Since the content type we want to impact is the article type, we are going to modify our node-article.tpl.php. Below is the portion of the file that outputs the article by line:</p>
<pre>&lt;div&gt;Article |
&lt;?php print date('m.d.y', $node-&gt;created); ?&gt;
 | By  
&lt;?php  
 $author = user_load(array('uid' =&gt; $node-&gt;uid));
 if ($parent_feed_link) {
   print $parent_feed_link;
 }
 else {
   print l($author-&gt;profile_full_name, 'user/'.$node-&gt;uid);  
 }
?&gt;    
&lt;/div&gt;</pre>
<p>As you can see above, we now test to see if the <em>$parent_feed_link</em> actually has a value. If so, we want to output that link. Otherwise, the article was not created from a feed-item and we want to show the actual author of the node.</p>
<p>I know this is simple for many of you, however it took me a little while to figure out where in Drupal 6 to generate these custom variables. In Drupal 5, you may have typically done this in the <em>_phptemplate_variables</em> hook in your template.php.</p>
<h4>Well, did we do it wrong? Do you know a better way? Let us know with a comment below.</h4>
<p>Blessings.</p>
<img src="http://blog.tech4him.com/?ak_action=api_record_view&id=853&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://blog.tech4him.com/2009/10/parent-feed-title-in-feedapi-item-node/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
