Skip to content

Instantly share code, notes, and snippets.

@voxpelli
Forked from hugowetterberg/brew_mamp.markdown
Created June 28, 2010 21:37
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save voxpelli/456391 to your computer and use it in GitHub Desktop.
Save voxpelli/456391 to your computer and use it in GitHub Desktop.
For Brew driven MAMP with Apache2, PHP 5.3 and MySQL 5.1

For Brew driven MAMP with Apache2, PHP 5.3 and MySQL 5.1

If you've MacPorts install - you probably should move it to avoid any unintentional conflicts.

Install brew (assuming that you have Xcode installed).

$ ruby -e "$(curl -fsS http://gist.github.com/raw/323731/install_homebrew.rb)"

Install git and bash completion. (Perhaps by first following gem instructions at http://wiki.github.com/mxcl/homebrew/gems-eggs-and-perl-modules)

$ brew install git
$ brew install bash-completion

Get the Good Old bin package and add it to your profile:

$ mkdir ~/bin
$ cd ~/bin
$ git clone http://github.com/goodold/goodold-bin.git
$ echo "source \$HOME/bin/goodold-bin/goodold_profile" >> .bash_profile

...or, if you already have it, run a update:

$ goodold-selfupdate

Start a new shell or reload your profile to get the correct paths:

$ source .bash_profile

Turn your homebrew dir into a git working directory:

$ brew update

Install mysql and follow the instructions:

$ brew install mysql

Open the apache config:

$ mate /etc/apache2/httpd.conf

...and add the following:

# get the server name from the Host: header
UseCanonicalName Off

# include the server name in the filenames used to satisfy requests
VirtualDocumentRoot /Users/pelle/Sites/%-2.0/public_html
<Directory "/Users/pelle/Sites">
  AllowOverride All
  Order allow,deny
  Allow from all
</Directory>

...uncomment the following

LoadModule php5_module        libexec/apache2/libphp5.so

...perhaps change the user Apache is running as to yours by changing

User _www

...into

User pelle

...and restart.

$ sudo apachectl graceful

Now you should have a working MAMP stack. Just add a "domain" directory to ~/Projects with a public_html dir inside and add the domain domain.local to /etc/hosts and it will be available as a local site.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment