homebrew-apache 0

:globe_with_meridians: Apache formulae for the Homebrew package manager

Homebrew Apache

How do I install these formulae?

brew install homebrew/apache/<formula>

Or brew tap homebrew/apache and then brew install <formula>.

Or install via URL (which will not receive updates):

brew install https://raw.githubusercontent.com/Homebrew/homebrew-apache/master/<formula>.rb


brew help, man brew or check Homebrew’s documentation.


After installing httpd22 or httpd24, the configuration files will be in $(brew --prefix)/etc/apache2/2.2 and $(brew --prefix)/etc/apache2/2.4, respectively.


A common problem with OS X 10.8 Mountain Lion and higher is an error about a missing OSX10.8.xctoolchain, OSX10.9.xctoolchain, or OSX10.10.xctoolchain directory:

/Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.10.xctoolchain/usr/bin/cc: No such file or directory

This is because the OS X tool apr-1-config returns a path for a compiler that does not exist, even with Xcode installed:

$ apr-1-config --cc
$ apr-1-config --cpp
/Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.8.xctoolchain/usr/bin/cc -E
$ which apr-1-config

The simplest solution is to go to the /Applications/Xcode.app/Contents/Developer/Toolchains/ directory and create a symlink named OSX10.8.xctoolchain, OSX10.9.xctoolchain, or OSX10.10.xctoolchain to XcodeDefault.xctoolchain. This requires you to have Xcode installed. If you only have the Xcode Command Line tools or OSX-GCC-Installer, a simple symlink will not work.

This single-line command will set up the symlink if you have Xcode installed, and if you don’t, it will create directories leading up to the toolchain and a symlink to /usr/bin that will satisfy the requirements needed for apr-1-config to find the compiler it needs:

sw_vers -productVersion | grep -E '^10\.([89]|10)' >/dev/null && bash -c "[ -d /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain ] && sudo -u $(ls -ld /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain | awk '{print $3}') bash -c 'ln -vs XcodeDefault.xctoolchain /Applications/Xcode.app/Contents/Developer/Toolchains/OSX$(sw_vers -productVersion).xctoolchain' || sudo bash -c 'mkdir -vp /Applications/Xcode.app/Contents/Developer/Toolchains/OSX$(sw_vers -productVersion).xctoolchain/usr && for i in bin include lib libexec share; do ln -s /usr/${i} /Applications/Xcode.app/Contents/Developer/Toolchains/OSX$(sw_vers -productVersion).xctoolchain/usr/${i}; done'"

Related Repositories



Brew PHP switcher is a simple shell script to switch your apache and CLI quickly between major versions of PHP. If you support multiple products/projects that are built using either brand new or old legacy PHP functionality. For users of Homebrew (or brew ...



:globe_with_meridians: Apache formulae for the Homebrew package manager ...



homebrew + Apache ...



:beer: Homebrew tap for Apache Tomcat supporting advanced configuration including SSL, APR, gzip and more ...



Configuration for Nginx, Apache, PHP and MySQL on MacOS Sierra (installed using Homebrew) ...

Top Contributors

alanthing Noctem bfontaine BrewTestBot javian kabel jacknagel ilovezfs DomT4 MikeMcQuaid joemaller dunn apjanke gandazgul chinthakagodawita gammamatrix adamv jmmitchell jh86 lukasbestle mcs07 madhancock mistydemeo rob rjocoleman rubys HapiCZ aefxx dfdumaresq jacinda