Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
This documents outlines the initial steps I take to setup my OSX based system for web development. This setup should provide the underlying systems needed to be able to develop using docker. This setup should work for frameworks like Laravel, Angular, Vue, etc...

Setup OSX Dev Environment

This documents outlines the initial steps I take to setup my OSX based system for web development. This setup should provide the underlying systems needed to be able to develop OSX. This setup should work for platforms like Laravel, Angular, Vue, MediaWiki, etc...

Homebrew Setup

Install xcode
xcode-select --install
Install homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Essential Homebrew packages

Bash

Install Bash
brew install bash
Set new Bash as default shell
sudo su
echo /usr/local/bin/bash >> /etc/shells
exit
chsh -s /usr/local/bin/bash

Restart terminal to switch to the new batch and verify that you are on version ^4.*.*

bash --verison

VIM

Install Vim
brew install vim

Bash Completion

Install bash completion
brew install bash-completion
Add the following lines to your ~/.bash_profile:
[ -f /usr/local/etc/bash_completion ] && . /usr/local/etc/bash_completion

Git

Install Git
brew install git
Configure git
git config --global color.ui true
git config --global user.name "Your Name"
git config --global user.email "youremail@mail.com"
Create ssh key
ssh-keygen -t rsa -C "samrhilson@gmail.com"
Add public keys to Github ect..
pbcopy <~/.ssh/id_rsa.pub

PHP

Install php 7
brew install php
brew install php@7.1
Add php as service
sudo brew services start php71
Force OSX to use php 7.1
vi ~/.bash_profile

Add the following:

# Load php 7.1
export PATH="/usr/local/opt/php@7.1/bin:$PATH"
export PATH="/usr/local/opt/php@7.1/sbin:$PATH"

Additional php utilties

brew install pcre
brew install composer
brew install php-code-sniffer

(note: you will need to install or build additional php extension depending on your project. Ex: memcached, redis, mcrypt, etc.)

NGINX

Install nginx
brew install nginx
Add nginx as service as sudo for port 80 or 443 access
sudo brew service start nginx

Node

Install nvm
brew install nvm
Create nvm working dir
mkdir ~/.nvm
Add the following to ~/.bash_profile
export NVM_DIR="$HOME/.nvm"
  . "/usr/local/opt/nvm/nvm.sh"
Install the latest node and npm
nvm install node

Dns Masq

install dnsmasq
brew install dnsmasq
Configure dns
mkdir -p /usr/local/etc/
echo "address=/.gamepedia.local/127.0.0.1" >> /usr/local/etc/dnsmasq.conf
sudo mkdir -p /etc/resolver
sudo sh -c 'echo "nameserver 127.0.0.1" > /etc/resolver/gamepedia.local'
Start dns service
sudo brew services start dnsmasq

Test dnsmasq setup

Run scutil to check resolver
scutil --dns

Should see a resolver for app

...
resolver #8
  domain   : gamepedia.local
  nameserver[0] : 127.0.0.1
  flags    : Request A records, Request AAAA records
  reach    : Reachable, Local Address, Directly Reachable Address
Ping and .app domain
ping -c 1 test.gamepedia.local

Should see a successful ping

PING test.app (127.0.0.1): 56 data bytes
64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.033 ms
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment