How to install Apache into a custom directory?

Solution 1:

homebrew

Consider using homebrew to manage a private, isolated, installation of Apache httpd on your Mac.

To install brew and Apache httpd on your Mac, follow the steps on homebrew; the two main steps are:

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"

This will install the brew command line tool.

Next use jabberwik's tap to install httpd:

brew tap jabberwik/homebrew-httpd
brew install httpd24

MAMP

An alternative approach is to use a pre-packaged application, such as MAMP. Running MAMP will immediately provide Apache httpd, PHP and MySQL preconfigured and ready to use.