TomatoCheese Blog

Migrating MySQL 5.0.45 to Mac OS X 10.5 Leopard

Posted by Joannou Ng on 2007.11.01 GMT at 18:59

If you Archive and Installed Leopard, and installed MySQL 5.0.45 on your previous OS X using the official MySQL package, then the following will migrate your MySQL to Leopard.

Copy your MySQL over:
sudo cp -pR /Previous\ Systems.localized/datetime_you_installed_leopard/usr/local/mysql-5.0.45-osxyour_previous_os_x_version-your_architecture /usr/local/mysql-5.0.45-osxyour_previous_os_x_version-your_architecture

Copy your MySQL symlink over too:
sudo cp -pR /Previous\ Systems.localized/datetime_you_installed_leopard/usr/local/mysql /usr/local/mysql

Remove the MySQL startup item (we’ll use the preferred launchd instead):
sudo rm -R /Library/StartupItems/MYSQLCOM

Also, right-click and remove the MySQL preference pane in System Preferences because we’ll be using the preferred launchd instead.

Copy this MySQL launchd configuration file to /Library/LaunchDaemons, and change its owner to root:
sudo chown root /Library/LaunchDaemons/com.mysql.mysqld.plist

Change your MySQL owner to mysql:
sudo chown -R mysql /usr/local/mysql-5.0.45-osxyour_previous_os_x_version-your_architecture /usr/local/mysql

Load the MySQL launchd configuration file:
sudo launchctl load /Library/LaunchDaemons/com.mysql.mysqld.plist

Got MySQL?

Installing Apache 2.2.4 with PHP 5.2.2 on Mac OS X 10.4.10

Posted by Joannou Ng on 2007.07.16 GMT at 02:05

Install Apache

Download and install Xcode Tools 2.4.1:
http://connect.apple.com/

Download and unarchive Apache 2.2.4:
http://httpd.apache.org/download.cgi

cd httpd-2.2.4

Configure Apache for Mac OS X, with all modules built as Dynamic Shared Objects, and use the bundled Apache Portable Runtime at build time:
./configure --enable-mods-shared=all --with-included-apr

Build Apache Universal Binaries (to integrate with Marc Liyanage’s PHP module):
CFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch ppc -arch i386" LDFLAGS="-Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk -arch ppc -arch i386" make

Install Apache:
sudo make install

Configure Apache (Optional)

Edit the DocumentRoot and the corresponding Directory (in the Apache configuration file: /usr/local/apache2/conf/httpd.conf) to a friendlier folder:
DocumentRoot "/Users/your_os_x_short_name/Sites"
<Directory "/Users/your_os_x_short_name/Sites">

Test Apache

Stop Personal Web Sharing (if started)

Start Apache:
sudo /usr/local/apache2/bin/httpd -k start

Does it work?
http://0.0.0.0/

Install PHP

Download, unarchive, and install Marc Liyanage’s PHP 5.2.2 for Apache 2:
http://www.entropy.ch/software/macosx/php/

Ignore the “There were errors installing the software” message in Installer. That is because the PHP package’s postflight script failed to load the new PHP module into the old Apache by running the default apachectl.

Add the following line to the end of the new Apache configuration file, to load the new PHP module:
Include /usr/local/php5/entropy-php.conf

Test PHP

Restart Apache:
sudo /usr/local/apache2/bin/httpd -k restart

Create a phpinfo.php file in your Sites folder, with the following line:
<?php phpinfo() ?>

Got PHP?
http://0.0.0.0/phpinfo.php