Skip to content

Instantly share code, notes, and snippets.

@gerritwessels
Created September 7, 2012 11:49
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
  • Save gerritwessels/3665511 to your computer and use it in GitHub Desktop.
Save gerritwessels/3665511 to your computer and use it in GitHub Desktop.
Mac OSX Mountain Lion Brew, Nginx, PHP53 + FPM Setup & Configuration
Thanks to:
http://realityloop.com/blog/2012/07/03/nginx-mariadb-php-aegir-mac-os-x-optional-drush-5-works-mountain-lion
and
http://robots.thoughtbot.com/post/27985816073/the-hitchhikers-guide-to-riding-a-mountain-lion
--Fresh install Mountain Lion.
--Install XCode 4.4.2
--Install Command line utilities via Xcode
--Install Homebrew
$ ruby <(curl -fsSk https://raw.github.com/mxcl/homebrew/go)
$ sudo chown -R `whoami` /usr/local
$ brew update
$ brew doctor
--Mountain Lion Fixes for Homebrew
$ sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
--Install X11 (Not included with Mountain Lion)
Visit http://xquartz.macosforge.org/trac/wiki and download and install version 2.7.2+.
$ sudo ln -s /opt/X11 /usr/X11
$ brew list
--Ensure /usr/local/bin occurs before /usr/bin and add /usr/local/sbin is added to your path, If you are using zsh, update .zshrc instead
$ nano ~/.bash_profile
or
$ nano ~/.zshrc
Paste the following into editor then Ctrl+X and Y to save
export PATH=~/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11/bin:/usr/local/git/bin:/opt/local/bin
--If this is not a fresh install remove Apache from startup.
$ sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist
$ brew install nginx
$ brew doctor (to check if all still fine in paradise!)
--Make nginx log files visible in Console app
$ sudo mkdir /var/log/nginx
Create the following directorty to stop “"/var/lib/nginx/speed" failed (2: No such file or directory)” error
$ sudo mkdir /var/lib/nginx
$ brew tap josegonzalez/homebrew-php
$ brew tap homebrew/dupes
$ brew install php53 --with-mysql --with-fpm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment