« Found Software: DashCode | Main | Adobe Releases Deets on Apollo »

Installing Movable Type on Mac OSX 10.4 - Part 2

Note: If you are just joining us, part one of this tutorial is located here.

Now that you've completed downloading Movable Type 3.2, MySQL and ImageMagick, it's time to install them. Installing most of these is a breeze but there will be times you will have to use the Terminal application in order to complete a few things. Fear not. All steps in using the Terminal are documented here.

Let's do the easy stuff first.

Installing MySQL

I'm going to assume you are installing this on a local machine or at the very least have Timbuktu, VNC or Apple Remote Access ability. Let's begin.

Double click the .dmg file that you downloaded from MySQL. Inside this .dmg you'll find the MySQL package. All you have to do is double click it to install. Once it's done the complete MySQL installation will reside in /usr/local/mysql. Next double-click the MySQLStartupItem and install it. This little item will make sure that MySQL starts up each time your reboot your Mac. Lastly the let's install the MySQL.prefPane which gives you a nifty GUI to turn MySQL on and off. If you'd like all users on your system to access this install it in /Library/PreferencePanes. If it's just for yourself, install it in ~/Library/PreferencePanes. Simply drag and drop.

Now let's secure MySQL from the Terminal.
Launch the Terminal and do this command:
mysql_secure_installation

since your install has no root password just press return and then set the root password. Then say 'yes' to everything that comes next.

Installing Image Magick

The instructions are the same for Image Magick as it is for MySQL. Just download, double-click and install. Easy!

Installing DBD::MySQL

Okay here comes a tough one. For some reason getting DBD::MySQL to work on a Mac has left a lot of people frustrated as it simply will not install without some help. Luckily we've figured a few things out with the help of this article by Jay Allen. Read it if you want the nitty gritty on the hows and whys. For the rest of you, a brief synopsis:

DBD::MySQl is a perl module that lets MySQL and Movable Type talk to each other. There is a bug in DBD::MySQL-3.0003 as of this writing. Here is how to fix it.

Let's get stuff going! We'll use CPAN to get the bundle downloaded to our Mac. Unfortunately we have to first allow the install to fail since this will also install other components DBD::MySQL needs. If this is the first time you are running CPAN, it's pretty simple to set up if you just go with the defaults (just press the return for most of the setup options). Just read along as it configures itself and you should be fine.

You'll need to use the Terminal for some parts of this section.

sudo perl -MCPAN -e 'install Bundle::DBD::mysql'

At the end of it all CPAN will fail to install DBD::MySQL (as of version 3.0003 this is still true). Instead, we'll have to use some trickery to fix the bad installer. Follow these steps:

cd ~/.cpan/build/DBD-mysql-[version]
replace 'version' with the version in the build folder.

Now lets check where our mysql libs are by doing these two commands. Press return after each command:

mysql_config --cflags
mysql_config --libs

Each command will return a value. Copy an paste these values into this next command.

You'll REPLACE each of those values into this next command, one for the --cflags value and one for the --libs value. Don't forget the space before the "\"!!!:

sudo perl Makefile.PL \
--cflags="-I/usr/local/mysql/include -Os -arch ppc -fno-common" \
--libs="-L/usr/local/mysql/lib -lmysqlclient -lz -lm"

Then finally lets make the module and install it. Type the following:

make
make install

all done with that!

Make your database in MySQL

We won't go into how to set up or optimize your mysql for this tutorial. Instead we'll go over how to create a database in mysql since you'll need a place for MovableType to store it's data. You'll use the Terminal again for this next step:

This command will prompt you for the root password of MySQL.

mysql -u root -p

The next set of commands create the actual database in MySQL. You can name the database something else but for this example we'll use the name blog. You'll need to replace "yourname@localhost" with whatever name you want to grant access to this database (leave the "@localhost" part). Finally replace "yourpassword" with a password of your choice.

create database blog;
grant all on blog.* to yourname@localhost identified by “yourpassword*”;

Installing Movable Type

Still with me? Now we've gotta install the actual Movable Type application. Hopefully you've already downloaded it. Let's install!

Move the MT3.2 package you downloaded into your /Library/WebServer/CGI-Executables folder.Unpack the package if you haven't already done so. You may rename the unpacked folder anything you want, but just make sure that it has no spaces in the name. For this tutorial we'll rename it "mt".

Terminal time again! Let's be sure all the mt.cgi stuff will execute. Enter the following commands:

cd /Library/WebServer/CGI-Executables/mt
chmod 755 mt*.cgi
mv mt-static /Library/WebServer/Documents
cd ../../Documents
sudo chown www mt-static

What we just did is change all files with a .cgi suffix to an executable state and then moved the mt-static folder which contains all of the graphics for MT's back end system to the Documents folder of the webserver in OSX.

Let's Check Everything

Run mt-check.cgi to make sure everythings in place and ready to install. http://your.website.com/cgi-bin/mt/mt-check.cgi If you dont have a domain name use localhost instead.

That's it for this section! In my last installment we'll fix up the config files and get things running. Any corrections, suggestions are appreciated!


Useful? Then Digg It.

Del.icio.us | Technorati Tags:

Comments

You rock! I've been digging for this information for days now. Thanks for this how to. One change- When fixing the DBD::mysql, it should be "sudo make" "sudo make install" or you'll get a "permission denied" (with version 3.0007 anyway). Thanks though! Fixed everything I needed.

Tags:

Post a comment


Type the characters you see in the picture above.

Contact Us

Got anything interesting to report or want to tell us? Feel free to email us!

Links

Email Notification

Enter your email address:

Delivered by FeedBurner

Powered by
Movable Type 4.1