Skip to content

Instantly share code, notes, and snippets.

@khalib
Last active October 3, 2017 09:26
Show Gist options
  • Select an option

  • Save khalib/8292689 to your computer and use it in GitHub Desktop.

Select an option

Save khalib/8292689 to your computer and use it in GitHub Desktop.
MNPP: Mac/Nginx/Percona-MySQL/PHP install via Homebrew
# Install Xcode
xcode-select --install
# Install Homebrew.
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew doctor
brew update
# Install git.
brew install git
# Get some taps.
brew tap josegonzalez/homebrew-php
brew tap homebrew/dupes
# Install Percona MySQL.
brew install percona-server
# Install nginx.
brew install nginx
# Install PHP.
brew install --without-apache --with-fpm --with-mysql php55
brew link autoconf libpng freetype jpeg unixodbc libtool re2c libevent
# Install Memcached.
brew install php55-memcached
/usr/local/Cellar/php55/5.5.25/bin/pecl install memcached
# Update ~/.profile
export PATH="/usr/local/sbin:$PATH"
alias nginx="/usr/local/sbin/nginx"
# Install Solr 3.6
# From http://ramlev.dk/blog/2012/06/02/install-apache-solr-on-your-mac/
brew install solr36
cd /usr/local/Cellar/solr/3.6.2/libexec
cp -r example drupal
cd drupal
cp solr/conf/schema.xml solr/conf/schema.xml.bak
cp solr/conf/solrconfig.xml solr/conf/solrconfig.xml.bak
cp /path/to/drupal/modules/contrib/search_api_solr/solr-conf/3.x/*xml solr/conf/
mkdir solr/graphite
cp -r solr/conf solr/graphite/
mkdir solr/csm
cp -r solr/conf solr/csm/
# Create multicore Solr config file
echo '<?xml version="1.0" encoding="UTF-8" ?>
<solr persistent="false">
<cores adminPath="/admin/cores">
<core name="graphite" instanceDir="graphite" />
<core name="csm" instanceDir="csm" />
</cores>
</solr>' > solr/solr.xml
# Start services
sudo nginx
sudo php-fpm -D
mysql.server start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment