<?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>Martian Thoughts on Design</title>
	<atom:link href="http://blogs.martiangraphix.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.martiangraphix.com</link>
	<description>Design, Web Development, and Interesting Technology</description>
	<lastBuildDate>Fri, 06 Aug 2010 16:41:20 +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>Dreamweaver CS5 adds support HTML5</title>
		<link>http://blogs.martiangraphix.com/2010/05/dreamweaver-cs5-adds-support-html5/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=dreamweaver-cs5-adds-support-html5</link>
		<comments>http://blogs.martiangraphix.com/2010/05/dreamweaver-cs5-adds-support-html5/#comments</comments>
		<pubDate>Thu, 20 May 2010 21:44:00 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[CSS3]]></category>
		<category><![CDATA[Dreamweaver]]></category>
		<category><![CDATA[HTML5]]></category>

		<guid isPermaLink="false">http://blogs.martiangraphix.com/?p=279</guid>
		<description><![CDATA[Just saw that Adobe has added support for HTML5 and CSS3 to Dreamweaver CS5.  You can find the extension at Adobe Labs. 
The extension adds support for CSS3 and some HTML5 tags in Live View, HTML5 and CSS3 code hinting, HTML5 starter documents, plus some other things.  I&#8217;m expecting the features in this [...]]]></description>
			<content:encoded><![CDATA[<p>Just saw that <strong>Adobe</strong> has added support for <strong>HTML5</strong> and <strong>CSS3</strong> to <strong>Dreamweaver CS5</strong>.  You can find the extension at <a href="http://labs.adobe.com/technologies/html5pack/"><strong>Adobe Labs</strong></a>. </p>
<p>The extension adds support for <strong>CSS3</strong> and some <strong>HTML5</strong> tags in <strong>Live View</strong>, <strong>HTML5</strong> and <strong>CSS3</strong> code hinting, <strong>HTML5</strong> starter documents, plus some other things.  I&#8217;m expecting the features in this extension to improve in the future as more <strong>HTML5</strong> features get rolled into browsers. </p>
<p>I&#8217;m really looking forward to getting a chance to play with this.  With that, and the additions of <strong>Drupal</strong> and <strong>WordPress</strong> support, <strong>Dreamweaver CS5</strong> looks to become quite a useful tool for doing web development.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.martiangraphix.com/2010/05/dreamweaver-cs5-adds-support-html5/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Christmas in April, Part II</title>
		<link>http://blogs.martiangraphix.com/2010/04/christmas-in-april-part-ii/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=christmas-in-april-part-ii</link>
		<comments>http://blogs.martiangraphix.com/2010/04/christmas-in-april-part-ii/#comments</comments>
		<pubDate>Tue, 13 Apr 2010 22:30:50 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Adobe]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[iPad]]></category>
		<category><![CDATA[MacBook Pro]]></category>

		<guid isPermaLink="false">http://blogs.martiangraphix.com/?p=255</guid>
		<description><![CDATA[We began discussing what an interesting month April has been in Christmas in April, Part I.  Now we&#8217;ll get into what&#8217;s happening with Apple.
Apple kicked off the month with the official release of the iPad.  I personally think the device is a huge deal.  I can definitely see where it would fit [...]]]></description>
			<content:encoded><![CDATA[<p>We began discussing what an interesting month April has been in <a href="http://blogs.martiangraphix.com/2010/04/christmas-in-april-part-i/">Christmas in April, Part I</a>.  Now we&#8217;ll get into what&#8217;s happening with <strong>Apple</strong>.</p>
<p><strong>Apple</strong> kicked off the month with the official release of the <strong>iPad</strong>.  I personally think the device is a huge deal.  I can definitely see where it would fit in with my day to day activities.</p>
<p>Then this week, the released the long awaited <strong>MacBook Pro</strong>.  As I said in the previous article, I&#8217;ve been holding out for this machine for a long time, and I&#8217;m super excited to get one.  <span id="more-255"></span>The changes don&#8217;t seem huge from the previous version, but the GPU switching and the use of the <strong>Core i5 &#038; i7</strong> technology are really going to have an impact.  I&#8217;m expecting a 100x-200x improvement in processing from my current <strong>PowerBook Pro G4</strong>.  That sucker has performed like a champ, but at last it&#8217;s time has come.  There are just too many tools that I need to run which no longer support the old PPC processors.  </p>
<p>On April 8th, <strong>Apple</strong> announced the changes for <strong>iPhone OS 4.0</strong>.  I read those with interest.   I&#8217;m sure I&#8217;ll be happy to have those, but the multi-tasking that everyone has been clamoring for won&#8217;t impact my <strong>iPhone 3G</strong>.</p>
<p>I can&#8217;t say I&#8217;m thrilled with the <strong>iAd</strong> business.  The last thing I want is more advertising in my apps, but I suppose if it keeps a few developers afloat and offering their products for free, it&#8217;s something I&#8217;ll have to live with&#8230;..as long as I can ignore the ads.  If some developer puts them in there where I can&#8217;t avoid them, then I&#8217;ll delete the app!  </p>
<p>The changes to the <strong>Terms of Service</strong> agreement that comes with the new SDK have been widely <a href="http://arstechnica.com/apple/news/2010/04/apple-takes-aim-at-adobe-or-android.ars">talked about</a>.  This impacts not only <strong>Flash</strong> and <strong>Android</strong>, but also <a href="http://monotouch.net/"><strong>MonoTouch</strong></a> and <a href="http://unity3d.com/"><strong>Unity</strong></a>.</p>
<p>On the one hand, I understand why <strong>Apple</strong> wants to maintain tight control of their platforms.  When you get a buggy app, that can reflect badly on the device.  But it should be clear to most people by now that <strong>Apple</strong> produces great products.  </p>
<p>On the other hand, I must say I&#8217;m becoming increasingly frustrated with <strong>Apple&#8217;s</strong> attitude toward would be developers.  Sure they have great products, but their development tools are nothing special, at least not when you compare them to <strong>Visual Studio</strong>.  In fact in some ways they&#8217;re downright clunky.  Say what you like about <strong>Microsoft</strong>, they make <em>outstanding</em> developer tools, and they go out of their way to help developers make applications that run on their systems.</p>
<p>Personally I&#8217;m not all that thrilled about learning a language that can only be used on <strong>Apple&#8217;s</strong> products.  <strong>Objective C</strong>, at least from talking with friends about it, is not really a great language to program in.  And the fact that it is in no way cross platform just makes it less interesting.</p>
<p>Luckily, most of my developing is web related.  So you&#8217;d think having <strong>Apple</strong> push open standards like <strong>HTML5</strong> is a good thing.  The only problem with that is that it isn&#8217;t really quite as &#8220;standard&#8221; as it would appear.  <a href="http://www.webmonkey.com/2010/04/flash-faces-down-threats-on-adobes-big-day/"><strong>WebMonkey</strong> does a good job</a> of discussing why having <strong>HTML</strong> based video is going to be a mess for a long time to come.  Basically, each browser maker has decided to support differing encoding standards.</p>
<p>This frustration is getting deep enough now, that I&#8217;m even considering purchasing a device other than the <strong>iPad</strong> next year, when I get ready for that type of device.  At the very least, it&#8217;s given <strong>Google</strong> and <strong>Microsoft</strong> an opening in my mind, which considering how much I love my <strong>PowerBook Pro</strong> and <strong>iPhone</strong>, is <em>truly sad</em>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.martiangraphix.com/2010/04/christmas-in-april-part-ii/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Christmas in April, Part I</title>
		<link>http://blogs.martiangraphix.com/2010/04/christmas-in-april-part-i/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=christmas-in-april-part-i</link>
		<comments>http://blogs.martiangraphix.com/2010/04/christmas-in-april-part-i/#comments</comments>
		<pubDate>Tue, 13 Apr 2010 11:17:48 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Adobe]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[CS5]]></category>
		<category><![CDATA[Dreamweaver]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Illustrator]]></category>
		<category><![CDATA[InDesign]]></category>
		<category><![CDATA[Photoshop]]></category>

		<guid isPermaLink="false">http://blogs.martiangraphix.com/?p=249</guid>
		<description><![CDATA[This is a pretty exciting month for the tools we use in our business, and technology in general.  Monday, Adobe annouced CS5 and Microsoft finalized Visual Studio 2010.  Last week Apple released the iPad, and this week it released the new Core i5 &#038; Core i7 MacBook Pros. 
For me, it is beyond [...]]]></description>
			<content:encoded><![CDATA[<p>This is a pretty exciting month for the tools we use in our business, and technology in general.  Monday, <a href="http://www.adobe.com/products/creativesuite/"><strong>Adobe</strong> annouced <strong>CS5</strong></a> and <a href="http://msdn.microsoft.com/en-us/default.aspx"><strong>Microsoft</strong> finalized <strong>Visual Studio 2010</strong></a>.  Last week <strong>Apple</strong> released the <strong>iPad</strong>, and this week it released the new <strong>Core i5 &#038; Core i7 MacBook Pros</strong>. </p>
<p>For me, it is <em>beyond</em> time to upgrade my systems, so this is about to be a very expensive month.  I&#8217;ve <em>literally</em> been waiting on these new <strong>MacBook Pros</strong> for two years, ever since I read about these new processors from <strong>Intel</strong>.  And with this new computer, it is also time to upgrade the <strong>Adobe</strong> software, so this year&#8217;s tech budget is pretty much gone. </p>
<p><span id="more-249"></span><br />
<h3>Adobe CS5</h3>
<p>First let&#8217;s talk about the new release from <strong>Adobe</strong>.  I was pretty interested to see what was going to change with <strong>CS5</strong>.  I was a bit surprised at the lack of whoopla at many of the Tech News sites I read.  The mostly gave it a shout, but it lacked much of the marketing hype that I remember from <strong>CS4</strong>.  In the next few days, I expect to see a bit more from the guys at <a href="http://www.layersmagazine.com/"><strong>Layers Magazine</strong></a>, <a href="http://www.planetphotoshop.com/"><strong>PlanetPhotoshop.com</strong></a>, and the others whose jobs revolve around making the Adobe products seem fantastic.  Don&#8217;t get me wrong, I really appreciate the services that those guys at <strong>Kelby Training</strong> provide, I could have just done without the sugar coating that they gave <strong>CS4</strong>, especially since it turned out to be mostly a dud, at least in sales terms. </p>
<p>So what&#8217;s in new and compelling in <strong>CS5</strong>?  Looking through <a href="http://www.adobe.com/"><strong>Adobe&#8217;s</strong></a> website, most of the products seem to have only gotten minor updates.  Edge detection and new brush effects in <a href="http://www.adobe.com/products/photoshop/photoshopextended/whatsnew/index.html?segment=design"><strong>Photoshop</strong></a>? (yawn)  For <a href="http://www.adobe.com/products/illustrator/whatsnew/"><strong>Illustrator</strong></a>, perspective drawing could be cool, but most of the rest of it should have been in there a long time ago. <a href="http://www.adobe.com/products/flash/whatsnew/"><strong>Flash</strong></a>? XML swf file, and <a href="http://www.adobe.com/products/flashbuilder/"><strong>Flash Builder</strong></a> integration. Seriously?  That needs to be pointed out? (zzzzz)</p>
<p>But all is not doomed&#8230;..<a href="http://www.adobe.com/products/indesign/whatsnew/"><strong>InDesign</strong></a> seems to have gotten a reasonable number of &#8220;new&#8221; features.  eBook publishing and multiple pages sizes look interesting and useful.  </p>
<p>And then we get to <a href="http://www.adobe.com/products/dreamweaver/whatsnew/"><strong>Dreamweaver</strong></a>.  <strong>Dreamweaver</strong> is a big part of what we do here at <strong>Martian Graphix</strong> (so are the other tools, but those updates just aren&#8217;t really showing huge impacts to our daily workflow).  <a href="http://drupal.org/"><strong>Drupal</strong></a> and <a href="http://www.wordpress.org/"><strong>WordPress</strong></a> are also big for us, so finding good support for those systems in <strong>Dreamweaver</strong> is a major plus for our business.  <strong>Dreamweaver CS5</strong> also includes CSS inspection tools, which will cut down on needing to use <a href="https://addons.mozilla.org/en-US/firefox/addon/60"><strong>Firefox&#8217;s Web Developer Toolbar</strong></a>.  Rendering dynamic pages without having to jump over to a browser is going to be a huge win.  Also using the code hinting features with the <strong>Drupal</strong>, <strong>WordPress</strong>, or just PHP methods is going to be a <em>big</em> plus.  It&#8217;s very nice to finally see an update to <strong>Dreamweaver</strong> that focuses on the Developer side of the tool, more than the Designer oriented side, because both sides of web development must be supported equally.  I&#8217;m not going stop using <a href="http://netbeans.org/"><strong>NetBeans</strong></a> or <a href="http://eclipse.org/"><strong>Eclipse</strong></a> anytime soon, but this is definitely a nice direction to see <strong>Dreamweaver</strong> heading. </p>
<p>So, what&#8217;s the verdict?  For us, the updates to <strong>Dreamweaver</strong> provide a very compelling reason to upgrade from <strong>CS3</strong>.  Add to that the incremental changes made to the other tools with <strong>CS4</strong> and <strong>CS5</strong>, plus the fact that all this is optimized to run on the Intel processor of the <strong>MacBook Pro</strong>, as opposed to <strong>CS3</strong>, and the conclusion is: yes it&#8217;s time to bite the bullet and upgrade. </p>
<p>Now, which version?  The <strong>Web Premium</strong> would seem like the obvious choice, but since it only seems to include the Standard edition of <strong>Flash Builder</strong>, I think we&#8217;ll go with <strong>Design Premium</strong> instead, and buy <strong>Flash Builder</strong> seperately, when the time comes. </p>
<p>Now, what about all this stuff from <strong>Apple</strong>?  Stay tuned for the next article, <a href="http://blogs.martiangraphix.com/2010/04/christmas-in-april-part-ii/">Christmas in April, Part II</a>. </p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.martiangraphix.com/2010/04/christmas-in-april-part-i/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Updating Drupal Multi-Site on OS X</title>
		<link>http://blogs.martiangraphix.com/2010/03/updating-drupal-multisite-on-os-x/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=updating-drupal-multisite-on-os-x</link>
		<comments>http://blogs.martiangraphix.com/2010/03/updating-drupal-multisite-on-os-x/#comments</comments>
		<pubDate>Mon, 01 Mar 2010 21:06:21 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Drupal]]></category>
		<category><![CDATA[Multi-Site]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[Planet Drupal]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Update]]></category>

		<guid isPermaLink="false">http://blogs.martiangraphix.com/?p=189</guid>
		<description><![CDATA[We&#8217;re continuing on with the tutorials for the Drupal Multi-Site configuration that I set up on my Mac.  All the domain and directory structure is based on that tutorial, so if you&#8217;ve done something slightly different, you&#8217;ll need to adjust as appropriate.
Were following the basic procedure laid out in the UPGRADE.txt in your Drupal [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;re continuing on with the tutorials for the <a href="http://blogs.martiangraphix.com/2009/09/building-a-drupal-development-environment-for-mac/">Drupal Multi-Site configuration</a> that I set up on my Mac.  All the domain and directory structure is based on that tutorial, so if you&#8217;ve done something slightly different, you&#8217;ll need to adjust as appropriate.</p>
<p><span id="more-189"></span>Were following the basic procedure laid out in the UPGRADE.txt in your Drupal core installation, so if you run into any problems you can get some additional tips there. </p>
<p>I&#8217;m writing a special tutorial on this because, when we set up our installation in the <a href="http://blogs.martiangraphix.com/2009/09/building-a-drupal-development-environment-for-mac/">Building A Drupal Development Environment page</a>, I set up some permissions on the <em>sites/</em> directory.  These permissions made it easier for us to access the files, but we&#8217;ll need to tweak a few things in the upgrade procedure to preserve these permissions.</p>
<p>So, in this tutorial, I&#8217;m going to show you step by step how to easily accomplish the upgrade.  </p>
<h2>Step 1: Log into your Drupal site as the administrative user</h2>
<p>Hopefully this is pretty self explanatory.</p>
<h2>Step 2: Set the site into maintenance mode</h2>
<p>Now, you&#8217;ll navigate to the <strong>Site maintenance</strong> page for the site, using the navigation links: <strong>Administer > Site configuration > Site maintenance</strong></p>
<h2>Step 3: Switch to one of the default themes</h2>
<p>If you&#8217;ve installed a custom theme, you&#8217;ll need to switch out to one of the ones that came with Drupal.  I&#8217;ll use Garland.</p>
<p>You get there by navigating to: <strong>Administer > Site building > Themes</strong>.</p>
<p>Make sure that Garland is <strong>Enabled</strong>, and that it is selected as the <strong>Default</strong>.  Save the configuration.</p>
<h2>Step 4: Disable any added modules</h2>
<p>We need to disable any modules that we&#8217;ve installed, which were not part of the Drupal Core.  Navigate to the modules page: <strong>Administer > Site building > Modules</strong></p>
<p>You do NOT need to disable anything in <strong>Core &#8211; required</strong> or <strong>Core &#8211; optional</strong>, but disable anything you see in the other section.  You can do this by unchecking the box in front of the module.  As you go through this, you&#8217;ll want to make a list of which modules you&#8217;re disabling, so you can turn these back on when we&#8217;re done.</p>
<p>When you&#8217;ve unchecked the modules, select <strong>Save configuration</strong> at the bottom of the list when done.</p>
<p>You may need to go through this several times to make sure all the modules are turned off, because some modules are required by others, and can&#8217;t be unchecked the first time through.  </p>
<h2>Step 5: Repeat Steps 1-4</h2>
<p>You&#8217;ll need to perform <strong>Steps 1-4</strong> for each site that you&#8217;ve installed.  You should be able to see all the sites you have by looking in your <em>~/Sites/drupal/6/sites/</em> folder.</p>
<p>Once you&#8217;ve gotten all your sites ready for upgrade, return here.</p>
<h2>Step 6: Backup the databases</h2>
<p>Now we need to make a backup of our databases.  We&#8217;ll start by opening the Terminal, and navigating to the our ~/Sites/drupal/ folder.  Once there, we&#8217;ll double check the name of our database.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #7a0874; font-weight: bold;">cd</span> ~<span style="color: #000000; font-weight: bold;">/</span>Sites<span style="color: #000000; font-weight: bold;">/</span>drupal<span style="color: #000000; font-weight: bold;">/</span>
$ mysql <span style="color: #660033;">-u</span> yourrootaccount <span style="color: #660033;">-p</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;SHOW SCHEMAS&quot;</span></pre></div></div>

<p>Again, we&#8217;re using <em>yourrootaccount</em>, because I change the name of the root user on my databases as a simple security precaution.</p>
<p>Identify the database for the website, and we&#8217;ll back it up.  Following my previous examples, I&#8217;d need to backup &#8220;drupal_sandbox&#8221; and &#8220;drupal_essentials&#8221;, plus the other databases I&#8217;ve added.  To do this, do the following:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>mysql<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>mysqldump <span style="color: #660033;">-u</span> yourrootuser <span style="color: #660033;">-p</span> <span style="color: #660033;">--databases</span> drupal_sandbox drupal_essentials <span style="color: #000000; font-weight: bold;">&gt;</span> drupal_20100301.sql</pre></div></div>

<p>Verify that the file looks correct:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">ls</span>
$ <span style="color: #c20cb9; font-weight: bold;">head</span> <span style="color: #660033;">-n</span> <span style="color: #000000;">100</span> drupal_20100301.sql</pre></div></div>

<h2>Step 7: Download the latest version of Drupal</h2>
<p>You can get this from the <a href="http://drupal.org/project/drupal">Drupal Project Download</a> page.  At the time of this writing, Drupal 6.15 is the latest production build, so that&#8217;s what we&#8217;re using.</p>
<p>Download the file and move it into your <em>~Sites/drupal/</em> directory.  If your browser is set up to use your user&#8217;s <em>Downloads/</em> folder, switch back to the Terminal and perform the following:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #7a0874; font-weight: bold;">cd</span> ~<span style="color: #000000; font-weight: bold;">/</span>Downloads<span style="color: #000000; font-weight: bold;">/</span>
$ <span style="color: #c20cb9; font-weight: bold;">mv</span> drupal-6.15.tar.gz ~<span style="color: #000000; font-weight: bold;">/</span>Sites<span style="color: #000000; font-weight: bold;">/</span>drupal<span style="color: #000000; font-weight: bold;">/</span></pre></div></div>

<p>Verify that the file is in your <em>~/Sites/drupal/</em> folder.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #7a0874; font-weight: bold;">cd</span> ~<span style="color: #000000; font-weight: bold;">/</span>Sites<span style="color: #000000; font-weight: bold;">/</span>drupal<span style="color: #000000; font-weight: bold;">/</span>
$ <span style="color: #c20cb9; font-weight: bold;">ls</span> <span style="color: #660033;">-l</span></pre></div></div>

<h2>Step 8: Rename the core directory</h2>
<p>We&#8217;re going to move our Drupal files directory to a new location as a backup.  We&#8217;re going to need our <em>sites/</em> folder later on.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #7a0874; font-weight: bold;">cd</span> ~<span style="color: #000000; font-weight: bold;">/</span>Sites<span style="color: #000000; font-weight: bold;">/</span>drupal<span style="color: #000000; font-weight: bold;">/</span>
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">mv</span> <span style="color: #000000;">6</span> <span style="color: #000000;">6</span>_backup</pre></div></div>

<h2>Step 9: Install the new version of Drupal</h2>
<p>Now we&#8217;ll unpack the new version of Drupal that we downloaded in <strong>Step 7</strong>.  We&#8217;re also going to rename it to <em>6/</em>, as we had in our original installation.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">tar</span> <span style="color: #660033;">-xzf</span> drupal-6.15.tar.gz
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">mv</span> drupal-<span style="color: #000000;">6.15</span> <span style="color: #000000;">6</span></pre></div></div>

<h2>Step 10: Copy the old files back to the new installation</h2>
<p>Now we need to move all of our custom files back into the new directory. </p>
<p>To start with, we need to make sure we grab the cronall script we created in<a href="http://blogs.martiangraphix.com/2009/09/building-a-drupal-development-environment-for-mac/"> Building a Drupal development environment on Mac OS X</a>.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #000000;">6</span>_backup<span style="color: #000000; font-weight: bold;">/</span>cronall.php <span style="color: #000000;">6</span><span style="color: #000000; font-weight: bold;">/</span></pre></div></div>

<p>If you&#8217;ve modified any other files, in Drupal&#8217;s core (e.g. .htaccess, robots.txt, or something in <em>themes/</em>), copy those into the <em>6/</em> folder now.</p>
<p>Now we&#8217;re at the step where we need to make sure to preserve the permissions for the webserver. In order to do this we&#8217;ll use the <strong>cp -Rp</strong> command.  You&#8217;ll need to make sure to include the <strong>sudo</strong> command in front of the copy command, or you&#8217;ll loose the permissions in the <em>sites/</em> folder.  So run the following in the Terminal:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #660033;">-Rp</span> <span style="color: #000000;">6</span>_backup<span style="color: #000000; font-weight: bold;">/</span>sites <span style="color: #000000;">6</span><span style="color: #000000; font-weight: bold;">/</span></pre></div></div>

<p>Verify that the folders in sites still have the www group.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">ls</span> <span style="color: #660033;">-l</span> <span style="color: #000000;">6</span><span style="color: #000000; font-weight: bold;">/</span>sites<span style="color: #000000; font-weight: bold;">/</span></pre></div></div>

<h2>Step 11: Run the update</h2>
<p>Go back to your browser and run the update script:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;">http://drupal6.local/update.php</pre></div></div>

<p>Follow the screen prompts, using the defaults.  You should select <strong>Continue</strong> and then <strong>Update</strong>, and the process will run automatically.  Select the <strong>Administration pages</strong> link at the end of the process.</p>
<h2>Step 12: Check the Status Report</h2>
<p>You&#8217;ll want to verify that the update process ran correctly by checking the status report.  Navigate to <strong>Administer > Reports > Status report</strong> and click <strong>run cron manually</strong>. </p>
<p>You should see the new version at the top of the table, and everything else should be green.</p>
<h2>Step 13: Restore your Modules</h2>
<p>Go back into the Modules page and restore your modules.  Navigate to the page by going to: <strong>Administer > Site building > Modules</strong></p>
<p>Using the list of modules you made in <strong>Step 4</strong>, select the check box in front of each module to turn it back on.  You should be able to select all the modules the first time through the screen.  When you&#8217;re done, select <strong>Save configuration</strong> at the bottom of the screen.</p>
<p>Once the configuration has been saved, you should get a yellow box at the top asking about new releases.  Select the <strong>check manually</strong> link in this box, to see if you need to update any of your modules.</p>
<p>If you get a message that says you need to update your modules, select the <strong>available updates</strong> link to see which modules need to be updated.  If all your modules are current, skip to <strong>Step 15</strong>.</p>
<h2>Step 14: Update your Modules</h2>
<p>From the <strong>Available updates</strong> page, select the <strong>Download</strong> link for each module that needs to be updated.  Copy the tar file into the <em>modules/</em> folder for this particular site.  For example, if it was the CCK module, you would do the following:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #7a0874; font-weight: bold;">cd</span> ~<span style="color: #000000; font-weight: bold;">/</span>Sites<span style="color: #000000; font-weight: bold;">/</span>drupal<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">6</span>
$ <span style="color: #c20cb9; font-weight: bold;">cp</span> ~<span style="color: #000000; font-weight: bold;">/</span>Downloads<span style="color: #000000; font-weight: bold;">/</span>CCK-6.x-2.1.tar.gz sites<span style="color: #000000; font-weight: bold;">/</span>drupal6.local<span style="color: #000000; font-weight: bold;">/</span>modules<span style="color: #000000; font-weight: bold;">/</span></pre></div></div>

<p>Now copy the existing module folder someplace else temporarily, and then unpack the new module.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #7a0874; font-weight: bold;">cd</span> sites<span style="color: #000000; font-weight: bold;">/</span>drupal6.local<span style="color: #000000; font-weight: bold;">/</span>modules
$ <span style="color: #c20cb9; font-weight: bold;">mv</span> cck ~<span style="color: #000000; font-weight: bold;">/</span>Desktop<span style="color: #000000; font-weight: bold;">/</span>cck_backup
$ <span style="color: #c20cb9; font-weight: bold;">tar</span> <span style="color: #660033;">-xzf</span> CCK-6.x-2.1.tar.gz</pre></div></div>

<p>Back in the browser, check that your updates are all correct, by refreshing the <strong>Available updates</strong> page.  Once you have all the correct versions of your modules, proceed to <strong>Step 15</strong>.</p>
<h2>Step 15: Restore your theme</h2>
<p>Return to the <strong>Themes</strong> page, by navigating to <strong>Administer > Site building > Themes</strong></p>
<p>Make sure your theme is <strong>Enabled</strong> and selected as the <strong>Default</strong>, and then select <strong>Save configuration</strong>. </p>
<h2>Step 16: Bring the site back online</h2>
<p>Now we need to reactivate the site.  Navigate to <strong>Administer > Site configuration > Site maintenance</strong> and set your site&#8217;s status to <strong>Online</strong>.</p>
<p>Then select <strong>Save configuration</strong> to reactivate the site.  Log out and go back to the <strong>Home</strong> page, to verify that your site is functioning correctly.  Navigate through some of your pages, to make sure everything looks OK.</p>
<h2>Step 17: Repeat Steps 12-16</h2>
<p>You&#8217;ll need to repeat <strong>Steps 12-16</strong> for each site that you&#8217;re maintaining.</p>
<p>Note: Sometimes an update will change some of the underlying database tables.  These changes can affect your modules, so you&#8217;ll need to make sure to run the status report on each site you have installed.  You may need to run the database update script on each site, before you can reactivate the modules.</p>
<p>That should be all you need to do.  Once you have checked through your sites, and everything looks to be running correctly, you can delete your backup folders.</p>
<p>Hopefuly you&#8217;ve found this tutorial useful.  Let me know if you run into any issues when running through this tutorial.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.martiangraphix.com/2010/03/updating-drupal-multisite-on-os-x/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>A few thoughts on Apple&#8217;s iPad announcement</title>
		<link>http://blogs.martiangraphix.com/2010/01/apples-ipad-announcement/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=apples-ipad-announcement</link>
		<comments>http://blogs.martiangraphix.com/2010/01/apples-ipad-announcement/#comments</comments>
		<pubDate>Thu, 28 Jan 2010 00:44:58 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Amazon]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[Barnes & Noble]]></category>
		<category><![CDATA[eBook]]></category>
		<category><![CDATA[iPad]]></category>
		<category><![CDATA[Kindle]]></category>
		<category><![CDATA[Tablet]]></category>

		<guid isPermaLink="false">http://blogs.martiangraphix.com/?p=212</guid>
		<description><![CDATA[Today, like many Tech aficionados, I was eagerly following the posts about Apple&#8217;s new iPad.  And I must say that I&#8217;m quite interested in the device.
First let me say that I was a little taken aback when I looked over at Yahoo&#8217;s Tech Blog, and those guys panned it.  They pointed out all [...]]]></description>
			<content:encoded><![CDATA[<p>Today, like many Tech aficionados, I was eagerly following the posts about Apple&#8217;s new <a href="http://www.apple.com/ipad/">iPad</a>.  And I must say that I&#8217;m quite interested in the device.</p>
<p>First let me say that I was a little taken aback when I looked over at <a href="http://tech.yahoo.com/blogs;_ylt=Ao_hdqKYmkuHI.TYnQAVIKQFLZA5">Yahoo&#8217;s Tech Blog</a>, and those guys panned it.  They pointed out all the things that the rumor mill said it would do that it didn&#8217;t.  Sorry dudes, there is only so much tech you can cram into a device this size without blowing a massive whole in your unit cost.  </p>
<p><span id="more-212"></span>Would a <a href="http://www.adobe.com/products/flashplayer/">Flash plug-in</a> be nice to have?  How about a camera?  Multiple processes running?  Sure, all of these would be nice, but they aren&#8217;t really make or break, are they?  Besides, the software stuff can be added later on, if necessary.  No one else is producing anything like this.  Although I&#8217;m sure they&#8217;ll be trying to copy it soon.</p>
<p><a href="http://tech.yahoo.com/blogs/patterson/64364;_ylt=Ag4AaJq3LM2b8jOdFPgP2XYWLpA5">Ben Patterson</a> seemed to be missing the point the most.  This is NOT an oversized iPhone, without the phone.  But if you start thinking of this as an eBook reader, or as a media pad, it&#8217;s easy to see why this device is so interesting.</p>
<p>You might say that this is an oversized iPod Touch. I personally have never understood the point of the Touch, when you could just get the iPhone, but apparently millions of people disagree with me. </p>
<p>But the iPad, I GET!!!</p>
<p><a href="http://blogs.martiangraphix.com/2010/01/tablet-mania-at-ces/">As I talked about a couple of weeks ago</a>, I&#8217;m really quite interested in getting an eBook reader. Apple&#8217;s new iPad just buried that market.  Why on earth would anyone be interested in a <a href="http://ces.cnet.com/8301-31045_1-10428337-269.html?tag=mncol;title">Que</a> or a <a href="http://www.amazon.com/gp/product/B0015TG12Q/ref=sa_menu_kdxi3?pf_rd_p=328655101&#038;pf_rd_s=left-nav-1&#038;pf_rd_t=101&#038;pf_rd_i=507846&#038;pf_rd_m=ATVPDKIKX0DER&#038;pf_rd_r=1XP1HPPBFMNDB18XYVBP">Kindle DX</a>, when they could get this device for the same price, with so much more capability?  Sure it may not look great on the beach in the sun, but it plays videos and games, does email, and has a real web browser.  </p>
<p>I completely don&#8217;t get people who try to read books on the little screen that is on the Touch or the iPhone.  I never understood it on my old Compaq iPaq, and I certainly don&#8217;t understand it now.   Nor do I really want to have to peer past a keyboard when I&#8217;m trying to read a book, so Netbooks are out.  But give me this nice 9.7&#8243; screen, and I&#8217;ll be buying most of my books either through iTunes or through <a href="http://www.barnesandnoble.com/ebooks/index.asp">Barnes &#038; Noble&#8217;s eBookstore</a>.  With any luck we&#8217;ll be able to buy an eBook through the BN eBookstore and drag it onto our iTunes library, since they both use the <a href="http://en.wikipedia.org/wiki/EPUB">ePub format</a>.  If not, Barnes &#038; Noble&#8217;s eReader app will certainly be on the iPad. </p>
<p>Also this device seems like a total win for college students.  You&#8217;ll be able to take all your books to class on one device, plus jam out a few notes if you like. </p>
<p>My second major use case for this device is when you&#8217;re in your living room watching TV. There are many times, when I&#8217;m watching <a href="http://www.history.com/">The History Channel</a> or <a href="http://dsc.discovery.com/">The Discovery Channel</a>, in which I want to go look up something on the web.  Right now I do that on my iPhone, but I can&#8217;t say that&#8217;s an optimal experience.  With the iPad, this would be a lot more convenient.  Same thing goes if I want to play one of my games.  Whipping out my phone works, but this will be a much better experience on the iPad. </p>
<p>Now a few words about what the iPad is not. It&#8217;s not a full-blown computer. I will not create websites or write up blog posts on this thing.  Nor would I want to compose long emails on it, any more than I&#8217;d do that on my iPhone.  Those things are what a laptop is for. </p>
<p>But if you take the iPad for what it is, it&#8217;s a damn interesting device, and pretty reasonably priced.  I think Apple will sell quite a few of these.  </p>
<p>Will I be one of them this year?  No.  I tend to prefer to wait until hardware version 2, before I jump into this.  Better to let them work out some of the kinks.  But still&#8230;.I&#8217;m very interested in heading down to the Apple store and playing with one of these in the coming months.</p>
<p>Just my two cents.</p>
<p>[Update] For a list of things missing, but with a good analysis of why they&#8217;re not there, check out <a href="http://www.wired.com/gadgetlab/2010/01/ten-things-missing-from-the-ipad/">Charlie Sorrel&#8217;s post over at Wired.com</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.martiangraphix.com/2010/01/apples-ipad-announcement/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Tablet Mania at CES</title>
		<link>http://blogs.martiangraphix.com/2010/01/tablet-mania-at-ces/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=tablet-mania-at-ces</link>
		<comments>http://blogs.martiangraphix.com/2010/01/tablet-mania-at-ces/#comments</comments>
		<pubDate>Fri, 08 Jan 2010 16:13:40 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Amazon]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[Barnes & Noble]]></category>
		<category><![CDATA[Dell]]></category>
		<category><![CDATA[eBook]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Kindle]]></category>
		<category><![CDATA[Nook]]></category>
		<category><![CDATA[Plastic Logic]]></category>
		<category><![CDATA[Que]]></category>
		<category><![CDATA[Skiff]]></category>
		<category><![CDATA[Tablet]]></category>

		<guid isPermaLink="false">http://blogs.martiangraphix.com/?p=194</guid>
		<description><![CDATA[Today I&#8217;m going to talk briefly about technology.  All this business about tablets, netbooks and e-readers is really generating lots of hype in the press.  Personally I&#8217;d love to have an e-reader or tablet, so I can stop filling up my bookshelf.  I&#8217;ve been preparing myself for a black and white screen, until the technology [...]]]></description>
			<content:encoded><![CDATA[<p>Today I&#8217;m going to talk briefly about technology.  All this business about tablets, netbooks and e-readers is really generating lots of hype in the press.  Personally I&#8217;d love to have an e-reader or tablet, so I can stop filling up my bookshelf.  I&#8217;ve been preparing myself for a black and white screen, until the technology improves.  But then I saw <a href="http://www.mirasoldisplays.com/index-mirasol-display-technology.php">Qualcomm&#8217;s Mirasol color screen</a>, so now I&#8217;m hoping for good color offerings in e-readers/tablet soon.</p>
<p><span id="more-194"></span>I was really looking forward to seeing what <a href="http://ces.cnet.com/8301-31045_1-10428337-269.html?tag=mncol;title">Plastic Logic did with their Que</a>.  Unfortunately it looks like they missed the mark&#8230;.at least for me.</p>
<p>They seem to have fallen into the classic mistake made by hardware manufacturers&#8230;..getting caught up in the device specs, then convincing themselves that some screwy use case is what consumers want.  I&#8217;m trying to figure out what the point of having AT&amp;T 3G connectivity is, if you can&#8217;t upload documents that way, and there is no web browser.  E-mail? ZZZZZZZzzzzzzzzzzzzzzz.</p>
<p>Am I still interested in the Que as an e-reader?  Maybe.  At those prices?  Definitely not!  If it had at least the same capability, preferably more capability, than the <a href="http://www.amazon.com/Kindle-Wireless-Reading-Display-Generation/dp/B0015TG12Q/ref=amb_link_17949962_3?pf_rd_m=ATVPDKIKX0DER&amp;pf_rd_s=center-1&amp;pf_rd_r=05CGTJ763RGBY3S61VDT&amp;pf_rd_t=101&amp;pf_rd_p=51296782&amp;pf_rd_i=507846">Kindle DX</a>, and was similarly priced, then I&#8217;d probably be all over it.  For that price, it&#8217;d need to have a LOT MORE capability, not LESS. </p>
<p>Why not just get a Kindle DX?  I don&#8217;t want to be locked into their weird format. The <a href="http://www.barnesandnoble.com/nook/index.asp">Nook</a> is quite interesting, but a bit too small for the type of books I mostly buy. I need something that is good for Textbook size reading, with graphics, charts, figures, etc. That&#8217;s why I had such hope for the Que.  </p>
<p>Is the <a href="http://www.skiff.com/skiff-reader.html">Skiff</a> the right product?  The device looks interesting. Unfortunately, there are still too many things up in the air at this point, like pricing, store access and format considerations.  As for the Service/Store, I can&#8217;t find a lot of detail about it yet, but the website says their service is &#8220;Publisher-friendly&#8221;.  If we use the music or video industry as a guide, that means it will be a bad deal for consumers.  I&#8217;d also feel a little more comfortable about the store offered by Barnes &amp; Noble or Borders than some company I&#8217;ve never heard of.  But I&#8217;ll wait for further details.</p>
<p>It seems to me that there are a ton of companies pursuing this, and your dollar.  Dell, HP and many others are hyping their offerings. So far, no one has hit a home run in my book.  Most of them are completely blowing it, due to some poor choices like Plastic Logic&#8217;s or <a href="http://ces.cnet.com/8301-31045_1-10428571-269.html">Dell&#8217;s ridiculously small screen</a>.</p>
<p>Later this month, we&#8217;ll presumably see what Apple has to offer.  So far they&#8217;re the only company who&#8217;s really figured out a nice UI with their iPhone interface.  I don&#8217;t think this interface is completely appropriate for a tablet, so I hope they throw something even more impressive at us later this month.  Will I rush right out and be an early adopter? One word&#8230;..No!  I think we&#8217;ll need to wait at least one generation for them to get some of the kinks worked out.</p>
<p>So here I am, waiting for a really interesting device to replace my bookshelf.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.martiangraphix.com/2010/01/tablet-mania-at-ces/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Drupal used for new WhiteHouse.gov website</title>
		<link>http://blogs.martiangraphix.com/2009/10/drupal-used-for-new-whitehouse-gov-website/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=drupal-used-for-new-whitehouse-gov-website</link>
		<comments>http://blogs.martiangraphix.com/2009/10/drupal-used-for-new-whitehouse-gov-website/#comments</comments>
		<pubDate>Mon, 26 Oct 2009 16:20:22 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Drupal]]></category>

		<guid isPermaLink="false">http://blogs.martiangraphix.com/?p=178</guid>
		<description><![CDATA[Hey, just saw this posting at MSNBC.  It seems that the website for the White House is moving to Drupal.  At the end of the article, it makes reference to the background technology being Drupal.
AWESOME!
]]></description>
			<content:encoded><![CDATA[<p>Hey, just saw <a href="http://www.msnbc.msn.com/id/33463174/ns/technology_and_science-internet/">this posting</a> at MSNBC.  It seems that the website for the <a href="http://www.whitehouse.gov/">White House</a> is moving to <a href="http://drupal.org/">Drupal</a>.  At the end of the article, it makes reference to the background technology being Drupal.</p>
<p>AWESOME!</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.martiangraphix.com/2009/10/drupal-used-for-new-whitehouse-gov-website/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Automating Drupal cron with OS X&#8217;s launchd</title>
		<link>http://blogs.martiangraphix.com/2009/10/automating-drupal-cron-with-os-xs-launchd/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=automating-drupal-cron-with-os-xs-launchd</link>
		<comments>http://blogs.martiangraphix.com/2009/10/automating-drupal-cron-with-os-xs-launchd/#comments</comments>
		<pubDate>Mon, 26 Oct 2009 02:04:47 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Drupal]]></category>
		<category><![CDATA[cron]]></category>
		<category><![CDATA[launchd]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[Multi-Site]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[Planet Drupal]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://blogs.martiangraphix.com/?p=147</guid>
		<description><![CDATA[Found this great post on Configuring cron on Mac OS X Server 10.5.x in the Drupal documentation.  I&#8217;d been wanting to do that with my original post on Building a Drupal Multi-Site development environment, but I hadn&#8217;t had time to figure it out.
The title of the page at Drupal says &#8220;Mac OS X Server&#8220;, [...]]]></description>
			<content:encoded><![CDATA[<p>Found this great post on <a href="http://drupal.org/node/562904">Configuring cron on Mac OS X Server 10.5.x</a> in the Drupal documentation.  I&#8217;d been wanting to do that with my original post on <a href="http://blogs.martiangraphix.com/2009/09/building-a-drupal-development-environment-for-mac/">Building a Drupal Multi-Site development environment</a>, but I hadn&#8217;t had time to figure it out.</p>
<p>The title of the page at Drupal says &#8220;<strong>Mac OS X Server</strong>&#8220;, but there&#8217;s nothing that says you can&#8217;t use this technique on <strong>OS X Client</strong>, and I believe it will work on everything 10.4.x and up.</p>
<p>So I&#8217;m going to show you how to tie it into the Multi-Site setup I created on my local machine for the previous blog post.  <span id="more-147"></span>If you haven&#8217;t read that post, you might want to do so, because some of what we&#8217;re going to do here is specific to that installation.</p>
<p>Again, we&#8217;ll be using the <strong>Terminal</strong> a lot for this to make sure that everyone can play, with no special software necessary.</p>
<h3>Step 1: Remove the crontab Installation</h3>
<p>The first thing I&#8217;m going to do is remove the information that I put into the crontab previously.  Obviously, if you did not follow the procedure for creating a crontab file described in <strong>Step 10</strong> for building a Drupal Multi-Site development environment, then this step is not necessary.</p>
<p>The user crontab files are located in <em>/var/cron/tabs/</em>.  The first thing you need to do is make sure that the cronall statement that we put in earlier is the only thing in the file.  In your <strong>Terminal</strong> application do the following:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>cron<span style="color: #000000; font-weight: bold;">/</span>tabs<span style="color: #000000; font-weight: bold;">/</span>www</pre></div></div>

<p>If the only thing you see is the statement to execute http://drupal6.local/cronall.php, then it is safe to just delete this file.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>cron<span style="color: #000000; font-weight: bold;">/</span>tabs<span style="color: #000000; font-weight: bold;">/</span>www</pre></div></div>

<p>We&#8217;ll need to stop and start the cron process in order for our changes to take effect.  You can either restart your computer, or a better way is to just use Activity Monitor to quit the cron process.</p>
<ul>
<li>Open <strong>Finder</strong> and navigate into your <strong>Applications &gt; Utilities</strong> folder</li>
<li>Launch the <strong>Activity Monitor</strong></li>
<li>Select <strong>Administrator Processes</strong> in the pulldown at the top</li>
<li>In the <strong>Filter</strong> box at the top, type &#8220;<strong>cron</strong>&#8220;</li>
<li>Highlight the process and select <strong>Quit Process</strong> at the top</li>
<li>You should see the process go away, and come right back again with a new <strong>Process ID</strong></li>
</ul>
<p>If you saw additional commands in the file when you executed the cat command, then it&#8217;s probably best just to edit the crontab file and remove the lines related to Drupal.  If you need to do that then do the following:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">EDITOR</span>=<span style="color: #c20cb9; font-weight: bold;">nano</span>
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> crontab <span style="color: #660033;">-u</span> www <span style="color: #660033;">-e</span></pre></div></div>

<p>Remove the line containing <strong>http://drupal6.local/cronall.php</strong>.</p>
<h3>Step 2: Create a plist file</h3>
<p>Again, we&#8217;re basically following the recommendations found in <a href="http://drupal.org/node/562904">Configuring cron on Mac OS X Server 10.5.x</a>, so if you want to tweek this installation, please read that article.  Now we need to create a launchd daemon .plist file.  We&#8217;ll call this file <em>drupal6.local-cronall.plist</em>, and place it in <em>/Library/LaunchDaemons/</em>.  Open your <strong>Terminal</strong> application and do the following:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>LaunchDaemons
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">nano</span> drupal6.local-cronall.plist</pre></div></div>

<p>Enter the following into the file:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span> 
<span style="color: #00bbdd;">&lt;!DOCTYPE plist PUBLIC &quot;-//Apple//DTD PLIST 1.0//EN&quot;</span>
<span style="color: #00bbdd;">         &quot;http://www.apple.com/DTDs/PropertyList-1.0.dtd&quot;&gt;</span> 
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;plist</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span> 
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;dict<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> 
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Label<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> 
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>drupal6.local-cronall<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> 
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>UserName<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> 
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>nobody<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> 
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>GroupName<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> 
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>www<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> 
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>ProgramArguments<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> 
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;array<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> 
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>/usr/bin/curl<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>-s<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> 
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>http://drupal6.local/cronall.php<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/string<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> 
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/array<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> 
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>RunAtLoad<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;true</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span> 
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>StartInterval<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> 
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;integer<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>3600<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/integer<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> 
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/dict<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/plist<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>Save the file.</p>
<p><strong><em>Important!!!</em></strong> Note that we changed the <strong>GroupName</strong> from _www as described in the documentation to simply <strong>www</strong>.  Not sure if this is a variation between the OS X Server and the Client version, or it could be a difference between 10.4 and 10.5+.  In any case, for me on 10.4.x Client, it wouldn&#8217;t work until I got this value correct.</p>
<p>As you can see, we&#8217;ve used the <strong>StartInterval</strong> approach described in the article.  I think this approach is more appropriate for our development environment, because it won&#8217;t care if you laptop or desktop is asleep at a specific time.</p>
<h3>Step 3: Start the process</h3>
<p>Ok, so now let&#8217;s load the agent into <strong>launchd</strong>.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> launchtl load <span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>LaunchDaemons<span style="color: #000000; font-weight: bold;">/</span>drupal6.local-cronall.plist</pre></div></div>

<p>When I ran this, I got an error about &#8220;<strong>Workaround Bonjour: &#8230;.</strong>&#8220;, but the script seems to be executing ok, so I think you can ignore it.</p>
<p>Now let&#8217;s do a little testing.</p>
<h3>Step 4: Testing</h3>
<p>There are a couple of ways to test out what we&#8217;ve just done.  The main thing is to open the Drupal status report (<a href="http://drupal6.local/admin/reports/status">http://drupal6.local/admin/reports/status</a>), and check how long it&#8217;s been since your cronall process ran.  If you want to alter the interval while testing, change StartInterval.  I used <strong>120</strong> to make the process run every 2 minutes.  To get your changes to take effect, do the following:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> launchtl unload <span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>LaunchDaemons<span style="color: #000000; font-weight: bold;">/</span>drupal6.local-cronall.plist</pre></div></div>

<p>This is important, you don&#8217;t want to alter things in the .plist file until you unload it, or you&#8217;ll lose access to the service.  Now change the value of <strong>StartInterval</strong>:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">nano</span> <span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>LaunchDaemons<span style="color: #000000; font-weight: bold;">/</span>drupal6.local-cronall.plist</pre></div></div>

<p>And then restart the service:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> launchtl load <span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>LaunchDaemons<span style="color: #000000; font-weight: bold;">/</span>drupal6.local-cronall.plist</pre></div></div>

<p>Just make sure that you reset the <strong>StartInterval</strong> to something like <strong>3600</strong> (1 hr), so that your computer isn&#8217;t constantly banging on your network connection.</p>
<p>That&#8217;s it for this article.  I hope you&#8217;ve found it useful.  If you got into this article from <strong>Step 10</strong> of <a href="http://blogs.martiangraphix.com/2009/09/building-a-drupal-development-environment-for-mac/">Building a Drupal development environment for Mac</a>, then continue back to that article at <strong>Step 11</strong>.  </p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.martiangraphix.com/2009/10/automating-drupal-cron-with-os-xs-launchd/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Building a Drupal development environment for Mac</title>
		<link>http://blogs.martiangraphix.com/2009/09/building-a-drupal-development-environment-for-mac/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=building-a-drupal-development-environment-for-mac</link>
		<comments>http://blogs.martiangraphix.com/2009/09/building-a-drupal-development-environment-for-mac/#comments</comments>
		<pubDate>Tue, 01 Sep 2009 19:00:07 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Drupal]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[Multi-Site]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[Planet Drupal]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Virtual Host]]></category>

		<guid isPermaLink="false">http://blogs.martiangraphix.com/?p=12</guid>
		<description><![CDATA[I&#8217;ve been working on understanding the Drupal CMS for the past couple of weeks, and it can be a little bit confusing.  As usual with an open source project most of the documentation focuses on Unix/Linux or Windows.  There is some good information for Mac users, but for me, it seemed a little disjointed and [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been working on understanding the <a href="http://drupal.org" target="_blank">Drupal CMS</a> for the past couple of weeks, and it can be a little bit confusing.  As usual with an open source project most of the documentation focuses on Unix/Linux or Windows.  There is some good information for Mac users, but for me, it seemed a little disjointed and was hard to bring together for a coherent setup.  This is my attempt to explain a <strong><em>complete</em></strong> setup, from start to finish, for doing web development on my local machine running OS X 10.4.  I&#8217;m completely new to Drupal, so if I could have done something better here, please let me know.</p>
<p><span id="more-12"></span>Let me start by saying that all of this information was gathered from the <a title="Drupal Handbooks" href="http://drupal.org/handbooks" target="_blank">Drupal documentation</a>.  I&#8217;ll try to give references to those sources as I go along, and point out where I made slightly different choices than the authors of those sections. Let&#8217;s look at what we&#8217;re trying to accomplish.  I really like the Multi-Site capability of Drupal.  It&#8217;s awesome that you can work with several websites, while only having to install the Drupal code once on your machine.  So:</p>
<ul>
<li>We&#8217;re going to use Drupal&#8217;s Multi-Site capability.</li>
<li>We&#8217;re going to have a separate database for each site that we use.</li>
<li>We&#8217;re going to host Drupal in our local user&#8217;s <em>Sites/</em> folder, instead of in the master web folder.</li>
<li>We&#8217;re going to set up Virtual Hosting on our webserver to help ourselves out.</li>
</ul>
<p><strong>Assumptions:</strong> You have MySQL 5.0+ and PHP 5.2+ already set up on your machine. That should be all you need.  Some of this could definitely be done easier with additional tools, but I&#8217;m trying to make sure that everyone can follow along with this, whether they have tools like PHPMyAdmin or MySQL Workbench installed or not.  So I&#8217;m going to be working a lot on the command line in the Terminal.  Don&#8217;t let this intimidate you, I try to take it step by step. Ok, so let&#8217;s get started.</p>
<h2>Step 1: Setting up the database</h2>
<p>We&#8217;ll start by setting up the database for our first installation of Drupal.  You can find some additional information about installing the database for Drupal <a title="Drupal.org - Create the database" href="http://drupal.org/getting-started/6/install/create-database" target="_blank">here</a>.  We&#8217;ll skip some of the unnecessary details like flushing privileges, because MySQL handles that for us with the GRANT statement. Open a Terminal window, and create a new database.  In this case we&#8217;ll call our database &#8220;drupal_sandbox&#8221;, but you can call it whatever you like.</p>

<div class="wp_syntax"><div class="code"><pre class="mysql" style="font-family:monospace;">$ mysql <span style="color: #CC0099;">-</span>u yourrootaccount <span style="color: #CC0099;">-</span>p
mysql<span style="color: #CC0099;">&gt;</span> <span style="color: #990099; font-weight: bold;">CREATE</span> <span style="color: #990099; font-weight: bold;">SCHEMA</span> drupal_sandbox<span style="color: #000033;">;</span></pre></div></div>

<p>Notice that I put <em>yourrootaccount</em> as the username when launching the mysql client.  This is an account which has privileges to CREATE databases and GRANT privileges.  In most case this user will be <em>root</em>, but when I install MySQL on my systems, I always change the root user to a different username, as a simple security measure.  This follows with the OS X methodology of not enabling the root account for Unix.  In the future I&#8217;ll post an article on my MySQL installation procedures. </p>
<p>Now we&#8217;ll create the application user for the database.  You want to create a separate username for the application, to prevent any hacker who cracks your application from having total access to the database.  In SQL users are created by using the GRANT statement, which has the form <strong>GRANT <em>privileges</em> ON <em>dbname</em>.* TO &#8216;<em>username</em>&#8216;@&#8217;<em>location</em>&#8216; IDENTIFIED BY &#8216;<em>password</em>&#8216;</strong>.  We need to use the same database name we created above, our username will be &#8220;<em>drupal_app</em>&#8220;, and the password will be &#8220;<em>fuzzy</em>&#8220;.</p>

<div class="wp_syntax"><div class="code"><pre class="mysql" style="font-family:monospace;">mysql<span style="color: #CC0099;">&gt;</span> <span style="color: #990099; font-weight: bold;">GRANT</span> <span style="color: #990099; font-weight: bold;">SELECT</span><span style="color: #000033;">,</span> <span style="color: #990099; font-weight: bold;">INSERT</span><span style="color: #000033;">,</span> <span style="color: #990099; font-weight: bold;">UPDATE</span><span style="color: #000033;">,</span> <span style="color: #990099; font-weight: bold;">DELETE</span><span style="color: #000033;">,</span> <span style="color: #990099; font-weight: bold;">CREATE</span><span style="color: #000033;">,</span> <span style="color: #990099; font-weight: bold;">DROP</span><span style="color: #000033;">,</span> <span style="color: #990099; font-weight: bold;">INDEX</span><span style="color: #000033;">,</span> <span style="color: #990099; font-weight: bold;">ALTER</span>
    <span style="color: #CC0099;">-&gt;</span>   <span style="color: #990099; font-weight: bold;">ON</span> drupal_sandbox.<span style="color: #CC0099;">*</span>
    <span style="color: #CC0099;">-&gt;</span>   <span style="color: #990099; font-weight: bold;">TO</span> <span style="color: #008000;">'drupal<span style="color: #008080; font-weight: bold;">_</span>app'</span>@<span style="color: #008000;">'localhost'</span>
    <span style="color: #CC0099;">-&gt;</span>   IDENTIFIED BY <span style="color: #008000;">'fuzzy'</span><span style="color: #000033;">;</span></pre></div></div>

<p>That&#8217;s it.  Drupal will install all the database tables during installation. Exit MySQL by typing the following:</p>

<div class="wp_syntax"><div class="code"><pre class="mysql" style="font-family:monospace;">mysql<span style="color: #CC0099;">&gt;</span> quit<span style="color: #000033;">;</span></pre></div></div>

<h2>Step 2: Add a new host entry to the local machine</h2>
<p>Next, let&#8217;s set up the Apache webserver that comes with OS X 10.4.  For OS X 10.5+ these instructions will be slightly different, since it uses Apache 2.2.  The basics for this virtual host setup can be found in the Drupal documentation <a title="HowTo: Configure your local workstation to serve multiple sites using Drupal's multisite configurations and Apache's VirtualHost" href="http://drupal.org/node/238805" target="_blank">here</a>, which does a good job of describing the Apache 2.2 setup. </p>
<p>We&#8217;re going to add an entry to <em>/etc/hosts</em>, so that a request to DOCUMENT_ROOT will point to our Drupal installation in <em>~/Sites</em>. Drupal would normally expect our installation to be in the <em>/Library/Webserver/Documents</em> folder, but I prefer not to clutter that up with all my development work.  Open a Terminal window, and type the following:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">nano</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>hosts</pre></div></div>

<p>Add the following lines to the end of the file:</p>

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;">##################################
# Virtual Hosts section
##################################
127.0.0.1    drupal6.local</pre></div></div>

<p>Save the file. This is similar to what was done in the documentation, but we&#8217;re changing the hostname to drupal6 to allow for greater flexibility in the future, when we install Drupal 7.x.  In that case, we&#8217;ll probably want a drupal7.local path.</p>
<h2>Step 3: Edit the Apache configuration files</h2>
<p>Begin by editing httpd.conf located in <em>/etc/httpd</em>.  This file will be in <em>/etc/apache2</em> on OS X 10.5+.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>httpd
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">nano</span> httpd.conf</pre></div></div>

<p>Verify that the Rewrite module is enabled.  Make sure the following line is uncommented:</p>

<div class="wp_syntax"><div class="code"><pre class="apache" style="font-family:monospace;"><span style="color: #00007f;">LoadModule</span> rewrite_module        libexec/httpd/mod_rewrite.so</pre></div></div>

<p>Again, this will be somewhat different for Apache 2 which is on OS X 10.5+.  We just want to make sure that we are able to use <em>.htaccess</em> files. Enable the following line by removing the # in front of it:</p>

<div class="wp_syntax"><div class="code"><pre class="apache" style="font-family:monospace;"><span style="color: #00007f;">NameVirtualHost</span> *:<span style="color: #ff0000;">80</span></pre></div></div>

<p>Scroll to the end of the file and verify that the following directive is enabled:</p>

<div class="wp_syntax"><div class="code"><pre class="apache" style="font-family:monospace;"><span style="color: #00007f;">Include</span> /private/etc/httpd/users/*.conf</pre></div></div>

<p>This will enable us to add our virtual host directives in a separate file in the users directory.  On OS X 10.5+ you&#8217;ll be looking for something in the <em>httpd/extra/</em> folder.  Close the <em>httpd.conf</em> file.  We&#8217;re going to add a file called <em>httpd-vhosts.conf</em> to the users directory.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>httpd<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">users</span>
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">touch</span> httpd-vhosts.conf
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">nano</span> httpd-vhosts.conf</pre></div></div>

<p>Add the following lines to this configuration file (obviously changing <em>yourusername</em> to your user name on your local system):</p>

<div class="wp_syntax"><div class="code"><pre class="apache" style="font-family:monospace;"><span style="color: #adadad; font-style: italic;">#</span>
<span style="color: #adadad; font-style: italic;"># Virtual hosts</span>
<span style="color: #adadad; font-style: italic;">#</span>
&nbsp;
&lt;<span style="color: #000000; font-weight:bold;">VirtualHost</span> *:<span style="color: #ff0000;">80</span>&gt;
    <span style="color: #00007f;">DocumentRoot</span> <span style="color: #7f007f;">&quot;/Library/WebServer/Documents&quot;</span>
    <span style="color: #00007f;">ErrorLog</span> <span style="color: #7f007f;">&quot;/private/var/log/httpd/error_log&quot;</span>
    <span style="color: #00007f;">CustomLog</span> <span style="color: #7f007f;">&quot;/private/var/log/httpd/access_log&quot;</span> common
&lt;/<span style="color: #000000; font-weight:bold;">VirtualHost</span>&gt;
&nbsp;
&lt;<span style="color: #000000; font-weight:bold;">VirtualHost</span> *:<span style="color: #ff0000;">80</span>&gt;
    <span style="color: #00007f;">ServerAdmin</span> webmaster@drupal6.local
    <span style="color: #00007f;">DocumentRoot</span> <span style="color: #7f007f;">&quot;/Users/yourusername/Sites/drupal/6&quot;</span>
    <span style="color: #00007f;">ServerName</span> drupal6.local
    <span style="color: #00007f;">ServerAlias</span> *.drupal6.local
    <span style="color: #00007f;">ErrorLog</span> <span style="color: #7f007f;">&quot;/private/var/log/httpd/drupal6.local-error_log&quot;</span>
    <span style="color: #00007f;">CustomLog</span> <span style="color: #7f007f;">&quot;/private/var/log/httpd/drupal6.local-access_log&quot;</span> common
    &lt;<span style="color: #000000; font-weight:bold;">Directory</span> <span style="color: #7f007f;">&quot;/Users/yourusername/Sites/drupal/6/&quot;</span>&gt;
        <span style="color: #00007f;">Options</span> <span style="color: #0000ff;">Indexes</span> <span style="color: #0000ff;">FollowSymLinks</span>
        <span style="color: #00007f;">AllowOverride</span> <span style="color: #00007f;">All</span>
        <span style="color: #00007f;">Order</span> <span style="color: #00007f;">allow</span>,<span style="color: #00007f;">deny</span>
        <span style="color: #00007f;">Allow</span> <span style="color: #00007f;">from</span> <span style="color: #00007f;">all</span>
    &lt;/<span style="color: #000000; font-weight:bold;">Directory</span>&gt;
&lt;/<span style="color: #000000; font-weight:bold;">VirtualHost</span>&gt;</pre></div></div>

<p>As stated in the article listed above, the first section needs to match what is in your httpd.conf file.  The second section sets up our Drupal virtual host.  In addition to what was described in that article, we&#8217;ve added the &lt;Directory&gt; section.  This change is important because we want to make sure that SymLinks are followed, and we need the AllowOverride directive to make sure that our .htaccess file is read. Open your System Preferences, select Sharing, stop and restart Personal Web Sharing.  Ok, so now we&#8217;re ready to move on.</p>
<h2>Step 4: Create the directory for your local copy of Drupal</h2>
<p>Navigate to your local <em>Sites/</em> directory and create a folder for Drupal.  You can do this through Finder or on the command line:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #7a0874; font-weight: bold;">cd</span> ~<span style="color: #000000; font-weight: bold;">/</span>Sites
$ <span style="color: #c20cb9; font-weight: bold;">mkdir</span> drupal
$ <span style="color: #c20cb9; font-weight: bold;">mkdir</span> drupal<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">6</span></pre></div></div>

<p>Our installation of the Drupal files will go inside the <em>6/</em> sub-folder. When Drupal 7.x is released, we&#8217;ll add a <em>drupal/7/</em> folder for the installation of it.</p>
<h2>Step 5: Test our installation so far</h2>
<p>Navigate to your Sites and open up the <em>drupal/6/</em> folder with Finder.  Create a new file, and name it index.php.  Open this file with the text editor of your choice, and insert the following code:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
    <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;h1&gt;You are in the Drupal 6 folder&lt;/h1&gt;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>Save the file and in your web browser enter <a href="http://drupal6.local/">http://drupal6.local/</a> and hit return.  If you see a page with &#8220;<strong>You are in the Drupal 6 folder</strong>&#8220;, then your virtual host configuration is working correctly.</p>
<h2>Step 6: Install the Drupal files</h2>
<p>We&#8217;ll be using Finder for the first part of this step, but keep the Terminal handy for the second part.</p>
<ul>
<li>Open your <em>Sites/</em> folder</li>
<li>Open the drupal/ folder and move the <em>6/</em> folder we created in Step 4 to the Trash</li>
<li>Download the latest copy of <a title="Drupal.org" href="http://drupal.org" target="_blank">Drupal</a> (6.13 at the time of this writing)</li>
<li>Find the file you downloaded, and move it into your <em>Sites/</em> folder</li>
<li>Double click the compressed file you downloaded to extract the contents</li>
<li>You should now have a folder like <em>drupal-6.13/</em> in your <em>Sites/</em> folder</li>
<li>Drag <em>drupal-6.13/</em> onto your <em>drupal/</em> folder</li>
<li>Open the <em>drupal/</em> folder and rename <em>drupal-6.13/</em> to <em>6/</em></li>
</ul>
<p>Now switch back to the Terminal so we can verify that we have all the files we need.  Type the following:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #7a0874; font-weight: bold;">cd</span> ~<span style="color: #000000; font-weight: bold;">/</span>Sites<span style="color: #000000; font-weight: bold;">/</span>drupal<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">6</span>
$ <span style="color: #c20cb9; font-weight: bold;">ls</span> <span style="color: #660033;">-la</span></pre></div></div>

<p><em>Verify that the list contains the <strong>.htaccess</strong> file.</em>  This file is important to have.</p>
<h2>Step 7: Setting up the <em>sites/</em> directory and configuration script</h2>
<p>Now we&#8217;re ready to set up our configuration script.  All we&#8217;d really need to do now, would be to copy the configuration script in the <em>sites/default/</em> directory in our drupal installation, but we&#8217;re going to change things up a bit to help ourselves out with setting up the MultiSite cron jobs later on. In the Terminal, navigate to our installation folder and then into the <em>sites/</em> sub-folder as follows:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #7a0874; font-weight: bold;">cd</span> ~<span style="color: #000000; font-weight: bold;">/</span>Sites<span style="color: #000000; font-weight: bold;">/</span>drupal<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">6</span><span style="color: #000000; font-weight: bold;">/</span>sites
$ <span style="color: #c20cb9; font-weight: bold;">mkdir</span> drupal6.local</pre></div></div>

<p>While we&#8217;re at it, let&#8217;s go ahead and make the directories for site specific themes and modules.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">mkdir</span> all<span style="color: #000000; font-weight: bold;">/</span>modules
$ <span style="color: #c20cb9; font-weight: bold;">mkdir</span> all<span style="color: #000000; font-weight: bold;">/</span>themes
$ <span style="color: #c20cb9; font-weight: bold;">mkdir</span> drupal6.local<span style="color: #000000; font-weight: bold;">/</span>modules
$ <span style="color: #c20cb9; font-weight: bold;">mkdir</span> drupal6.local<span style="color: #000000; font-weight: bold;">/</span>themes</pre></div></div>

<p>We need to copy the default.settings.php file, in the <em>sites/default/</em> directory, into the <em>drupal6.local/</em> directory we just created.  We also need to rename the copy <em>settings.php</em>.  We can take care of both of those items with the following command.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">cp</span> default<span style="color: #000000; font-weight: bold;">/</span>default.settings.php drupal6.local<span style="color: #000000; font-weight: bold;">/</span>settings.php</pre></div></div>

<p>The Drupal documentation tells you that you need to set permissions for the settings file.  We won&#8217;t be doing that explicitly, because our next step will take care of it.</p>
<h2>Step 8: Giving ownership to the webserver</h2>
<p>The web server will need access to the files in these directories, so we&#8217;re going modify the access privileges for the <em>~/Sites/drupal/6/</em> directory.  We&#8217;re also going to change the group of this directory to www, which is the web server.  You can do this through the Finder by selecting the <em>6/</em> folder and pressing Command-I, and editing the Ownership &amp; Permissions info, but it&#8217;s simple to do from the command line.  So type in the following:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #7a0874; font-weight: bold;">cd</span> ~<span style="color: #000000; font-weight: bold;">/</span>Sites<span style="color: #000000; font-weight: bold;">/</span>drupal<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">6</span><span style="color: #000000; font-weight: bold;">/</span>sites
$ <span style="color: #c20cb9; font-weight: bold;">chmod</span> g+<span style="color: #c20cb9; font-weight: bold;">w</span> drupal6.local
$ <span style="color: #c20cb9; font-weight: bold;">chmod</span> g+<span style="color: #c20cb9; font-weight: bold;">w</span> drupal6.local<span style="color: #000000; font-weight: bold;">/</span>settings.php
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">chgrp</span> <span style="color: #660033;">-R</span> www <span style="color: #000000; font-weight: bold;">*</span></pre></div></div>

<h2>Step 9: Installing Drupal</h2>
<p>We&#8217;re finally ready to set up our installation of Drupal.  Open your web browser of choice, and enter the following in the address bar:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;">http://drupal6.local/</pre></div></div>

<p>This should start the installation process.  If you don&#8217;t see the Drupal logo and &#8220;Choose a Language&#8221; on the webpage, go back and check your settings.</p>
<ul>
<li>Select Install Drupal in English</li>
<li>Leave the Database type at mysqli</li>
<li>Enter the database information you used in Step 1 above</li>
<li>Leave the Advanced database options alone unless you need to use them</li>
<li>Hit save and continue, and the site will install</li>
</ul>
<p>The final process of the setup  asks you to Configure the site.  You&#8217;ll enter a Site name, username for your administrator, and some email addresses for automated notifications.</p>
<ul>
<li>Site name: Drupal Sandbox</li>
<li>Site e-mail address: youremail@yourdomain.com</li>
<li>Administrator Username: whatever you like (admin)</li>
<li>Admin email address: youremail@yourdomain.com</li>
<li>Password: yourpassword</li>
<li>Set your timezone</li>
<li>Enable Clean URLs if possible</li>
<li>Check for updates</li>
</ul>
<p>Now change the permissions of the drupal6.local/ folder and the settings.php file back to not writable</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #7a0874; font-weight: bold;">cd</span> ~<span style="color: #000000; font-weight: bold;">/</span>Sites<span style="color: #000000; font-weight: bold;">/</span>drupal<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">6</span><span style="color: #000000; font-weight: bold;">/</span>sites
$ <span style="color: #c20cb9; font-weight: bold;">chmod</span> g-w drupal6.local
$ <span style="color: #c20cb9; font-weight: bold;">chmod</span> a-w drupal6.local<span style="color: #000000; font-weight: bold;">/</span>settings.php</pre></div></div>

<p>That should be it.  Click on &#8220;your new site&#8221; to see that the webpage is functioning properly.  If you look under &#8220;Administer&#8221; you should see a warning that &#8220;Cron has not run&#8221;. We&#8217;ll take care of that next.</p>
<h2>Step 10: Configuring cron</h2>
<p>Running a cron process is extremely important for Drupal.  There are multiple functions for which Drupal uses the cron process, including: indexing content, pruning logs, checking for updates, and others.  The simple way to get this to work would be to just update the systems crontab to update the site, as described in <a title="Drupal - Configuring cron jobs" href="http://drupal.org/cron" target="_blank">Configuring cron jobs</a>.  However, since we&#8217;re installing a multi-site system, and we don&#8217;t want to have to remember to update the crontab each time we add a site, we&#8217;re going to use a script to automate this process.  </p>
<p>Again, the <a title="Multisite cron" href="http://drupal.org/node/237503" target="_blank">Drupal documentation</a> has many examples of scripts, using bash, php, python and more.  I encourage you to take a look at them. I made my own here, because I either didn&#8217;t understand what the ones on the Drupal site were trying to do, or they didn&#8217;t seem flexible enough, but most of them looked like they might not cover all the likely possibilities. </p>
<p>There was a pretty good one posted by <a title="Multi-site cron without wget or curl" href="http://drupal.org/node/511960" target="_blank">Carl van Denzen</a>, that had a similar methodology to this script, but it had external dependencies.  So I just dove in and tried to come up with my own solution. (As an option, I&#8217;ve posted a <a href='http://blogs.martiangraphix.com/wp-content/uploads/2009/09/cronall.tar.gz'>copy of the file</a> for you to download, so you don&#8217;t have to type it all in). </p>
<p>Open a new file in your text editor and save it as <em>cronall.php</em> in the <em>drupal/6/</em> folder.  Add the following to this file:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
    <span style="color: #009933; font-style: italic;">/**
    *   This script will call a cron job for each valid Drupal site
    *   in your installation.  Whether you have one site or many in a
    *   Multi-Site configuration.  It will find all folders contained
    *   in the &quot;sites&quot; folder of your code base which contain a
    *   settings.php file.  These are assumed to be valid sites.
    *   This script should be put in the top level of your code base.
    *
    *   Note: It is assumed that you have properly configured your
    *   webserver to map each top level directory in &quot;sites&quot; to an
    *   equivalent VirtualHost.
    *
    *   This script will take these folders and transfer them to URLs.
    *   For example:
    *
    *       sites/drupal6.local        ==&gt;   http://drupal6.local/cron.php
    *       sites/drupal6.local/site1  ==&gt;   http://drupal6.local/site1/cron.php
    *       sites/bunnies.local        ==&gt;   http://bunnies.local/cron.php
    *
    *   It is a &quot;Best Practice&quot; to use a directory for your master
    *   domain, instead of using the 'default' folder.  However, if
    *   you use the 'default' folder, the value in $masterDomainName
    *   will be inserted to replace 'default' in the URL.
    *
    *       sites/default          ==&gt;   http://drupal6.local/cron.php
    *       sites/default/site1    ==&gt;   http://drupal6.local/site1/cron.php
    *
    *   For any sites not picked up by this script automatically, you can
    *   manually specify the path in the $addedSites array.
    *
    *   Notice:  This script is provided &quot;As Is&quot;.  No warranty is expressed
    *            or implied.  You may freely modify/use it as you like.
    */</span>
&nbsp;
    <span style="color: #000088;">$sitesDir</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;./sites&quot;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$cronURL</span>  <span style="color: #339933;">=</span> <span style="color: #0000ff;">'http://%s/cron.php'</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">//  any additional sites not picked up by this script may</span>
    <span style="color: #666666; font-style: italic;">//  be manually inserted here, just uncomment $addedSites</span>
    <span style="color: #666666; font-style: italic;">//$addedSites = array('insertDomainPathHere');</span>
&nbsp;
    <span style="color: #000088;">$masterDomainName</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'drupal6.local'</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000088;">$sites</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">//  populate the $sites array by calling find_sites()</span>
    find_sites<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$sites</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">//  If $addedSites is not empty and it is an array,</span>
    <span style="color: #666666; font-style: italic;">//  merge it with $sites</span>
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$addedSites</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #990000;">is_array</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$addedSites</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$sites</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array_merge</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$sites</span><span style="color: #339933;">,</span> <span style="color: #000088;">$addedSites</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">//  remove any duplicate entries in $sites</span>
    <span style="color: #666666; font-style: italic;">//  this is in case the 'default' directory</span>
    <span style="color: #666666; font-style: italic;">//  and a $masterDomainName directory both exist</span>
    <span style="color: #000088;">$sites</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array_unique</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$sites</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">//  for each site in $sites, execute a cron command</span>
    <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$sites</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$site</span> <span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        <span style="color: #666666; font-style: italic;">//  Use ONE of the following command lines</span>
        <span style="color: #666666; font-style: italic;">//$cmd = '/usr/bin/lnyx -source ' . sprintf( $cronURL, $site );</span>
        <span style="color: #666666; font-style: italic;">//$cmd = 'wget -O - -q -t 1 ' . sprintf( $cronURL, $site );</span>
        <span style="color: #000088;">$cmd</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'/usr/bin/curl --silent --compressed '</span> <span style="color: #339933;">.</span> <span style="color: #990000;">sprintf</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$cronURL</span><span style="color: #339933;">,</span> <span style="color: #000088;">$site</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Executing command: <span style="color: #006699; font-weight: bold;">$cmd</span>&lt;br/&gt;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
        <span style="color: #990000;">exec</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$cmd</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #009933; font-style: italic;">/**
     *   Recursively find all valid Drupal sites
     *
     *   This method recursively looks in the $sitesDir directory
     *   and will find all folders that include a settings.php
     *   file.  These are assumed to be valid/active sites in
     *   the Drupal installation.  Any folder containing the
     *   settings.php file will be added to the $sites[] array,
     *   which is passed into the function by reference.
     *
     *   If the 'default' folder is used, the value in $masterDomainName
     *   will be substituted into the path in the $sites[] array.
     *
     *   @param  string[]  &amp;$sites  a string array containing all the sites.
     *                              This parameter is passed by reference, so
     *                              changes will persist outsite the function.
     *   @param  string   $dirPath  a string containing the directory path
     *                              to traverse
     *   @return void
     */</span>
    <span style="color: #000000; font-weight: bold;">function</span> find_sites<span style="color: #009900;">&#40;</span> <span style="color: #339933;">&amp;</span><span style="color: #000088;">$sites</span><span style="color: #339933;">,</span> <span style="color: #000088;">$dirPath</span> <span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$sitesDir</span><span style="color: #339933;">;</span>
        <span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$masterDomainName</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$dh</span> <span style="color: #339933;">=</span> <span style="color: #990000;">opendir</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">$sitesDir</span>/<span style="color: #006699; font-weight: bold;">$dirPath</span>&quot;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>
        <span style="color: #009900;">&#123;</span>
            <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$filename</span> <span style="color: #339933;">=</span> <span style="color: #990000;">readdir</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$dh</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">!==</span> <span style="color: #009900; font-weight: bold;">false</span> <span style="color: #009900;">&#41;</span>
            <span style="color: #009900;">&#123;</span>
                <span style="color: #666666; font-style: italic;">//  must account for the empty $dirPath the</span>
                <span style="color: #666666; font-style: italic;">//  first time through the function</span>
                <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$dirPath</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>
                <span style="color: #009900;">&#123;</span>
                    <span style="color: #000088;">$subDirPath</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">$dirPath</span>/<span style="color: #006699; font-weight: bold;">$filename</span>&quot;</span><span style="color: #339933;">;</span>
                <span style="color: #009900;">&#125;</span>
                <span style="color: #b1b100;">else</span>
                <span style="color: #009900;">&#123;</span>  <span style="color: #666666; font-style: italic;">//  This is not the first time through,</span>
                   <span style="color: #666666; font-style: italic;">//  just add the filename</span>
                   <span style="color: #000088;">$subDirPath</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$filename</span><span style="color: #339933;">;</span>
                <span style="color: #009900;">&#125;</span>
&nbsp;
                <span style="color: #666666; font-style: italic;">//  ignore the 'all' directory, the '.' and '..' directories</span>
                <span style="color: #666666; font-style: italic;">//  also ignore regular files</span>
                <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$filename</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">'all'</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$filename</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">'.'</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span>
                     <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$filename</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">'..'</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #990000;">is_dir</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">$sitesDir</span>/<span style="color: #006699; font-weight: bold;">$subDirPath</span>&quot;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>
                <span style="color: #009900;">&#123;</span>
                    <span style="color: #666666; font-style: italic;">//  if the directory contains a settings.php file, it is</span>
                    <span style="color: #666666; font-style: italic;">//  a valid site.  we need to add it to the $sites[] array</span>
                    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #990000;">file_exists</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">$sitesDir</span>/<span style="color: #006699; font-weight: bold;">$subDirPath</span>/settings.php&quot;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>
                    <span style="color: #009900;">&#123;</span>
                        <span style="color: #666666; font-style: italic;">//  if the path contains 'default', replace 'default'</span>
                        <span style="color: #666666; font-style: italic;">//  with $masterDomainName and insert it into $sites[]</span>
                        <span style="color: #666666; font-style: italic;">//  need to keep 'default' in $subDirPath</span>
                        <span style="color: #666666; font-style: italic;">//  so we can navigate the tree</span>
                        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #990000;">strstr</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$subDirPath</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'default'</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>
                        <span style="color: #009900;">&#123;</span>
                            <span style="color: #000088;">$sites</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">substr_replace</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$subDirPath</span><span style="color: #339933;">,</span> 
                                                       <span style="color: #000088;">$masterDomainName</span><span style="color: #339933;">,</span>
                                                       <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #990000;">strlen</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'default'</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                        <span style="color: #009900;">&#125;</span>
                        <span style="color: #b1b100;">else</span>
                        <span style="color: #009900;">&#123;</span>
                            <span style="color: #000088;">$sites</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$subDirPath</span><span style="color: #339933;">;</span>
                        <span style="color: #009900;">&#125;</span>  <span style="color: #666666; font-style: italic;">//end if else</span>
&nbsp;
                        <span style="color: #666666; font-style: italic;">//  enter the next loop of recursion</span>
                        <span style="color: #666666; font-style: italic;">//  pass find_sites the current dir path</span>
                        find_sites<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$sites</span><span style="color: #339933;">,</span> <span style="color: #000088;">$subDirPath</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
                    <span style="color: #009900;">&#125;</span>  <span style="color: #666666; font-style: italic;">// end if</span>
&nbsp;
                <span style="color: #009900;">&#125;</span>  <span style="color: #666666; font-style: italic;">// end if</span>
&nbsp;
            <span style="color: #009900;">&#125;</span>  <span style="color: #666666; font-style: italic;">// end while</span>
&nbsp;
        <span style="color: #009900;">&#125;</span>
        <span style="color: #b1b100;">else</span>
        <span style="color: #009900;">&#123;</span>
            <span style="color: #990000;">die</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">&quot;Unable to find directory <span style="color: #006699; font-weight: bold;">$sitesDir</span>/<span style="color: #006699; font-weight: bold;">$dirPath</span>&quot;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>  <span style="color: #666666; font-style: italic;">// end if else</span>
&nbsp;
        <span style="color: #990000;">closedir</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$dh</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #b1b100;">return</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #009900;">&#125;</span>  <span style="color: #666666; font-style: italic;">// end function find_sites()</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>Save the file.  Now we need to make sure that our cronall script is called automatically by the system.  You have 2 options for making this happen:</p>
<ul>
<li>Set up cron to call cronall once per hour, as described in the rest of this Step</li>
<li>Use OS X&#8217;s launchd to automate the task, as I described in my subsequent post <a href="http://blogs.martiangraphix.com/2009/10/automating-drupal-cron-with-os-xs-launchd/">Automating Drupal cron with OS X’s launchd</a></li>
</ul>
<p>If you&#8217;ve chosen the more Unix like approach, using cron, then we&#8217;re first going to set the default editor to <strong>nano</strong>.  We&#8217;re also going to edit the cron script and run it as the user www, for security reasons.  So, switch back to the Terminal and do the following:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">EDITOR</span>=<span style="color: #c20cb9; font-weight: bold;">nano</span>
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> crontab <span style="color: #660033;">-u</span> www <span style="color: #660033;">-e</span></pre></div></div>

<p>Add the following line to the end this file:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000;">0</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>curl <span style="color: #660033;">--silent</span> <span style="color: #660033;">--compressed</span> http:<span style="color: #000000; font-weight: bold;">//</span>drupal6.local<span style="color: #000000; font-weight: bold;">/</span>cronall.php</pre></div></div>

<p>That first position is what minute of each hour you want the script to run (0-59).  So if you prefer to go at 30 min after the hour, you would subsitute 30 for 0.  You can also do a little bit of testing by changing the first number to */1, or */2.  This will set the cronall script to run every minute or every other minute respectively.  Navigate in your Drupal website to <em>Administer &gt; Reports &gt; Status report</em> and update every couple of minutes to verify that cron is running.  Just remember to set it back to a whole number when you are done.</p>
<h2>Step 11: Decide how to organize additional sites</h2>
<p>Ok, so now we&#8217;re ready to add additional sites to our system.  The first thing to do is decide what structure you want to use.  You have basically three options.  You can:</p>
<ol>
<li>Host the site as a subdirectory to your existing site (eg. <a href="http://drupal6.local/site1/">http://drupal6.local/site1/</a>)</li>
<li>Create a subdomain to the existing site (eg <a href="http://sub1.drupal6.local/">http://sub1.drupal6.local/</a>)</li>
<li>Or you can create an entirely different domain (eg <a href="http://bunnies.local/">http://bunnies.local/</a>)</li>
</ol>
<p>We&#8217;re going to cover the 2nd option.  But if you want to do the 1st option, you basically create a new database with appropriate user privileges, add a folder named &#8217;site1&#8242; in the <em>drupal6.local/</em> folder, copy the <em>default.settings.php</em> to the new directory as before, and point your browser at <a href="http://drupal6.local/site1/">http://drupal6.local/site1/</a> For more details about the 3rd option, you should be able to look at <a title="Setting up multi-site Drupal 5 on Windows or Linux" href="http://drupal.org/node/169034" target="_blank">Setting up multi-site Drupal 5 on Windows or Linux</a>, and figure out how to mash it up with these instructions. </p>
<p>In my case, I&#8217;m going to use the new site to work through the <a title="Lynda.com - Drupal Essentials" href="http://www.lynda.com/home/DisplayCourse.aspx?lpk2=620" target="_blank">Drupal Essentials</a> training by <a title="TomGeller.com" href="http://www.tomgeller.com/" target="_blank">Tom Geller</a> over at <a title="Lynda.com" href="http://www.lynda.com/" target="_blank">Lynda.com</a>, so I&#8217;ll use that when choosing a naming scheme for this additional site.</p>
<h2>Step 12: Adding a database for your Multi-Site</h2>
<p>Now we&#8217;ll add our new database.  We follow the same process as in <strong>Step 1</strong>, except we&#8217;ll just use the same application user from above.  If you want to create a new user, just follow the GRANT procedure from before.  Switch to the Terminal, and enter the following:</p>

<div class="wp_syntax"><div class="code"><pre class="mysql" style="font-family:monospace;">$ mysql <span style="color: #CC0099;">-</span>u yourrootaccount <span style="color: #CC0099;">-</span>p
mysql<span style="color: #CC0099;">&gt;</span> <span style="color: #990099; font-weight: bold;">CREATE</span> <span style="color: #990099; font-weight: bold;">SCHEMA</span> drupal_essentials<span style="color: #000033;">;</span>
mysql<span style="color: #CC0099;">&gt;</span> <span style="color: #990099; font-weight: bold;">GRANT</span> <span style="color: #990099; font-weight: bold;">SELECT</span><span style="color: #000033;">,</span> <span style="color: #990099; font-weight: bold;">INSERT</span><span style="color: #000033;">,</span> <span style="color: #990099; font-weight: bold;">UPDATE</span><span style="color: #000033;">,</span> <span style="color: #990099; font-weight: bold;">DELETE</span><span style="color: #000033;">,</span> <span style="color: #990099; font-weight: bold;">CREATE</span><span style="color: #000033;">,</span> <span style="color: #990099; font-weight: bold;">DROP</span><span style="color: #000033;">,</span> <span style="color: #990099; font-weight: bold;">INDEX</span><span style="color: #000033;">,</span> <span style="color: #990099; font-weight: bold;">ALTER</span>
    <span style="color: #CC0099;">-&gt;</span>   <span style="color: #990099; font-weight: bold;">ON</span> drupal_essentials.<span style="color: #CC0099;">*</span>
    <span style="color: #CC0099;">-&gt;</span>   <span style="color: #990099; font-weight: bold;">TO</span> <span style="color: #008000;">'drupal<span style="color: #008080; font-weight: bold;">_</span>app'</span>@<span style="color: #008000;">'localhost'</span><span style="color: #000033;">;</span>
mysql<span style="color: #CC0099;">&gt;</span> quit<span style="color: #000033;">;</span></pre></div></div>

<h2>Step 13: Update the hosts file</h2>
<p>We&#8217;re going to modify /etc/hosts again so that our machine recognizes a call to <a href="http://essentials.drupal6.local/">http://essentials.drupal6.local/</a> is really just pointing to the local machine.  Go to your Terminal window and type the following:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">nano</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>hosts</pre></div></div>

<p>Add the following entry at the end of the file:</p>

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;">127.0.0.1     essentials.drupal6.local</pre></div></div>

<p>Save the file.  We&#8217;ve already taken care of configuring the Virtual Hosts, so this should be all we need.</p>
<h2>Step 14: Setting up the <em>sites/</em> folder</h2>
<p>Now we need to set up the <em>sites/</em> folder like we did before.  We&#8217;ll breeze through it, but this is almost identical to process covered in <strong>Steps 7-8</strong> above, if you want to look back at any of it.  In your Terminal do the following:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #7a0874; font-weight: bold;">cd</span> ~<span style="color: #000000; font-weight: bold;">/</span>Sites<span style="color: #000000; font-weight: bold;">/</span>drupal<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">6</span><span style="color: #000000; font-weight: bold;">/</span>sites
$ <span style="color: #c20cb9; font-weight: bold;">mkdir</span> essentials.drupal6.local
$ <span style="color: #c20cb9; font-weight: bold;">mkdir</span> essentials.drupal6.local<span style="color: #000000; font-weight: bold;">/</span>modules
$ <span style="color: #c20cb9; font-weight: bold;">mkdir</span> essentials.drupal6.local<span style="color: #000000; font-weight: bold;">/</span>themes
$ <span style="color: #c20cb9; font-weight: bold;">cp</span> default<span style="color: #000000; font-weight: bold;">/</span>default.settings.php essentials.drupal6.local<span style="color: #000000; font-weight: bold;">/</span>settings.php
$ <span style="color: #c20cb9; font-weight: bold;">chmod</span> g+<span style="color: #c20cb9; font-weight: bold;">w</span> essentials.drupal6.local
$ <span style="color: #c20cb9; font-weight: bold;">chmod</span> g+<span style="color: #c20cb9; font-weight: bold;">w</span> essentials.drupal6.local<span style="color: #000000; font-weight: bold;">/</span>settings.php
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">chgrp</span> <span style="color: #660033;">-R</span> www essentials.drupal6.local</pre></div></div>

<h2>Step 15: Installing the new Drupal site</h2>
<p>To install the new site you should open your web browser of choice and type in: <a href="http://essentials.drupal6.local/">http://essentials.drupal6.local/</a> Follow the same procedures as listed in <strong>Step 9</strong>.  Again, when we are done, we should remove the write permissions from the <em>essentials.drupal6.local/</em> folder and the <em>setings.php</em> file.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #7a0874; font-weight: bold;">cd</span> ~<span style="color: #000000; font-weight: bold;">/</span>Sites<span style="color: #000000; font-weight: bold;">/</span>drupal<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">6</span><span style="color: #000000; font-weight: bold;">/</span>sites
$ <span style="color: #c20cb9; font-weight: bold;">chmod</span> g-w essentials.drupal6.local
$ <span style="color: #c20cb9; font-weight: bold;">chmod</span> a-w essentials.drupal6.local<span style="color: #000000; font-weight: bold;">/</span>settings.php</pre></div></div>

<h2>Step 16: Repeat</h2>
<p>Congratulations! You&#8217;re done. Really, that&#8217;s all there is to it.  Turn off your computer! </p>
<p>You can repeat <strong>Steps 11-15</strong> as many times as you like, and set up as many sites as you need to work on.  Each one can have it&#8217;s own unique modules and themes. I hope you&#8217;ve gotten something useful out of this tutorial.  I know it&#8217;s rather long.  There are obviously some simpler ways to do some of this stuff, but I wanted a system that was pretty flexible, robust and easy to expand.  Hopefully I&#8217;ve accomplished that. Enjoy!</p>
<p>[Update] When you get ready to update your Drupal installation, you can check back here for my other tutorial, <a href="http://blogs.martiangraphix.com/2010/03/updating-drupal-multisite-on-os-x/">Updating Drupal Multi-Site on OS X</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.martiangraphix.com/2009/09/building-a-drupal-development-environment-for-mac/feed/</wfw:commentRss>
		<slash:comments>25</slash:comments>
		</item>
		<item>
		<title>Welcome to Martian Thoughts on Design</title>
		<link>http://blogs.martiangraphix.com/2009/03/welcome-to-martian-thoughts-on-design/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=welcome-to-martian-thoughts-on-design</link>
		<comments>http://blogs.martiangraphix.com/2009/03/welcome-to-martian-thoughts-on-design/#comments</comments>
		<pubDate>Fri, 27 Mar 2009 17:47:31 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blogs.martiangraphix.com/?p=3</guid>
		<description><![CDATA[Hi, this is Michael.
Please be patient as we get our blog and running.  We&#8217;ll be posting new information soon, and apply our own touch to the site in the coming weeks/months.
We at Martian Graphix hope to provide some interesting and useful tidbits on design, web development, and technology in general.
]]></description>
			<content:encoded><![CDATA[<p>Hi, this is Michael.</p>
<p>Please be patient as we get our blog and running.  We&#8217;ll be posting new information soon, and apply our own touch to the site in the coming weeks/months.</p>
<p>We at Martian Graphix hope to provide some interesting and useful tidbits on design, web development, and technology in general.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.martiangraphix.com/2009/03/welcome-to-martian-thoughts-on-design/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
