Download and unpack module:
cd /tmp
wget https://github.com/nmaier/mod_xsendfile/archive/0.12.tar.gz
tar -xzvf 0.12.tar.gz
Fix apxs:
cd /Applications/Xcode.app/Contents/Developer/Toolchains/
sudo ln -s XcodeDefault.xctoolchain/ OSX10.8.xctoolchain
Replace
10.8
by the current version of OSX, for instance :OSX10.10.xctoolchain
for Yosemite users
Compile the module:
sudo apxs -cia -Wc,"-arch i386 -arch x86_64" -Wl,"-arch i386 -arch x86_64" /tmp/mod_xsendfile-0.12/mod_xsendfile.c
if you got an error like
mod_xsendfile.c:38:10: fatal error: 'apr.h' file not found
, try to run:
xcode-select --install
sudo xcodebuild -license
Restart apache:
sudo apachectl restart