Studying how genomes express themselves

Local install of davidardellorg_wordpress on Mac OS X 10.5.7

I thought I would make my very first ever blog post ever about how I installed a local version of davidardellorg_wordpress on my mac book pro with OS X 10.5.7.

The steps to follow are:

  1. Install and configure mysql
  2. Turn on php in apache
  3. (optional) install phpmyadmin
  4. install davidardellorg_wordpress

with various debugging and detective steps in between. A few surprises came up.

Here are the details:

Installing mysql
MySQL is that database that davidardellorg_wordpress uses to store your data. I often use fink to install ported open source software. This post assumes you’ve got fink running smoothly on your system. If you don’t, there are mac-specific installers for mysql complete with mac-specific bells and whistles. Just go check out mysql AB’s website.

I had previously used fink to install mysql. I found that out by doing:

$ fink list mysql

and there were little “i”‘s coming up for me next to various mysql packages. The problem was that mysql wouldn’t fire up, I would get complaints about sockets. Specifically, mysql was cryptically complaining about the nonexistence of a socket (file) called mysql.sock in /tmp. My machine had been up running for 11 days, and I thought that maybe the socket file had been erased by a cron job or something. After messing with putting the socket somewhere else by creating a my.cnf file in /sw/etc I abandoned that route and decided to just let the mysql server just start fresh: I rebooted my machine. Bingo, the socket was back. That was good enough for me.

Remember when you start working with mysql, you need to access it with a client through a specific user that has a password. That could be the root (mysql) user or the mysql user. To verify that things are working as they should, try:

$ mysql --user=root -p

Sorry I don’t have more advice about installing mysql at this time… it was too long ago, before I had a blog to tell about it!

turn on php in apache
Remember that every time you break in a new machine you need to reconfigure the web server, apache, which is clamped down for security pretty strongly by default. You’ll need to turn on php support in apache to get davidardellorg_wordpress to work. Configuration files for apache are not migrated by Migration Assistant. Now we are dealing with apache2 and the file you are looking for is still called httpd.conf but no longer lives in /etc/httpd. Hm. Oh! It lives in /etc/apache2 now!

Open httpd.conf in your favorite text editor (I use jed) and decomment the line that starts LoadModule php5_module by deleting the # at the beginning of the line. You can find this line by searching for “php”.

Now open System Preferences and in the Sharing pane, turn off “Web Sharing” and then turn it on again.

phpmyadmin
You’re almost ready to roll. I had a “phpmyadmin” installation on my system already which I installed through fink. This is a handy client interface to mysql, and you can use it to create the database that davidardellorg_wordpress will use. To get this to work on your system, unpack the phpmyadmin installation package either directly into your WebServer Document directory at /Library/WebServer/Documents or

$ fink install phpmyadmin

and then

$ cd /Library/WebServer/Documents
$ ln -s /sw/share/phpmyadmin .

If you fixed the socket problem and verified that you could access the server with some mysql username and password, and you’ve turned on php support, you should be able to login to mysql through your webbrowser by pointing it to:

http://localhost/phpmyadmin

From within phpmyadmin, you can start the first steps of the davidardellorg_wordpress install, which involves creating a davidardellorg_wordpress-specific user and database in mysql. The following is basically well-explained in the davidardellorg_wordpress installation instructions at the Codex except the importance of adding “localhost” as the host for the davidardellorg_wordpress user.

  1. I used phpmyadmin to create a new database called “davidardellorg_wordpress”, by clicking on “Databases” using “Collation” in the pulldown menu, and “Go”.
  2. Then I added a new user by clicking on the “Home” icon, and clicking on “Privileges”, then “Add a new user”. I used User Name “davidardellorg_wordpress” and under host (important) I put “localhost” and chose a password. Hit “Go” to create the user.
  3. Then I granted privileges to my davidardellorg_wordpress user by going back to “Priveleges” under “Home” and clicking on the little “write” icon to the right of the new davidardellorg_wordpress user. Go down to “Database specific privileges”, select the davidardellorg_wordpress database, “Check All” to grant all priveleges, and then “Go”

Back out in the shell, you should now be able to login to mysql with the new user and to the new database by doing:

$ mysql --user=davidardellorg_wordpress -p davidardellorg_wordpress

Install davidardellorg_wordpress
I installed davidardellorg_wordpress directly inside /Library/WebServer/Documents. The only thing I had to figure out to get davidardellorg_wordpress to work was adding the socket name to the host in wp-config.php:

define('DB_HOST', 'localhost:/tmp/mysql.sock');

Follow the davidardellorg_wordpress installation instructions for the other parts, as they are minor. I only needed to define DB_NAME, DB_USER and DB_PASSWORD, and of course you have to create this wp-config.php by copying it from the sample file with a similar name first before you do these steps.

If all has proceeded well, you should be able to access your new working davidardellorg_wordpress installation script by pointing your browser to:

http://localhost/davidardellorg_wordpress/wp-admin/install.php

Leave a Reply

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>