defaults write com.apple.finder AppleShowAllFiles YES
defaults write com.google.Chrome.plist AppleEnableSwipeNavigateWithScrolls -bool FALSE
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install git
brew install mariadb
brew install homebrew/php/composer
brew install npm
brew install yarn
brew install mcrypt
sudo apachectl stop
sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist 2>/dev/null
brew install -v httpd --with-brewed-openssl --with-mpm-event --with-apache --with-included-apr --with-privileged-ports --with-http2
cd /usr/local/etc/apache2/2.4 openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout server.key -out server.crt
brew install php56 --with-httpd --build-from-source --with-thread-safety
Update php ini
php -i | grep ini
vim /usr/local/etc/php/5.6/php.ini
-> update memory_limit - 256
memory_limit = 256M
date.timezone = Pacific/Auckland
brew install php56-xdebug brew install xdebug-osx
https://getgrav.org/blog/macos-sierra-apache-multiple-php-versions https://getgrav.org/blog/macos-sierra-apache-mysql-vhost-apc
echo " xdebug.remote_enable=true xdebug.idekey=PHPSTORMCONSOLE" >> /usr/local/etc/php/5.6/conf.d/ext-xdebug.ini
open -e /usr/local/etc/apache2/2.4/httpd.conf
add php56
LoadModule php5_module /usr/local/Cellar/php56/<your php location>/libexec/apache2/libphp5.so
uncomment proxy_module rewrite_module ssl_module expires_module
error log: "/usr/local/var/log/apache2/error_log"
change LogLevel warn
to LogLevel debug
and reference httpd conf in your sites for reference
ln -s /usr/local/etc/apache2/2.4/httpd.conf ~/Sites/httpd.conf
add your DocumentRoot
<Directory "/Users/simongow/Sites/">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.4/mod/core.html#options
# for more information.
#
Options FollowSymLinks Multiviews
MultiviewsMatch Any
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# AllowOverride FileInfo AuthConfig Limit
#
AllowOverride All
#
# Controls who can get stuff from this server.
#
Require all granted
RewriteEngine On
RewriteBase /
SetEnv BaseUrl '/'
# Store the current location in an environment variable CWD
RewriteCond $0#%{REQUEST_URI} ([^#]*)#(.*)\1$
RewriteRule ^.*$ - [E=CWD:%2]
# Just by prefixing the environment variable, we can safely rewrite anything now
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^.*$ %{ENV:CWD}framework/main.php [QSA,L]
SetEnvIf REQUEST_URI (^/?[a-z]+) BaseUrl=$1
SetEnv SS_ENVIRONMENT_FILE '../_ss_environment.php'
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond $0#%{REQUEST_URI} ([^#]*)#(.*)\1$
RewriteRule ^.*$ %2framework/main.php?url=%1 [QSA]
</Directory>
brew install dnsmasq mkdir -pv $(brew --prefix)/etc/ Add to resolvers
sudo mkdir -v /etc/resolver
sudo bash -c 'echo "nameserver 127.0.0.1" > /etc/resolver/dev'
System Preferences > Network > Wi-Fi (or whatever you use) > Advanced... > DNS > add 127.0.0.1 to top of the list.
sudo brew services restart dnsmasq
test Dnsmasq by sending it a DNS query using the dig utility. Pick a name ending in dev and use dig to query your new DNS server:
dig testing.testing.one.two.three.dev @127.0.0.1
https://docs.docker.com/docker-for-mac/install/#download-docker-for-mac
Create docker config:
- touch ~/Sites/docker.yml
- mysql dir: /usr/local/var/mysql
version: '3'
services:
web:
image: brettt89/silverstripe-web
working_dir: /Users/<your_home_dir>/Sites
volumes:
- .:/Users/<your_home_dir>/Sites
environment:
- VIRTUAL_HOST=project1.dev
database:
image: mysql
volumes:
- db-data:<your_mysql_data_dir>
restart: always
environment:
- MYSQL_ALLOW_EMPTY_PASSWORD=true
volumes:
db-data:
networks:
default:
external:
name: my-network
ln -s /Applications/Docker.app/Contents/Resources/etc/docker.bash-completion /usr/local/etc/bash_completion.d/docker ln -s /Applications/Docker.app/Contents/Resources/etc/docker-machine.bash-completion /usr/local/etc/bash_completion.d/docker-machine ln -s /Applications/Docker.app/Contents/Resources/etc/docker-compose.bash-completion /usr/local/etc/bash_completion.d/docker-compose
docker-compose exec web /bin/bash
$ docker network create my-network This will act as a global network for each of your projects to run in simultaniously
$ docker run -d -p 80:80 -v /var/run/docker.sock:/tmp/docker.sock:ro --net my-network --name nginx-proxy brettt89/nginx-proxy Nginx proxy will act as a gateway for all the project environments. For best results it is recommended to use a shared root domain for each project. E.g. dev
docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' nginx-proxy | awk '{print "address=/.dev/"$1}' > $(brew --prefix)/etc/dnsmasq.conf
preferences -> keyboard -> app shortcuts -> + -> "Zoom All" -> "option command `"
brew install nvm
docker --version docker-machine --version docker-compose --version
brew install zlib brew install --build-from-source siege
# sysctl net.inet.tcp.msl
net.inet.tcp.msl: 15000
# sudo sysctl -w net.inet.tcp.msl=1000
net.inet.tcp.msl: 15000 -> 1000
brew install libev
curl https://bootstrap.pypa.io/get-pip.py > /var/tmp/get-pip.py
sudo python /var/tmp/get-pip.py
sudo easy_install locustio
brew install bash-completion
$ brew install bash-completion
$ brew tap homebrew/completions
add to .bash_profile:
. $(brew --prefix)/etc/bash_completion
fi```
# install sspak
https://silverstripe.github.io/sspak/
# install JDK (urgh)
http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html