MacPorts

Drupal on Mountain Lion (OS X 10.8)

The instructions still need some work. I'd did some updating but haven't tried using it with a clean install yet. After reading this it sounds like there's some bigger changes. I've also been trying to switch from macports to homebrew so that'll also mean some changes to this.

Install XCode

Install XCode from the App Store. Run Xcode and open its Preferences (⌘+,) select the Downloads tab and then the Components sub-tab. Click the Install button on the Command Line Tools component.

Install MacPorts

Follow the directions to install Mac Ports.

Become root

To follow these instructions you need to be running as the root user using the default sh shell. If you've got administrator permissions you can open up a Terminal window and switch users using the sudo command then provide your password.

amorton@minivac:~% sudo su
Password:
sh-3.2#

Install MySQL

Use port to install MySQL:

/opt/local/bin/port install mysql55-server

You'll need to create the databases:

sudo -u _mysql /opt/local/lib/mysql55/bin/mysql_install_db

Let launchd know it should start MySQL at startup.

/opt/local/bin/port load mysql55-server

Secure the server and set a new admin password:

/opt/local/lib/mysql55/bin/mysql_secure_installation

Create a configuration file:

cp /opt/local/share/mysql55/support-files/my-large.cnf /etc/my.cnf

Edit /etc/my.cnf using your editor of choice and make the following changes to the [mysqld]:

  • Change the maximum packet size to 16M:

    max_allowed_packet = 16M

Drupal on Lion (OS X 10.7)

I was half way done adding some info how to setup pecl/pear to my guide to running Drupal 6 on OS X 10.6 before I realized I'd been running Lion for almost nine months. So it seemed like a good excuse to update it for Lion. These might be a little wonky since I did an upgrade rather than a clean install so if you notice anything please drop me a line.

Note:I'll save you the trouble of commenting, I am familiar with MAMP but would rather punch myself myself in the face than use it. If you'd like to, go right, but I'm going to continue to compile my own so I know where everything ends up.

Using memcached with stock OS X Apache

I wanted to use memcached but didn't want to compile all the dependencies by hand and wanted to use the stock version of Apache that ships with OS X so I cobbled together the following instructions.

  1. Install MacPorts
  2. Use MacPorts to install memcached:
    sudo port install memcached
  3. Use pecl to download the latest version of memcached and uncompress it:
    cd /tmp
    pecl download memcached
    tar xvzf memcached-*.tgz
  4. Build the extension using MacPort's version of libmemcached (which was installed as a dependency of memcached):
    cd memcached-*/
    phpize
    ./configure --with-libmemcached-dir=/opt/local/
    sudo make install
  5. Enable it by editing php.ini and adding the following line:
    extension=memcached.so
  6. Restart Apache:
    sudo apachectl graceful

References:

Using Mercurial and SVN

At Sony we're looking for a distributed version control system to replace Subversion—primarily Git and Mercurial. I'm very familiar with Git but hadn't done much with Mercurial so it seemed like a good idea to use it for a couple of weeks and learn the quirks. Since I'm stuck using Subversion I decided to see if it would be feasible to use Mercurial as a "super client" working locally then pushing changes back to svn. A little Googling turned up two candidates hgsvn and
hgsubversion. hgsubversion extends the commands pushing and pulling changes, giving a more native experience, so it seemed like the best choice for learning the system.

The setup is actually pretty simple but I'm documenting it for my own future reference.

Use MacPorts to Install hgsubversion:

sudo port install py26-hgsubversion

Enable the rebase and hgsubversion extensions:

printf "[extensions]\nrebase=\nhgsubversion =\n" >> ~/.hgrc

Check that the extension was enabled:

hg help extensions

It should list something like:

    enabled extensions:

     hgsubversion
                 integration with Subversion repositories

Now you're good to checkout from SVN (note: using the svn+ prefix in the URL lets you use passwords stored in your keychain):

hg clone svn+http://example.com/svn/repo/trunk

I actually ran into an issue where the clone was exploding with a stack trace. The bug had been fixed in 1.1.2 but MacPorts hadn't yet been updated so I rolled a patch to update it.

Drupal 6 on OS X 10.6

Running Drupal on OS X 10.5 was a pretty huge pain in the ass. It's much easier in in 10.6 since it includes PHP 5.3 with GD and the PDO out of the box. And Drupal 6.14 resolves the PHP 5.3 incompatibilities.

In this guide I'll walk through the process I used for reinstalling OS X, then installing MacPorts and using it to install MySQL.

Note: I've shortened this up a bunch since it was first posted (originally it was using PHP 5.2 from MacPorts). I also want to make it clear that I am familiar with MAMP but would rather punch myself myself in the face than use it. If you'd like to, go right ahead since it's probably easier—and as evidenced by the commenters below—you're in good company. But I'm going to continue to compile my own so I know where everything ends up.

Text mode Cover Flow

My side project has been writing some code to display data from iTunes on my Heathkit H19 terminal.

itunes says 69textTunes

Requirements

You'll need to use MacPorts to install ImageMagick and jp2a:

sudo port install jp2a imagemagick

You need to use Ruby's gem to install ncurses and appscript:

sudo gem install ncurses rb-appscript

The Code

As of 24 May 2009, I've move this code to GitHub Repository. Now there's publicly accessible version control and people can fork and share changes.

Getting PHP + GD + PostgreSQL working on OSX 10.5 (aka recompiling everything)

Finding myself in need of a PostgreSQL server to test some patches for Drupal core, I've decided to do a follow up to my guide to getting PHP + GD + MySQL installed on OS X.

Fortunately for me John VanDyk wrote up Beginning with Drupal 6 and PostgreSQL on OS X 10.5 Leopard which covers the nitty gritty of getting PostgreSQL server installed. He doesn't address recompiling PHP so I'll pick up the story there.

Last Updated: June 1, 2009

Building the C2 Morse code trainer on OSX

I was trying to install Ward Cunningham and Jim Wilson's Morse code trainer on OS X and it looks like their .dmg file doesn't work on the new Intel machines. Here's what I did to get it to build.

Getting PHP + GD + pdo_mysql working on OSX 10.5 (aka recompiling everything)

This guide walks through the steps necessary to setup PHP on Leopard in order to run the HEAD version of Drupal. The basic steps are installing several prerequisites then recompiling Apache and PHP from source. It could totally bork your system, I'm just writing it down so the next time I need to do this I can remember what I did. I wish I could give credit to all the places I stole bits from but I didn't do a good job of keeping notes early on.

Every time Apple releases a security update it seems to end up overwriting PHP or Apache and I end up revisiting these instructions. Since it's my personal guide I'm continually modifying it to match my current needs. For example, the last big change was adding in old mysql extension and the new PDO-mysql extension. The upside for you, kind reader, is that this keeps the instructions up-to-date. The down side is that when you come back in two months and try to repeat one part of this it may not work because I've changed some of the earlier steps.

Last Updated: August 26, 2009

Syndicate content