sudo mkdir /usr/local
sudo chown -R `whoami` /usr/local
curl -L http://github.com/mxcl/homebrew/tarball/master | tar xz --strip 1 -C /usr/local
brew install git
cd /usr/local
git init
git remote add origin git://github.com/mxcl/homebrew.git
git pull origin master
brew install mysql
Run the mysql setup script that configures your root password. mysql_install_db mysql_secure_installation Change the root password? [Y/n] y Remove anonymous users? [Y/n] y Disallow root login remotely? [Y/n] y Remove test database and access to it? [Y/n] y Reload privilege tables now? [Y/n] y
If you have a dump file of previous databases you can install them this way.
mysql -u root -p mysql < /path/to/mysql-dump-file-all-databases.sql
Install PIP for easy python package installation
sudo easy_install pip
Install MySQL-python
pip install http://downloads.sourceforge.net/project/mysql-python/mysql-python-test/1.2.3c1/MySQL-python-1.2.3c1.tar.gz?use_mirror=cdnetworks-us-2
Install virtualenv so you can setup virtual python environments easily for each of your django projects.
pip install virtualenv
Install nginx using homebrew.
brew install nginx
Backup the origional nginx config file.
cd /usr/local/etc/nginx
cp nginx.conf nginx.conf.orig
Replace /usr/local/etc/nginx/nginx.conf
with the following.
#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
#access_log logs/access.log main;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
#gzip on;
include /Users/oconnor/Sites/configs/nginx/sites-enabled/*;
}
Restart nginx
sudo nginx -s reload
Append the following to /private/etc/apache2/httpd.conf
# Include Virtual Hosts
NameVirtualHost *:8080
Include /Users/oconnor/Sites/configs/apache/sites-enabled/
Changed the port apache listens on to 8080. Find the line Listen 80
in the httpd.conf
file and change the line to Listen 8080
Install php5 for the native OSX apache2 install. Got the follow steps from a tutorial I found doing a google search.
$ cd /usr/local/
$ git remote add boztek git://github.com/boztek/homebrew.git && git fetch boztek
$ git checkout boztek/php52 && git checkout -b working
$ git pull --rebase origin master
$ brew install php52 --with-mysql --with-apache
$ cd /usr/libexec/apache2
$ sudo mv libphp5.so libphp5.so.orig
$ sudo ln -s /usr/local/Cellar/php52/5.2.12/libexec/apache2/libphp5.so
Uncomment the following line in your httpd.conf
# LoadModule php5_module libexec/apache2/libphp5.so
Restart Apache
$ sudo apachectl restart
-
Download phpMyAdmin from http://www.phpmyadmin.net.
-
Extract the tar gzipped file into the
/Users/oconnor/Sites/phpmyadmin
directory. -
Add the following to your sites-available directory and then symlink the file in your sites-enabled directory.
Alias /phpmyadmin /Users/oconnor/Sites/phpmyadmin
<Directory /Users/oconnor/Sites/phpmyadmin> Options FollowSymLinks DirectoryIndex index.php
<IfModule mod_php5.c> AddType application/x-httpd-php .php php_flag magic_quotes_gpc Off php_flag track_vars On php_flag register_globals Off php_value include_path . </IfModule>
<Directory /Users/oconnor/Sites/phpmyadmin/setup> AuthType Basic AuthName "phpMyAdmin Setup" AuthUserFile /etc/phpmyadmin/htpasswd.setup Require valid-user
<Directory /Users/oconnor/Sites/phpmyadmin/libraries> Order Deny,Allow Deny from All <Directory /Users/oconnor/Sites/phpmyadmin/setup/lib> Order Deny,Allow Deny from All
-
Import
phpmyadmin/scripts/create_tables.sql
into your MySQL database. -
Copy
phpmyadmin/config.sample.inc.php
tophpmyadmin/config.inc.php
-
Edit
config.inc.php
and add a 20 character string for the$cfg['blowfish_secret']
variable and uncomment all the variables under the/* Advanced phpMyAdmin features */
comment line. -
Restart apache,
sudo apachectl restart
-
Load up phpMyAdmin in your browser http://localhost/phpmyadmin
Nice, just one correction: In the Apache Installation Part, the 'Listen' port should be 8080.