Apache

Configuration

DocumentRoot "/Users/Shared/WebServer/Documents"

Service

$ sudo apachectl start
$ sudo apachectl stop
$ sudo apachectl restart

Autoload

$ sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist
$ sudo launchctl load -w /System/Library/LaunchDaemons/org.apache.httpd.plist

PHP

Configuration

$ sudo nano /etc/apache2/httpd.conf
LoadModule php5_module libexec/apache2/libphp5.so

Create php.ini:

$ sudo cp /etc/php.ini.default /etc/php.ini
$ sudo vi /etc/php.ini

MySQL

http://dev.mysql.com/downloads/mysql/

Service:

$ sudo /usr/local/mysql/support-files/mysql.server start
$ sudo /usr/local/mysql/support-files/mysql.server stop
$ sudo /usr/local/mysql/support-files/mysql.server restart
$ sudo /Library/StartupItems/MySQLCOM/MySQLCOM start
$ sudo /Library/StartupItems/MySQLCOM/MySQLCOM stop

Environment variables

$ cd ; vi .bash_profile
$ export PATH="/usr/local/mysql/bin:$PATH"
$ source ~/.bash_profile

Change user password

$ sudo /usr/local/mysql/bin/mysqladmin -u root password "PASSWORD"

Runtime

my.cnf

pid-file=/var/run/mysqld/mysqld.pid
$ sudo mkdir /var/run/mysqld
$ sudo touch /var/run/mysqld/mysqld.pid
$ sudo chown -R mysql:mysql /var/run/mysqld

Uninstall

sudo rm /usr/local/mysql
sudo rm -rf /usr/local/mysql*
sudo rm -rf /Library/StartupItems/MySQLCOM
sudo rm -rf /Library/PreferencePanes/My*
sudo rm -rf /Library/Receipts/mysql*
sudo rm -rf /Library/Receipts/MySQL*
sudo rm /etc/my.cnf
sudo rm -rf /var/db/receipts/com.mysql.*