Installing Wordpress 2.7 On Mac OS X Leopard

This post shows you how to install Wordpress 2.7 on a Mac OS X Leopard. The post assumes that MySQL and PHP have already been installed. Here are the six steps to get Wordpress installed on your Mac, so you can tweak a theme or create some widgets and plugins:

Step 1 - Configure MySQL Database


$ mysql -u root -p
Enter Password: {ROOTPASS}
> create database wordpress;
> grant all privileges on wordpress.* to wpuser@localhost identified by 'password';
> quit

Change the password in the grant command to whatever you want the password to be.

Step 2 - Download & Extract Wordpress

- Download and Wordpress from here: http://wordpress.org/latest.zip
- Move the Wordpress zip file (wordpress-2.7.1.zip) to /Users/user/Sites
- Unzip the zip file in /User/user/Sites

You should see a Wordpress folder now in /Users/user/Sites

Step 3- Configure Wordpress To Connect to MySQL

cd /Users/user/Sites/Wordpress
cp wp-config-sample.php wp-config.php

edit wp-config.php and set the following configuration variables:

define('DB_NAME', 'wordpress'); // The name of the database
define('DB_USER', 'wpuser'); // Your MySQL username
define('DB_PASSWORD', 'password'); // …and password
define('DB_HOST', '127.0.0.1');

Note: I needed to change “host” to 127.0.0.1 to get Wordpress to connect to my MySQL database.

Step 4 - Create a Virtual Host for Wordpress

This step allows us to access a local Wordpress blog from http://wp.local

Edit /etc/hosts and add the following line:
127.0.0.1 wp.local

Edit /etc/apache2/extra/httpd-vhosts.conf

<VirtualHost *:80>
ServerAdmin webmaster@wp.local
DocumentRoot "/Users/tdewell/Sites/wordpress"
ServerName wp.local
ServerAlias *.wp.local
ErrorLog "/private/var/log/apache2/wp.local-error_log"
CustomLog "/private/var/log/apache2/wp.local-access_log" common
</VirtualHost>

Step 5 - Restart Apache

Click:
System Preferences >> Sharing

uncheck and then check again the Web Share checkbox:

websharing1

Step 6 - Install Wordpress

http://wp.local/wp-admin/install.php

Make sure you save the admin password somewhere.

Step 7 - Start Blogging

http://wp.local/wp-admin

References

This post is mostly based on this article:

Leopard How To Install Wordpress

I’ve modified the instructions to allow multiple projects and websites in the /Users/user/Sites folder.

I hope this article was of some benefit to you!

1 Comment »

  1. Derosa Said,

    March 8, 2010 @ 7:59 PM

    Skoro eto sluchitsya

Leave a Comment