User talk:Jeshyr

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

Jump to: navigation, search


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. If you are trying this on a version prior to 10.7 Lion, you need to see Running Dreamwidth on a Mac OS X system.


Install XCode from the App Store - this what used to be called Dev Tools. You can search for "XCode" from within the Mac App Store and that will get you the XCode installer.

Once the installer has downloaded you need to run it - doubleclick on 'Install Xcode' in your Applications folder. You can delete the installer once the installation is finished, if you like.


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.

Setting up the mysql user

The /usr/local/mysql/INSTALL-BINARY installation instructions will not work on OS X. Use 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 &

(You'll need to leave the terminal window open after this or you'll terminate the mysql process).


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


GD is a C library for making graphics and graphs.

I'm not installing this yet


GMP is another C library for arbitrary-precision math.

It's available here:

Not installing this yet either, it does claim to build on OS X though.


GnuPG is available pre-built for Mac OS X at:

Simply download and install this package, it's standard Mac style.

Perl Modules


First set up CPAN which simplifies installation of all the other modules:

   $ sudo CPAN

You can answer "yes" to it's autoconfiguration question:

   Would you like me to configure as much as possible automatically? [yes] 

I was able to accept defaults for the other questions it asked. When it's installed it will dump you into the CPAN shell:


The first thing to do is reinstall CPAN to make sure you're up to date.

   cpan[1]> install Bundle::CPAN

This installed a lot of other support modules and took quite a while, it spams the screen with tons of results while it's doing it and it stopped a few times to ask me questions, I just accepted any default it offered! When it's done, reload your CPAN shell:

   cpan[2]> reload cpan

Perl Modules

You now have a really really long list of packages to install. Some of these will install prerequisites automatically, others will ask if they should - just accept all defaults.

I have copied this list mostly from the Dreamwidth Scratch Installation page and make no claims about it being complete OR about any of these modules being necessary :)

install Captcha::reCAPTCHA install Unicode::CheckUTF8 install DateTime install MIME::Lite install HTML::Template install Net::DNS install XML::Simple install Class::Accessor install Class::Data::Inheritable install Class::Trigger install URI

  1. install Math::BigInt::GMP # requires libgmp first, leaving this for now

install Crypt::DH install URI::Fetch install HTML::Template install MIME::Lite install GnuPG::Interface # requires GPG first install Mail::GnuPG # requires GPG first install Proc::ProcessTable install SOAP::Lite install RPC::XML install String::CRC32 install Text::vCard install XML::Atom install XML::RSS install Image::Size install Unicode::MapUTF8 install Net::OpenID::Consumer install Net::OpenID::Server install YAML install CAPTCHA::ReCAPTCHA install DBD::SQLite3 install Test::Simple install Test::SimpleUnit install Template install Term::ReadKey install Test::Most install Business::CreditCard

  1. extutils::cbuilder??
  2. perlmagick
  3. libwww
  4. install GD #wait until GD installed
  5. install GD::Graph #wait until GD installed


If you want your DW installation to be able to deliver mail you'll need Postfix set up. By default, Lion comes with Postfix installed but not configured.

Possibly relevant info:


Getting the bootstrap

Instead of wget, curl should do the trick:

  $ curl -O

You can also install wget using Fink or build it from source if you prefer.