User talk:Jeshyr

From Dreamwidth Notes
Revision as of 12:37, 17 September 2011 by Jeshyr (Talk | contribs)

Jump to: navigation, search

Installing Dreamwidth on OS X 10.7 Lion

Hello, world!

The instructions below are not complete, and are not enough to get the Dreamwidth code up and running.

Below are some notes on getting the environment setup on OS X 10.7 Lion. Some of these may be applicable to older versions too, but I've no way of testing. This is a supplementary document, for setting up the environment only. For instructions on actually running the DW code, see Dev_Getting_Started.

I'm assuming that you want all of these to be placed in /usr/local/bin instead of overwriting your system files. All instructions below should leave your system files intact.

When you see stuff like this:

 $ commandname parameters

The $ is a Terminal prompt. You should type the rest of the line as is into your Terminal (e.g., "commandname parameters", no "$" and no quotation marks). Lines not preceded by a "$" are output.

Note about OS Versions

These notes are specifically about OS X Lion which already has 64-bit versions of all of its programs which simplifies this process quite a lot. I don't think this will work the same on previous versions of OS X.

Possible points of pain

Note: Installing the necessary environment (covered below) isn't that hard, but I'm not so sure about things like Perl modules, especially the xml parser, which were a pain back when I was trying to run LJ code on my PowerBook/Tiger. Crossing fingers, will cross that bridge, etc.

What you'll need before you start

  • Install XCode from the App Store (this what used to be called Dev Tools)
  • Make sure your $PATH includes /usr/local/bin


Obtaining the binary

You can download the binary from here:

You need the 64 bit version.

Once downloaded, unzip the contents into /usr/local:

 $ sudo tar xvfz mysql-5.5.16-osx10.6-x86_64.tar.gz -C /usr/local

Then create a symbolic link to make the rest of everything easier:

   $ cd /usr/local
   $ sudo ln -s mysql-5.5.16-osx10.6-x86_64/ mysql # use whatever directory corresponds to your MySQL download

Now you can refer to your install directory as /usr/local/mysql which is easier to remember.

Have an optional section

Go inside; look at the install instructions if you want:

 $ cd /usr/local/mysql

Setting up the mysql user

You'll find out that the first few instructions won't work on Lion, though! Try these instead:

 $ sudo dscl . -create /Groups/mysql # same as groupadd mysql
 $ sudo dscl . -create /Users/mysql  # same as useradd mysql
 $ sudo dscl . -append /Groups/mysql GroupMembership mysql

Setting up folder permissions

 $ cd /usr/local/mysql
 $ sudo chown -R mysql .
 $ sudo chgrp -R mysql .
 $ sudo scripts/mysql_install_db --user=mysql
 $ sudo chown -R root .
 $ sudo chown -R mysql data

Starting up mysql

There should be a way to start up mysql on system startup. If you don't do that, you will need to run this command every time you want to get the mysql database up and running:

 $ sudo bin/mysqld_safe --user=mysql &


Obtaining it

Binary packages for OS X are available here:

Download the most recent one available for your OS version - I used Mercurial 1.9.2 for OS X 10.7 for this.

This build of Mercurial comes with a standard Mac-style installer so double-click on the package in the Finder to unzip it, then double-click on the installer and go with all the default options.

Create a shortcut

The DW expects Mercurial to be installed in /usr/bin, whereas the binary installs it in /usr/local/bin. So we shall put in a symbolic link:

 $ sudo ln -s /usr/local/bin/hg /usr/bin/hg

Getting the bootstrap

Instead of wget, curl should do the trick:

 $ curl -O

(I'll admit, I only added this last because I forget it all the time >_>)

You can also install wget using Fink.