Category Archives: Tutorials

Tips on Install of WordPress on Mac OSX

Prerequisites / WordPress Dependencies

Local Apache web server with PHP & Mysql.

If you don’t already have your local dev environment set up, consider installing MAMP or MAMP Pro. MAMP is a one-click install which will provide you with a clean, isolated stack for local development that has Mysql and PHP pre-configured. Another benefit of MAMP is that it is very popular so there are countless tutorials and examples to follow.

If for some reason you don’t want to use MAMP or you’ve already configured your local enviro somewhat but you still need PHP and/or MySQL, check out this article: Install and Configure WordPress on Mac OS X Snow Leopard Step-By-Step by awilliams of Thermal Exposure. It takes you from zero to WordPress using Leopard’s built-in Apache server, although I do recommend you supplement these instructions with these tips and my other article Install Mysql for Local Dev on Mac OSX 10.6

Download WordPress

Download and extract the latest WordPress package.

Move it somewhere good like in your /Sites/ folder (most usual place but depends on your config, it can go anywhere you desire so long as your local web server is configured to look there).

I moved mine to /users/me/Sites/wordpress and renamed ‘wordpress’ to ‘wptest.loc’ resulting in: /users/me/Sites/wptest.loc. You can rename it whatever you want – probably the name of your project or client’s site is a good idea.

WordPress needs permission to modify files during installation and runs as user “_www” so make sure it can do this.

cd /Users/me/Sites/
sudo chown -R _www wptest.loc
sudo chmod -R g+w wptest.loc

Create a Database

Now we need a database, a database user and a password. Technically you can use any user or add WordPress tables to an existing database but I like to keep things separate so it’s easy to port elsewhere or start over without worrying about wrecking other things. I’m going to create a database called wptest, database user named wptest_user. You can do this using a GUI (phpMyAdmin, etc.) but I guarantee you cannot do that faster than I can type this ;)

bash > mysql -u root -p
mysql > create database wptest;
mysql > GRANT ALL ON wptest.* TO wptest_user@localhost IDENTIFIED BY "secretpassword";
mysql > exit

Configure Site Address

Remember how I renamed the wordpress folder to wptest.loc? This is because I plan on accessing it in the browser via http://wptest.loc instead of or http://localhost.

To do this I use Virtual Hosts in my environment and point the virtual domains to my local IP address in my hosts file. It’s confusing at first but once you do it a time or two it will be second nature. It’s important if you’d like to work on multiple sites on your local environment concurrently and don’t want to rely on weird subdirectories or other work-arounds that wouldn’t easily port to a live web server.

Setting Up Virtual Hosts on MAMP explains how to set this system up. I provide only abbreviated steps below (MAMP not assumed).

Setting up Virtual Hosts (in short)

  • In your httpd.conf file there should lines like this:
    # Virtual Hosts
    Include /path/to/your/httpd-vhosts.conf

  • In your httpd-vhosts.conf file there should be a line like this:
    NameVirtualHost *:80
    Include /path/to/your/httpd-vhosts.conf

Create A Virtual Host

Now, whenever you want to create a new virtual (local only) site:

  • In your httpd-vhosts.conf file add an entry like this:
    <VirtualHost *>
        ServerName wptest.loc
        DocumentRoot "/Users/me/Sites/wptest.loc"
      <Directory "/Users/me/Sites/wptest.loc">
        Order allow,deny
        Allow from all
        DirectoryIndex index.php index.html

  • In your hosts file (mine is /etc/hosts) add another entry for your local IP:    wptest.loc

Install WordPress

Point your browser to http://wptest.loc

If no config file is found you can edit it yourself, wp-config-sample.php as wp-config.php and adding the correct information for the database you created. Try using as the Dataase Host if localhost doesn’t work.

Install Mysql for Local Dev on Mac OSX 10.6

Do not be intimidated, it’s not that hard.

If you don’t mind reading a little documentation, the hardest thing about installing Mysql (IMO) is figuring out what package to install.

If you’ve previously tried and failed (and done who knows what to your local config) or if you don’t have a particular reason not to, why don’t you just get MAMP and skip all this?

USE THIS INFORMATION AT YOUR OWN RISK. Any information found on this website is offered only as informational and includes no warranty, guarantees or support. The author claims no authority on any subject whatsoever.

  1. Go to
    • This will offer latest version (yes, you want the MySQL Community Server, btw) – if you have a good reason, you can access a previous version from here as well.
  2. Choose the DMG Archive for your architecture (32-bit or 64-bit). You’ll have to log in or (more likely if you’re reading this article) register with MySQL. It’s annoying but fast and I’ve never received spam from them.
  3. After jumping through sign in and mirror download hoops you’ll have a DMG file, something like mysql-5.x.x-osx10.6-x86.DMG which will contain an similarly named .pkg file. That’s all you need. But the most important file is the ReadMe.txt – which is actually useful and contains important steps you need to take. Open the ReadMe.txt.
  4. Read the ReadMe.txt file.

Ok, before you get mad at me – a lot of folks don’t provide useful ReadMe files, which is why I think it’s worth calling out in this case. Also, I saw so many tutorials on this, and worse, problems in forums where it was clear they didn’t follow the steps provided. Also, there are docs online that are mostly a repeat of this file – but it’s easy to accidentally read instructions for the wrong product version. So, as we OGs say, RTFM.

Following are notes from my specific install experience. It may be useful for you but you’ll need to verify your own system paths and configuration. Happy databasing!

  • Restarted apache a whole bunch, can’t remember when or exactly when you need to but if something doesn’t work, that might help:
    sudo apachectl -k restart

  • I installed MySQLStartupItem.pkg – while regularly using it this makes sense, and it’s easy to stop auto startup when you’re done working on a project using mysql. Also the commands to start Mysql are much shorter this way and I’m lazy.
    $ sudo /Library/StartupItems/MySQLCOM/MySQLCOM start

  • Update my PATH environment variable:
    //make a back up in case you muck something up
    $ sudo cp /etc/paths /etc/paths_BAK 
    // edit your paths file - see vi reference or using pico, vim, emacs whatever
    $ sudo vi /etc/paths
    // insert /usr/local/mysql/bin and then save/quit
    // test result
    $ echo $PATH
    // do you see /usr/local/mysql/bin in there somewheres? good!
    $ mysql
    // is bash prompt replaced with mysql> ? yay!

  • Create a password for root:
    $ mysqladmin -u root password aw3^s0mePAs5

More good notes (for 5.5, be sure to select correct manual option):

What Next?

  • Login, create a db, do stuff, lern stuff
    $ mysql --help
    $ mysql -u root -p
    mysql> SHOW DATABASES;
    mysql> \h
  • Install a GUI - I like 'em, it's nice for visualization, although I think you definitely learn more & more better if you stick with CLI or at least the query window.
    • Sequel Pro - recently turned onto this. LOVE it. Good review here.
    • MySQL Workbench - the official one. Cause you're a company wo/man!
    • PHP MyAdmin - cause you an OG! And/or you follow or make a lot of tutorials (most apache web hosts provide this).
    • Querious - cause it's worth a few bucks for a nice user experience.
    • Navicat - cause money is no object! (If that's the case, please get me a copy! Love but cannot justify $$ at this time.)

1-Click Install of Open Atrium on Dreamhost

Summary: If it was just one click I probably wouldn’t be writing about it ;) This is really for the ADD peeps and newbs out there, there’s nothing too challenging about this install.

Here’s a quick guide to starting an Open Atrium (Drupal-based “intranet in a box”) site if you happen to be a lucky Dreamhost customer. Dreamhost just added this feature today and it is pretty slick, but there’s still a couple bits of manual configuration.

Here’s what you’ll get:
screenshot of the dashboard of a fresh Open Atrium installation

How to Install Open Atrium on Dreamhost

  1. DH Panel: Go to Domains > Manage > Add New Domain / Subdomain, and create a spot to put your Open Atrium install. For example: You can make your subdomain anything you want.
  2. DH Panel: Goodies > One-Click Installs > OpenAtrium. Select your new subdomain and leave option set to ‘Automatically create database’.
  3. You will receive an automated email from Dreamhost that will include an link to your new site and information about your database that you will need later. Save this info!
  4. Set file permissions. Access your server files (FTP or shell, etc) to your new site. Just as the actually quite helpful error message says:

    # Copy the ./sites/default/default.settings.php file to ./sites/default/settings.php.
    # Change file permissions so that it is writable by the web server. If you are unsure how to grant file permissions, please consult the on-line handbook

    For you newbs, an easy way to do this is to use an FTP client (like Filezilla) to access your new site.

    • Download /sites/default/default.settings.php
    • Rename default.settings.php settings.php
    • Upload settings.php to /sites/default/
    • Right-click settings.php and select file permissions (in Filezilla, will be similar in other FTP clients) and set it to 744 (server/owner can read-write)
  5. Go to your new site, for example:, this is where the prompts begin. Follow them.
  6. Open Atrium installation settings.php file permission errorYou will get an error message (at right) if you skipped the ‘Set file permissions’ step (above). That’s ok, you can just go back and do that now and then click ‘Try again’.
  7. Database settings: Fill in the database settings based on the email mentioned earlier. Make sure to open the ‘Advanced options’ menu group and enter the hostname (also provided in the email).
  8. The rest of the configuration settings should be pretty obvious.

Hope this was useful for someone, I’m curious to see/hear what folks are using their Open Atrium installs for. Obviously not an intranet…unless you made it private…there’s loads of ways to do that (if there’s interest I’ll expand). I’m using mine to organize house projects with my roommate and husband. What are you using Open Atrium for?

P.s. If anyone is looking to get a new Dreamhost account I have a $100 off invitation if you’re ready to commit to two years and there’s plenty of referral codes out there too, so find one before you sign up!

Adding TinyMCE to EE Wiki

Having found several requests in the forums and no tutorials online or in documentation, I’ve documented the steps I took to add the TinyMCE editor to my ExpressionEngine wiki.

I am using the EEDocs wiki theme to provide documentation for my users. Here are very quick and dirty instructions to add TinyMCE to your EE Wiki which basically follows the default instructions provided by the TinyMCE Wiki.

  • Download TinyMCE, extract it.

  • Upload the TinyMCE to your webserver, note the path.

  • Find the default PHP file for the EE wiki theme you are using. Mine was in my siteroot/themes/wiki_themes/eedocs/ folder and is called eedocs.php. The default them would be in the themes folder under wiki_themes/default/default.php. Open this in the editor of your choice. You may want to create a backup copy in case you need to revert later.

  • Add the following code to the <head> area:

    <script type="text/javascript" src=""></script>

    Note you may want to test that path in your browser and make sure it is linking to the tiny_mce.js path as intended.

  • Add the following inline script to the <head> area :

    <script type="text/javascript">
    mode : "textareas"

This will turn all of your textareas into TinyMCE editor fields. There are many other ways to configure this, you could specify exactly which textareas to use TinyMCE, for example. For all your TinyMCE customization options, see the TinyMCE wiki and for help knowing where to put what, check out the ExpressionEngine User Guide section on the Wiki Theme Template.

I can’t say I’ve done extensive testing yet, but the default TinyMCE install has not (so far) interfered with wiki markup at all, which is to say that [[Category:Foo::Bar]] and regular [[wiki links]] seem to be working happily.

ExpressionEngine Wiki with TinyMCE

Update: Installed the MarkItUp editor in a similar fashion, I like it a lot more than TinyMCE out of the box. May be looking at Textile Editor Helper (TEH) and CKEditor as well, so check back for a WYSIWYG / markup editor showdown. In the meantime, consider what you need a WYSIWYG for and what markup under the hood you’re willing to live with in the long-term before settling on a solution for your site – here’s a good article that sums up that issue: WYSI-dangerous: Why WYSIWYG editors are bad for your website on

How to Fix Your ExpressionEngine RSS Template

I began investigating the fascinating minutia of RSS when I couldn't find a reasonable answer in the EE forums to why Google Reader was re-posting every updated post on my site even thought the entry dates hadn't changed. As I went through the prevalent templates floating around the EE community line-by-line I noticed several things that could be improved upon. The only critical fix, in my opinion, is removal of seconds from the dates in the <item /> section. If you want your feed to validate you'll want to add the atom namespace. The rest are optional improvements.

If you want to skip the wheres and whys, I've posted the the updated (fixed) and improved RSS templates on and in their entirety at the end of this article.

Existing RSS templates for ExpressionEngine



I'm not going for a PHD in online syndication, I just wanted my RSS feeds to be error-free, work as expected in major aggregators and to use best-practices which could be determined within a somewhat low threshold of research pain. In addition to referring first to the RSS 2.0 specifications, I used the RSS feeds of some really large websites to serve as examples, making the assumption (I know) that these sites have probably done thorough research on this topic. Often my choices were the result of seeing if these "big players" were all doing the same thing. All the feeds are major sites with the exception of the Flickr blog. The Flickr blog is using I figured with their huge user-base not only would the feeds have been thoroughly vetted, most aggregators will be able to read them due to the sheer volume of WordPress-powered sites out there. Also I chose a feed instead of a self-hosted installation of WP to make sure it was the well-tested standard feed. The feeds I used are:

RSS Feed Breakdown

Feed Format: RSS vs. Atom

As of mid-2005, the two most likely candidates are RSS 2.0 and Atom 1.0. Google reader supports either fully and they suggest choosing one or the other (not both) because most RSS readers support all major formats and offering both can confuse users. The Atom syndication format, whose creation was in part motivated by a desire to get a clean start free of the issues surrounding RSS, has been adopted as IETF Proposed Standard RFC 4287 and is used by Google. However, RSS 2.0 was the first to support enclosures and has captured the podcasting audience and is the recommended format in the iTunes podcasts specs.

I generally do as Google does when it comes to web optimization, and I am a big fan of standards. In some regards I would call Atom "the higher path". That said, I am also a big fan of simplicity and ease-of-use so I'm going with RSS 2.0 because:

  • I already hand-built an RSS 2.0 feed for podcasting (well, for iTunes) so would rather learn one standard / keep all feeds similarly formatted.
  • One less term that could potentially confuse end-users and "web lite" folk who might inherit my work later on.
  • A lot of really big sites that have probably carefully considered this topic went with RSS 2.0, including,,,, and

RSS XML Namespaces

Here's where my first change kicks in. If you aren't actually USING a namespace in your RSS feed there's no need to include it - it's just cruft.


<rss version="2.0"


<rss version="2.0"

Even Better

<rss version="2.0"

The namespaces sy and content aren't used at all and can just be removed. Optional: I chose to remove xmlns:admin="" and the only tag that used it, <admin:generatorAgent rdf:resource="" /> - removing the admin namespace also eliminated rdf, which admin namespace depends on.

I'm not saying any of the removed namespaces are bad, just unnecessary. For example, admin is a very common namespace, but if you leave it in you should update the URI to include the EE version number (dynamically) and add the <admin:errorReportsTo rdf:resource="URI"/> pointing to a valid email address for errors. It may be beneficial to aggregators in reporting statistical reporting of web frameworks and content management systems delivering aggregated RSS feeds.

I rather admire the efficency and simplicity of the namespace declarations used by, and others - so again, this is personal choice.

The third option (even better) adds the atom namespace. The default EE RSS feed will not validate because it lacks the required atom:link tag containing the URI of the feed itself. There is some debate on whether this is actually necessary (some say the validator is wrong, not the lack of the atom tag)- read the article Adding Atom:Link to Your RSS Feed for background on this.

Depending on your site's content, your SEO practices and target audience, it is likely that you may need additional namespaces. A media-rich site, for example, would benefit from the media namespace. The media namespace is used to syndicate video, images and other media and can open up your feed to consumption by media-rich aggregators and services like Cooliris and Yahoo Video Search.

Channel Area

Most of the default template makes perfect sense - just make sure to take a look at your feed output to make sure all the EE fields used have valid values. Also, make sure you want to the {weblog_foo} tags - if you are providing a site feed that combines multiple sections you will probably want to hand-edit many of the tags in the channel area.


Important tip: make sure your feed is correctly reporting the timestamp of your entry date. If the seconds are changing on an item whenever you make an update this will cause many aggregators, including Google Reader, to repost the entry to your RSS feed. Either take the seconds off the time or replace '%s' with an arbitrary static value like '15'.

A search for 'RSS Updates' in the EE Forums will reveal that many people have had this problem. I tested all the date fields in my feeds (see this thread for details) and found that although the entry date day, hour and minute doesn't change on update (as expected), the seconds do! This weird behavior has something to do with how the dates are stored in the database and/or how the date is interpreted by EEs date tags. What it means is that if you go back and edit a post from three years ago, some aggregators will repost the item to your RSS feed even though you did not change the entry date. This can be especially troubling if you like to go back and tweak a post a lot right after publishing - you may go to your feed reader to see it reposted several times in a row.

pubDate vs. dc:date

<pubDate> is part of the RSS 2.0 spec. A lot of feeds out there still use <dc:date> and this either because they kept it from their RSS 1.0 template (for which dc:date was the only option) or they really like the very popular Dublin Core namespace or they prefer it because of the ISO 8601 date format which is much more prevalent than the (really old, as in ARPANET old!) RFC 822 date format that <pubDate> uses. On one hand it makes sense to stay with the spec and pull in namespace elements only as required. On the other hand, it makes sense to provide output in the most reusable way (updated date format). Feed readers parse either just fine, so this is judgment call on your part. Here's an agrument for each:

Based on my own survey of the feeds referenced above, I opted to switch to <pubDate>, replacing <dc:date /> in the channel with:

<pubDate>{gmt_date format="%D, %d %M %Y %H:%i:%s %T"}</pubDate>

And replacing <dc:date /> in the item declaration(s) with:

<pubDate>{gmt_entry_date format=&qout;%D, %d %M %Y %H:%i %T"}</pubDate>

Item <title ... />

The default tag is fine, but if your content people keep putting special characters in their titles (like mine do) then you might want to add the protect_entities="yes" attribute to the {exp:xml_encode} tag. For example the main EE site I work on uses &#187; (») and &amp; (&) a lot in titles.

Even after protecting entities I was still having a heck of a time getting a trademark (™) symbol that is used on a site in many post titles and in a category to consistently display on both the webpage and in RSS feed aggregators - after some digging I realized the character entity that was being used (&#x2122;) for it was not the UTF-8 reference (&#8482;) specified as the encoding for both the RSS and XHTML. So, make sure you (or your content editors) use the correct character encoding entities for special characters!

Item <guid ... />

As formated in the official EE RSS template the <guid> is not a permalink, and therefore should have isPermaLink="false" attribute added to it. Of course you could use your actual permalink and then you could leave that off or change it to "true".

"We recommend the use of the Atom and RSS 2.0 elements to unambiguously identify items. An item that is updated should keep its original ID, and a new item should never reuse an older item's ID. Changing IDs unnecessarily may result in duplicate items, and reusing IDs may cause some items to be hidden. "Tag URIs" make good IDs, since they don't change even when you need to reorganize your links." - Google Reader Tips for Publishers > Implementing Feeds

The above recommendatio explains the multi-posting of an entry on update issue I referred to earlier. Because of this, you will probably want to remove the '%s' from the formatting attribute as well. So, change the gmt_entry_date format string in the <guid> line to "%H:%iZ".

Optionally, you could just use the actual URI of your article and change the isPermalink attribute to true. EE won't let you post two items with the same URL title within a weblog/channel, so you are pretty safe there (EE adds a number to the end of URL title if one already exists).

Item <description.../>

This line is technically fine, but most people will change this to allow HTML formatting of their entries: <description><![CDATA[{summary}{body}]]></description>. This is what displays the bulk of your entry item and where most of your site-specific customization will happen, Customizing ExpressionEngine RSS 2.0 Template on 'A Blog Not Limited' is a great resource for this.


The template uses <dc:subject>. Your feed will be more interoperable with other systems and make more sense programatically if each category is in its own tag. You can do this using the <dc:subject> format, or you can switch to using the <category> tag for each as provided for in the RSS 2.0 spec.

Original Template


<dc:subject>{exp:xml_encode}{categories backspace="1"}{category_name}, {/categories}{/exp:xml_encode}</dc:subject>


<dc:subject>Architecture, Science, Workplace</dc:subject>

Separate using <dc:subject>





Separate using <category>





Updated EE RSS 2.0 Template

This includes what I consider minimal mandatory fixes to ensure error-free code and to prevent (re)posting problems.

{exp:rss:feed weblog="{master_weblog_name}" status="{master_weblog_status}"}

<?xml version="1.0" encoding="{encoding}"?>
<rss version="2.0"
    <dc:rights>Copyright {gmt_date format="%Y"}</dc:rights>
    <dc:date>{gmt_date format="%Y-%m-%dT%H:%i:%s%Q"}</dc:date>
    <admin:generatorAgent rdf:resource="" />
{exp:weblog:entries weblog="{master_weblog_name}" limit="10" rdf="off" dynamic_start="on" disable="member_data|trackbacks" status="{master_weblog_status}"}
      <guid isPermaLink="false">{title_permalink=site/index}#When:{gmt_entry_date format="%H:%iZ"}</guid>
      <dc:subject>{exp:xml_encode}{categories backspace="1"}{category_name}, {/categories}{/exp:xml_encode}</dc:subject>
      <dc:date>{gmt_entry_date format="%Y-%m-%dT%H:%i%Q"}</dc:date>

Improved EE RSS 2.0 Template

This includes optional changes that I added as a result of various articles, the RSS 2.0 spec and by examining the feeds of major professional news sites.


{exp:rss:feed weblog="{master_weblog_name}" status="{master_weblog_status}"}
<?xml version="1.0" encoding="{encoding}"?>
<rss version="2.0"
    <dc:rights>Copyright {gmt_date format="%Y"}</dc:rights>
    <pubDate>{gmt_date format="%D, %d %M %Y %H:%i:%s %T"}</pubDate>
    <atom:link href="{master_rss_uri}" rel="self" type="application/rss+xml" />   
{exp:weblog:entries weblog="{master_weblog_name}" limit="10" rdf="off" dynamic_start="on" disable="member_data|trackbacks" status="{master_weblog_status}"}
      <title>{exp:xml_encode protect_entities="yes"}{title}{/exp:xml_encode}</title>
      <guid isPermaLink="false">{title_permalink="site/index"}#id:{entry_id}#date:{gmt_entry_date format="%H:%i"}</guid>
      {categories}<category>{exp:xml_encode protect_entities="yes"}{category_name}{/exp:xml_encode}</category>
      <pubDate>{gmt_entry_date format="%D, %d %M %Y %H:%i %T"}</pubDate>


Please let me know if you have any suggestions for improvements on the basic template. I have already submitted these suggestions (as have others) on the EE Forums and I hope this article will soon be out-dated. For further information on customizing your RSS feed including adding Google Analytics tracking and additional fields such as author name, see Customizing ExpressionEngine RSS 2.0 Template at 'A Blog Not Limited' (if you use their updated template don't forget to remove the seconds from date fields in the item section).

Installing Using Drupal book source on Dreamhost

USE THIS INFORMATION AT YOUR OWN RISK. Any information found on this website is offered only as informational and includes no warranty, guarantees or support. The author claims no authority on any subject whatsoever.

Using Drupal, 1st Edition by OReilly

Using Drupal, 1st Edition by O'Reilly

I just started reading the recently published book Using Drupal, 1st Edition, published by trusty ol’ O’Reilly and written by a bunch of Lullabots.

So far the book is great, but the instructions on setting up a dev environment aren’t exactly crystal clear for those completely new to Drupal. I thought I’d help out the next geek that bothers to GTS to find pitfalls before starting.

First review the preface section 2.7 ‘Downloading Drupal’. If you’ve never installed Drupal before, or any web application on a web server before, it’s a good idea to check out Lullabot Addison Berry’s very easy to follow video, Installing Drupal 6.

These instructions are specific to the context of a shared hosting account on Dreamhost, but may work for your environment as well. Be sure to review the book’s errata – the ‘confirmed errata’ will let you know about any code mistakes or problems with source discovered since the book was published. For troubleshooting help related to the books exercises and installation issues, review the Using Drupal book forum.

THESE INSTRUCTIONS MAY CAUSE YOUR DATAZ TO BE LOST. In addition to setting up things quickly, these steps include how to quickly delete all the stuff in your database, without bothersome ‘back up your data first’ steps. The idea is you are just creating a sandbox and nuking your install is no big deal.

Enough blab, let’s do this:

  • Create a subdomain for your dev environment like
    • Dreamhost panel > Domains > Mandage Domains > Add New Domain / Sub-Domain
  • Create a new database (on a new or existing subdomain)
    • Goodies > Manage MySQL, scroll to the bottom where it says ‘Create a new MySQL database:’
    • Enter something in all the fields:database name must be unique system wide so get creative, create a new hostname like, you can use your own username but I created a special username and password that I’ll also be using for the admin user in the Drupal install (note: dev enviro, not recc’d for production), you might want to put something to remind you what this is later in the comment field like “Sandbox for Using Drupal Book”.
    • Write down all that DB stuff so you can use it later.
    • Wait a while for new database host name and/or new subdomain to propagate.
  • Download the latest source from the book site.
    • Extract the zip somewhere you can find it, like your desktop.
  • Change the database connection string in using_drupal_source\drupal\sites\default\default.settings.php
    • Open default.settings.php with your favorite text editor
    • change connection string stored in $db_url (line 92 at TOW) from mysql://username:password@localhost/databasename to something like mysql://
  • Copy default.settings.php in the same folder and call it settings.php
    • There should now be 2 files in the default folder
  • Save a backup copy of your default folder somewhere
    • I just copied the default folder and renamed it ‘_default’, or save somewhere on your hard drive, thumb drive, whatever…the point is, settings.php and default.settings.php that will soon live on your web server are going to change and you’re going to want these files again someday.
  • Upload the contents of using_drupal_source\drupal to the root of your new subdomain
  • chmod /sites/default to 777
    • On you web server (via your FTP client) navigate to /drupal/sites/default
    • If you’re using FileZilla, right click (ctrl+click for macs) the default folder and select file permissions, this will allow you to enter the numeric value 777 or just check read/write/execute for all roles
  • Open

Installation profile options on successful install

Installation profile options on successful install

You’ll be prompted to select an ‘Installation Profile’. The book source code includes scripts to automatically install a site with assets and modules used in their examples for you. If you are just starting Chapter 2. where they send you off to the Appendix for installation instruction, chose the last option – the generic/basic Drupal install.

Here’s how to “start over” so you can use a different installation profile. These steps will cause you to lose any data you entered in Drupal – you will end up with a brand new install and a chance to chose a diferent installation profile:

  • Nuke all your database tables

    • Note I said ‘tables’, not the database.
    • Go to (phpMyAdmin screen) and login
    • Select you Drupal database from the databases list at left (e.g. NOT information_schema)
    • Scroll to the bottom of tables listing page and select ‘Check All’, change the ‘With selected:’ drop down to ‘Drop’.
    • You will see a screen asking if you really want to execute this command. Click ‘Yes’.
  • CHMOD /sites/default to 777 again
    • On your web server, go to /sites/default
    • CHMOD default to 777 (again, because the previous install process modified the permissions) and be sure to check ‘recursive’ (or use -R on commandline) because there’s new files in there and we need to blow everything in the default folder away.
  • Delete everything in /sites/default
  • Put a clean copy of default.settings.php and settings.php in /sites/default
    • Remember that saved copy of default.settings.php and settings.php?
  • Go to and start all over again :)

Bold moves in phpMyAdmin. Select all  drop.

Bold moves in phpMyAdmin. Select all > drop.

I hope that was helpful for someone. I remember all to well not even knowing what chmod was and trying to write perl scripts, ouch! As you might guess, with as much time as I spend documenting when I should be doing book exercises I don’t really have time to offer support, but please let me know if anything I’ve written here needs to be corrected or elaborated on. Have fun in Drupal land!

Installing Netbeans PHP IDE on Ubuntu

Lizard Steals Green Bean

Nothing amazing going on, just a few tips that might save you some time:

  • You need java runtime installed and working, prolly apt-cache search to make
    sure you’re putting in the most recent version (6 as of this writing)

    • sudo apt-get update
    • sudo apt-get install sun-java6-jre sun-java6-plugin sun-java6-font
  • The netbeans in the repo is for the Java IDE, so don’t bother with apt-get
  • Download the install file here:
    • Be sure to pick the PHP bundle
  • If clicking on the file gives you an error or tries to open in gedit or something, right-click > properties > permissions and check ‘allow executing file as a program’
  • Select Run (not ‘Run in Terminal’), running in terminal will throw some GTK errors

Next you might want to head over to the Netbeans website and watch the intro vid and orient yourself to the plethora of PHP-centric features.

As fair newb to programming in PHP I can’t say I’m qualified to suggest an IDE. So why Netbeans? It’s free. It porvides syntactic and semantic code highlighting for PHP and debugging through Xdebug. Folks in my Seattle PHP meetup group who know a lot more about programming than I do seem to really like it, every time I go to install Eclipse I am daunted by the website, instructions and innumerable options. Finally, it was recommended in the recent Smashing Magazine article The Big PHP IDE Test: Why Use One And Which To Choose (2009.02.11) so I stopped resisting.

Do you like it, recommend others over it?

Drupal 5.x on Ubuntu LAMP

The quick and dirty dev install of Drupal on Ubuntu

USE THIS INFORMATION AT YOUR OWN RISK. Any information found on this website is offered only as informational and includes no warranty, guarantees or support. The author claims no authority on any subject whatsoever.

Why Drupal, Why Ubuntu?

For me it's all about community. I've always enjoyed apache web development in part because of the active and helpful user groups, forums, irc channels, etc. I use Ubuntu as the operating system for my LAMP because it's really popular right now - it has a very active forum and pretty good documentation. Drupal is an open-source content management system, or you could look at it as a framework since it was built to make it easy for coders to override almost anything it does without hacking the core. This means you could make it do anything you want if you happen to be good enough at PHP and still take advantage of core development and security updates no matter how much you modify the product.

Why write installation instructions?

Good question? Well, the installation instructions at are good but they cover all sorts of environments (who wants to slog through all that?) and those in the Ubuntu Community Docs are great and pretty specific but cover Drupal 4.6.7 and 5.1. I probably should update the docs at Ubuntu, perhaps I will after I hash it out here and after a few people let me know they worked or what to change. Also, I like to search for instructions specific to my situation whenever I approach a new installation. It's good to see what other people in similar circumstances have encountered, I call it due diligence. I would suggest any user doing this install review the documentation mentioned above thoroughly. Also see related links at the end of this article.


These instructions don't cover the setup of your server environment. Mine happens to be:
  • Ubuntu 6.06 LTS server
  • Apache
  • PHP 5.1.2
  • MySQL 5.0.22

Get Drupal

tar -zxvf drupal-5.7.tar.gz

I'm a big fan of apt-get but there were a lot of issues in the forum started by people having problems with Drupal in the repositories. Community Docs recommend getting the latest package from, right now that happens to be Drupal 5.7. (Drupal 6 is out now as well, and is very cool, but CCK/Views aren't ready for prime-time and I'm installing for the purposes of following tutorials written for 5.x.)

Move Drupal

sudo mkdir /var/www/drupaltest
sudo mv drupal-5.3/* drupal-5.3/.htaccess /var/www/drupaltest
sudo mkdir /var/www/drupaltest/files

My apache install is pretty much setup to default config. /var/www is my web root, yours may vary. Because I'm just using this particular install as a test which I plan on destroying later I'm going to put it in the boring old subdirectory 'drupaltest', actually I named mine d57_test_01 but thought drupaltest would be more comprehendable in the example.

In the mv command we explicitly move .htaccess because it's a hidden file.

Database Setup

mysqladmin -u root -p create db_drupaltest
mysql -u root -p

Create the database for Drupal to use - you can replace 'db_drupaltest' with whatever you'd like to call the database. You'll need to enter your mySQL root password. If you get an access denied error make sure you're using the mySQL root password and not your login or Ubuntu root password. The second command puts you in mySQL monitor, the command line interface for managing your MySQL server. The commands in the next code section are SQL. You could also run this in phpMyAdmin if you'd rather have a GUI.


Change the datebase name, the username 'drupal_usr' and 'secretpassword' to whatever you like. Just don't forget to write it down somewhere safe because you'll need to know it later.

Edit Settings.php

sudo vi /var/www/drupaltest/sites/default/settings.php

Using vi (or whatevs) change the $db_url line. Note: If you use a fancy charcters or dashes in your user, password or database names replace them URI hex encodings, this is detailed in database settings comments section in the settings.php file.


Up Your PHP Memory Allocation

If you have a new LAMP install the default memory setting for scripts is 8M. This is redonkulous and Drupal will suck. Look for the 'Resource Limits' section and change memory_limit to 32M and then restart apache.

sudo vi /etc/php5/apache2/php.ini sudo /etc/init.d/apache2 restart

Final Steps

Go to http://localhost/drupaltest/install.php (or your servername instead of localhost if DNS is setup). You should see this:

Screenshot of Drupal Installation Message

One last thing, if you click Administer you will probably get a 'one or more problems were detected' error message. Two things: your files directory isn't writable and you cron job hasn't run. The first one is easy - just make the files area writable by all:

sudo chmod 777 /var/www/drupaltest/files

As for cron, you can just click 'run cron manually' on the Status report page - but you'll need to do this anytime you want to update the index. For a quick dev install you're likely to trash soon it may not be necessary but for a production or long-term dev install you'll want to set up a cron job to hit http://localhost/drupaltest/admin/logs/status/run-cron every few minutes depending upon your site's traffic and requirements. See Configuring cron jobs in Drupal's Getting Started guide for more.

That's it. Good luck folks, now enjoy surfing the Drupal learning curve...heheh.

Related Links

Installing Plone 3.0 on Ubuntu 6.06

Plone on Ubuntu
Plone 3.0.2 on an 32-bit Ubuntu 6.06 LTS ‘Dapper Drake’ LAMP

What is Plone?Plone is a pretty cool content management system (CMS). Well, I think it’s cool based on some videos and documentation on their site. After comparing a lot of CMS options (including some really expensive closed-source stuff and 2 weeks of developer training on Sharepoint) I’m trying out Plone because a) open source is cool. b) Google people are smart, c) it supports LDAP authentication which I need for my all-M$ work enviro, d) there’s training/conferences/books/commercial support!? available and d) I’ve read some great reviews and CMS comparisons that rated it #1.

That was the good, now the most common complaint: hellish learning curve. Well, if you’re a developer and you’re going to customize beyond the existing system and available plugins. Why? Well, you’ll have to learn some python and the database is the rather obscure Zope instead of MySQL or SQL. In fact, I just read this on 456 Berea St (one of my fav dev blogs) and it gave me the shivers:

And the inital learning curve, even though I was a fairly good python programmer, was insane.

Then again, people told me Perl was insane too and I loved working with Perl. Besides, we’re just playing right now, right?

What is Ubuntu? - Ubuntu is a community developed, linux-based operating system that I use for a web server. ‘Dapper Drake’ is the release name for 6.06 LTS. (Keyword: LTS – long term support). It’s surprisingly easy to install. If you’re bored, geeky and/or have extra VMs or boxes lying around you should try a LAMP install and get your web server up in 15 minutes!

There’s already a Plone From Scratch HOWTO on the Ubuntu Forums, however it is for a previous version of Plone (2.0.5) and uses the apt-get method which I’ve noticed a lot of people in the forums having trouble with. Disclaimer: I do not provide ‘undo/uninstall’ instructions, other than, whip up a a LAMP on VMware and test it first or backup your system. I would welcome uninstall directions if someone who knows what they are doing could provide them.

Doesn’t Plone provide installation instructions? Well, yes. But when I started to read them I got real nervous. What the heck is gcc? libssl? TLS? etc. Those poor geeks at Plone don’t realize how noob noob can be! I tried to find better instructions (for me) at the Ubuntu Forums and instead I found a lot of people having problems trying to install Plone via Synaptic or apt-get instead of using Plone’s instructions. So here ya go.

You should already have gcc, g++, make and tar installed by default, but if you want to be anal do this:

sudo apt-get update
sudo apt-get install gcc g++ make tar

Sidetrack > (Possibly totally unnecessary step!) If you’re a fair server noob like me you have no idea what libssl and readline libraries and development headers are and what the heck is TLS? Google suggests it has something to do with mail encryption. I read some confusing stuff on Ubuntu Forums about RPM and a program called Alien that converts RPMs to DEB packages seemed probably unrelated but like a handy utility to have and so:

sudo apt-get install alien

Download the Plone Installer Package. I saved it in my home folder – it doesn’t really matter where you put it so long as you can find it.

wget -c
tar zxf Plone-3.0.2-UnifiedInstaller-Rev2.tar.gz
cd Plone-3.0.2-UnifiedInstaller

Here’s where you have to pay attention. You can do a ZEO or Stand-Alone install. “WTF?” you say? Yeah, well just pick your poison after reading all about it. Me, I’m doing a Stand-Alone as root install.

According to the README.TXT in the installation package my choice of standalone instance installed as root will result in Plone being installed to /opt/Plone-3.0.2 and libz and libjpeg libraries getting built in /user/local. A “plone” user will be added and Zope will be configured to run under that user id. You need to start Zope as root user (via sudo).

sudo ./ standalone

Then a whole bunch of stuff happens. Lots of gcc (compiling) and checking for things (lots of yes and a few no-s in my case). Just wait, watch, hail Mary and knock on wood. This is a good time to read about the rest of this tutorial or creating new Zope/Plone instances if you want to do that. Or just catch up on your RSS feeds and I’ll hold your hand some more ;o)

If you’re real lucky, this is what you’ll see when it’s all said and done:

###################### Installation Complete ######################
Use the account information below to log into the Zope Management Interface
The account has full 'Manager' privileges.
Username: admin
Password: XXXXXXX
Before you start Plone, you should review the settings in:
Adjust the ports Plone uses before starting the site, if necessary
To start Plone, issue the following command in a Terminal window:
sudo /opt/Plone-3.0.2/zinstance/bin/zopectl start
To stop Plone, issue the following command in a Terminal window:
sudo /opt/Plone-3.0.2/zinstance/bin/zopectl stop
Plone successfully installed at /opt/Plone-3.0.2
See /opt/Plone-3.0.2/zinstance/adminPassword.txt
for password and startup instructions
Ask for help on plone-users list or #plone
Submit feedback and report errors at
This installer was created by Kamal Gill (kamalgill at
Maintainers for Plone 3 are Kamal Gill and Steve McMahon (steve at

First, write down your admin password!! Then, check zope.conf to ‘review settings’. I’m not familiar with them, so I just scanned for the port. Found it on line 969 (YMMV), set to the default Zope/Plone standalone install grabs, port 8080.

sudo vi /opt/Plone-3.0.2/zinstance/etc/zope.conf

Use :q! to quit vi without messing anything up

Use netcat to see what ports you have open already. (Netcat comes with Ubuntu install)

nc -z -v -w2 localhost 1-65535

After confirming that 8080 is avail (or changing it in zope.conf if it is not available) continue following directions.

sudo /opt/Plone-3.0.2/zinstance/bin/zopectl start #that last part is an L not a 1, took me a while...

Then go to: http://localhost:8080 (or sub servername for localhost to test from other computer). If you’re lucky AGAIN you’ll see the Zope Quick Start page!! Wahoo! Hii Fiiiiveh to self! Then look at the example site: http://localhost:8080/Plone, and then check out the management interface at http://localhost:8080/manage. Have fun. I hope it was as good for you as it was for me!

BTW: I suggest the Ubuntu Support Forum and Plone Support Forum for help. I am totally new at server administration, I prolly shouldn’t even publish this and I definitely can’t support your lazy arse!

How To Make Your MediaWiki Private

USE THIS INFORMATION AT YOUR OWN RISK. Any information found on this website is offered only as informational and includes no warranty, guarantees or support. The author claims no authority on any subject whatsoever.

I've been using an amalgamation of hacks to track all the information I want to be able to recall later: for bookmarks, gmail for contacts and random notes, private blog entries for some organized content, and tracks for tracking projects. Blech. It's just too much. My memory is too weak. What I really want is a comprehensive PIM (Personal Informatio Manager). And so I installed MediaWiki because that's what Wikipedia uses and that's what Dreamhost offers as a One-Click Install (e.g. the path of least resistance).

I thought I'd share with you all the the process of customizing the default install to create a private wiki. Following are the specifics to my install but this will probably be helpful to many with a different host or newer version.

  • Create a subdomain for your MediaWiki install, such as, Select PHP 5.x (not 4.4.2) and leave Extra Web Security.
  • Install MediaWiki. Dreamhost walks you through this and it's also covered at the Dreamhost Wiki so I'm not going to go into detail here. But be sure to move the newly generated LocalSettings.php to the parent directory, and delete the config directory with its content.
  • Chmod LocalSettings.php to 600
  • Create a backup copy of LocalSettings.php, rename it something like .BAK instead of .PHP or something. Put it back in your Wiki install directory right away so it's safe and available if you need it later.

Restrict Wiki Access

Before bothering to put up our own cute logo or other fun stuff like enabling image linking and using clean urls, we're going to lock down our install. I didn't find a lot for this particular intent on the official MediaWiki Docs or the Dreamhost Wiki, but I did find this old Meta Wiki Article

  • Prevent new user registrations. Add the following line to the bottom of LocalSettings.PHP:
    # This snippet prevents new registrations from anonymous users
    # (Sysops can still create user accounts)
    $wgGroupPermissions['*']['createaccount'] = false;
  • Make sure it's working by trying to create an account. You should receive an error message that says username not found, please create an account. To change the message login as yourself (you should have set up a Sysop login when you configured your wiki) and point your browser to
    I changed my message to:
    There is no user by the name "$1". This wiki is private and therefore closed to new accounts. Please contact Mahalie if you have any questions.
    I intentionally failed to provide contact information. If a user doesn't even know how to contact me, they really don't need an account on my private wiki!
  • Prevent anonymous users from reading by adding the following to LocalSettings.php: # Disable reading line, for anonymous (not-logged-in => * ) :
    $wgGroupPermissions['*']['read'] = false;

    # ... and enable anonymous to read the followings pages :
    $wgWhitelistRead = array( "Main Page", "Special:Userlogin", "-", "MediaWiki:Monobook.css" );

    # ... same in an other language (French, with one UTF-8 special characteres) :
    # $wgWhitelistRead = array( "Page Principale", "Special:Userlogin", utf8_encode('Aide en français'));
  • Verify setting by logging out of your wiki and attempting to browse. You should get a 'Login Required. You must login to view other pages.' when clicking on any local link and the page should redirect to the main page after a few seconds.
  • If you want to hide the side navigation if the user isn't logged in (because, perhaps you have private project names or something) edit includes/Skin.php and change the function buildSidebar(). Add these lines near the very top, after the globals.: global $wgUser; if (! $wgUser->isLoggedIn()) { return array(); } This will hide the navigation on sup-pages (not the default main page)

p.s. WebWorkerDaily just published 15 Productive Uses for a Wiki in case you're wondering why someone would want to do this!

Update: Check out a new tutorial on Lifehacker, Customize Mediawiki Into Your Ultimate Collaborative Website - it's not a PIM implementation but it offers some good information on quickly re-skinning and mods to consider.