ZebraTools Definitions Setup
Setting up an Apache/PHP/MySQL webserver on Mac OS X
(written for version 10.3.4 standard install)
Step One: Enable the root user:
Open the application /Applications/Utilities/NetInfo Manager
From the Security menu, select "Enable Root User". Give it a password
that you will remember. (Be especially careful if this computer is directly
connected to the internet.
Quit NetInfo Manager.
Step two, configure Apache Web server to load the PHP module.
open the file /etc/httpd/httpd.conf
If you have BBEdit and the BBEdit UNIX tool installed, you can do this from
the terminal with the command
bbedit
/etc/httpd/httpd.conf
Otherwise, use the PICO text editor:
sudo
pico /etc/httpd/httpd.conf
This will ask you for the root
user's password. Enter it now.
On line 239 of httpd.conf is the command:
#LoadModule php4_module libexec/httpd/libphp4.so
The "#" symbol causes Apache to ignore this line. Remove the "#" symbol
On lline 282 is the command:
#AddModule mod_php4.c
Remove the "#" symbol from this line as well.
Save the file: In BBEdit, command-S, and enter the root user password.
In Pico, control-o, enter to save to the same name, then control-x to exit.
Step Three: Launch Apache.
Open the System preferences. Under sharing, turn on Personal Web
sharing. If it is on already, turn it on and off to force it to reload with
the PHP module.
The default location for the webserver files is in /Library/WebServer/Documents/
Step Four: Test So Far.
To test that php and apache are installled correctly, create a file
/Library/WebServer/Documents/info.php
This file will contain only:
<?php phpinfo(); ?>
In a browser, go to the address http://127.0.0.1/info.php
If all is well, this will bring up a table telling you everything you need
to know about your install of php.
Step Five: Installing MySQL.
Get the latest recommended installers from http://dev.mysql.com/downloads/ that
are not beta. You want the Standard Install for Mac OS X.
Install MySQL and the MySQL startup package. This will configure your machine
to automatically launch MySQL each time you restart.
Restart you machine, so that MySQL starts up.
Step Six: Assign a password to the MySQL user "root".
In terminal, type the command:
/usr/local/mysql/bin/mysqladmin
-u root password sniggle
Replacing "sniggle" with the password you want. Again, remember
this password, as it is very important to you, and resetting it is not easy.
Step Seven: Installing phpMyAdmin.
To make managing mySQL easier, I recommend installing phpMyAdmin
from www.phpmyadmin.net. Once it is
downloaded and unzipped, put it in your Webserver Documents folder, and rename
the folder to just "phpmyadmin". Open the folder and edit the config.inc.php
file. You will need to alter the following lines:
Line 39:
$cfg['PmaAbsoluteUrl'] = 'http://127.0.0.1/phpmyadmin/';
If you are only working on a single machine, using 127.0.0.1
is fine. I use this since I am working on a powerbook that is often not connected
to a network. If you are using a machine on a LAN, then replace 127.0.0.1 with
that machines IP address. (I would recommend disabling DCHP on that machine,
and configuring TCP/IP manualy, so that the IP address does not change for
you.)
Lines 83 and 84:
$cfg['Servers'][$i]['user']
= 'root'; // MySQL user
$cfg['Servers'][$i]['password'] = 'sniggle'; // MySQL password (only needed
Now, to test phpMyAdmin, point your browser to http://127.0.0.1/phpMyAdmin/ (again,
you may need to substitute the actual IP address)
Step Eight: Setting up the ZebraDefs User.
While we are in phpMyAdmin, click on the Privileges link in the middle of the
page. Here, you want to add a user "ZebreDefs" on Host "localhost" with
password "SpottyZebra". This user only needs to have Select, Insert
and Update privileges.
Step Nine: Importing the Definitions Tables.
Now, let's import the existing ZebraTools Def database into mySQL.
You will need to do this in the Terminal. In order to let the Terminal know
where to find the MySQL commands, you may need to add the following line to
your ~/.tcshrc file (or equivelant file, if you are using something other
than a tcsh shell):
setenv PATH "$PATH":/usr/local/mysql/bin
Now, to log in to MySQL in the Terminal type the following command:
mysql -u root -psniggle
Where sniggle is the password you defined for the root user.
mysql> create database definitions;
mysql> use definitions;
mysql> source ~/Desktop/ZebraDefs/Definitions.sql;
if you want to start with our existing database, or
mysql> source ~/Desktop/ZebraDefs/DefinitionsEmpty.sql;
if you want to start with an empty definitions database.
mysql> exit;
Now, you just need to copy the ZebraToolsScripts folder to somewhere on you
webserver, and specify the url within your iShell project file