Making own AMP stack with Homebrew on a Mac
-
Upload
rkalnins -
Category
Technology
-
view
406 -
download
0
Transcript of Making own AMP stack with Homebrew on a Mac
Making own AMP stack with Homebrew on a
Mac
Raimonds Kalniņš Wunderkraut Latvia
AMP?
- Historically a bundle of Apache, Mysql and PHP
- Today refers to various combos of web server components
- LAMP: Linux + AMP
- There are number of options to set up AMP on a Mac
- But there is also lack of - choice / customisation - performance
What is the problem?
Options to set up AMP
- Built-in Apache and PHP - AMP software bundles (MAMP, XAMPP) - Virtualisation software - Package manager (Homebrew)
Built-in Apache and PHP
- Good - It’s there already on the system - Only DB server needs to be added
- Bad - Hardly customisable - Can’t do without sudoing - Can’t start fresh if things go wrong
Built-in Apache and PHP
You don’t want to sing this song at the end of the day if built-in binaries/config files become corrupted.
AMP software bundles
- Good - Easy to set up - Easy to reinstall / remove
- Bad - Partly customisable - Lots of (usually) unwanted stuff
Virtualisation software
- Good - Fully customisable - Easy to reinstall / remove
- Bad - Performance overhead
Package manager
- Good - Fully customisable - Easy to reinstall / remove - Full speed
- Bad - Outdated packages - Package manager prone to major
internal changes
Homebrew lingo
Formula A package definition file
Tap A repository of Formulae
More information can be found on Homebrew project website.
Homebrew requirements
- OS X 10.6 (10.7 is recommended) - Intel CPU is recommended - Command line tools for Xcode*
* Install with xcode-select --install
The Plan - HAMP
- Install Homebrew - Install Apache 2.4 - Install MariaDB 10 - Install PHP 5.6 - Install Drush 7
HAMP requirements
Before setting up HAMP, these taps need to be added: - brew tap homebrew/apache - brew tap homebrew/homebrew-php
Installing the software
Run - brew install http24 - brew install mariadb - brew install php56 - brew install drush
Configure the software
Make changes to httpd.conf: - ServerName localhost:8080 - AllowOverride All - LoadModule php5_module [..]/libphp5.so - LoadModule rewrite_module [..]/
mod_rewrite.so - DirectoryIndex index.php - AddType application/x-httpd-php .php
Secure MariaDB: - mysql_secure_installation
Demo