A set of instructions for installing my development stack on OSX (Lion). You may also need root for some of these commands! Run all of these commnds from the root of this repository.
Make sure you have the latest version of XCode, with the command line tools installed. Also be sure the path to the command line tools is in your $PATH
variable.
/usr/bin/ruby -e "$(/usr/bin/curl -fksSL https://raw.github.com/mxcl/homebrew/master/Library/Contributions/install_homebrew.rb)"
brew install git git-flow
### Update homebrew
brew update
git clone git://github.com/tarnfeld/homebrew-alt.git /usr/local/LibraryAlt
### MongoDB
Soon
### Riak
brew install riak\
riak start
brew install mysql \
&& sudo mkdir -p /Library/LaunchAgents \
&& sudo cp LaunchAgents/homebrew.mxcl.mysql.plist /Library/LaunchAgents/ \
&& sudo launchctl load /Library/LaunchAgents/homebrew.mxcl.mysql.plist \
&& sudo mysql_install_db --verbose --user=`whoami` --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql --tmpdir=/tmp
The Homebrew formula does not create a "postgres" user, as was common up to this point. Out of the box, you authenticate against the DB using the same user account under which you ran brew install. It's perfectly acceptable to leave it that way on your Dev machine. Don't forget to change that if this is a Production environment.
brew rm postgresql --force \
&& brew update \
&& brew install postgresql --without-ossp-uuid \
&& initdb /usr/local/var/postgres \
&& cp /usr/local/Cellar/postgresql/9.1.4/homebrew.mxcl.postgresql.plist ~/Library/LaunchAgents/ \
&& launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist \
&& pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
brew install redis \
&& sudo mkdir -p /Library/LaunchAgents \
&& sudo cp LaunchAgents/homebrew.mxcl.redis.plist /Library/LaunchAgents/ \
&& sudo launchctl load /Library/LaunchAgents/homebrew.mxcl.redis.plist
brew install memcached \
&& sudo mkdir -p /Library/LaunchDaemons \
&& sudo cp LaunchDaemons/homebrew.mxcl.memcached.plist /Library/LaunchDaemons/ \
&& sudo launchctl load /Library/LaunchDaemons/homebrew.mxcl.memcached.plist
brew install /usr/local/LibraryAlt/duplicates/php.rb --with-fpm --with-mysql \
&& brew install gearman-php memcached-php mongo-php xdebug-php xcache-php redis-php imagick-php
&& cp Config/php.ini /usr/local/etc/php.ini \
&& cp Config/php-fpm.conf /usr/local/etc/php-fpm.conf \
&& sudo mkdir -p /Library/LaunchDaemons \
&& sudo cp LaunchDaemons/org.php-fpm.plist /Library/LaunchDaemons/ \
&& sudo launchctl load /Library/LaunchDaemons/org.php-fpm.plist
brew tap josegonzalez/php \
&& brew install josegonzalez/php/xdebug-php
Make sure you add the following to your php ini (usually /usr/local/etc/php.ini
)
zend_extension="/usr/local/Cellar/xdebug-php/2.1.3/xdebug.so"
sudo pear config-set auto_discover 1 \
&& sudo pear install pear.phpunit.de/PHPUnit
Make sure you have the following in your path
/usr/local/Cellar/php/5.3.10/bin
### NGINX
brew install nginx \
&& sudo mkdir -p /Library/LaunchDaemons \
&& sudo cp -r Config/nginx /usr/local/etc/nginx \
&& sudo cp LaunchDaemons/homebrew.mxcl.nginx.plist /Library/LaunchDaemons/ \
&& sudo launchctl load /Library/LaunchDaemons/homebrew.mxcl.nginx.plist
Run the following commands to configure apache (the version that comes preinstalled). Don't forget to enable web sharing!
sudo cp Config/apache/includes.conf /etc/apache2/other/ \
&& sudo cp Config/apache/php.conf /etc/apache2/other/ \
&& sudo cp Config/apache/directory.conf /etc/apache2/other/ \
&& sudo cp Config/php.ini /etc/php.ini \
&& sudo apachectl restart
brew install node \
&& curl http://npmjs.org/install.sh | sh
git clone git://github.com/rubygems/rubygems.git /tmp/rubygems \
&& OLD_PATH=`pwd` \
&& cd /tmp/rubygems \
&& sudo ruby setup.rb \
&& cd .. \
&& rm -rf rubygems \
&& cd $OLD_PATH
curl -L get.rvm.io | bash -s stable \
&& source ~/.rvm/scripts/'rvm' \
&& rvm install 1.9.3 \
Make sure you add the following to your bash profile (usually ~/.profile
)
source ~/.rvm/scripts/'rvm'
gem install teleport