Skip to content

Instantly share code, notes, and snippets.

@pitpit
Last active February 16, 2018 05:33
Show Gist options
  • Save pitpit/3c0d465958917e1428f4 to your computer and use it in GitHub Desktop.
Save pitpit/3c0d465958917e1428f4 to your computer and use it in GitHub Desktop.
Install XSendFile on OSX 10.8.* or 10.10.*

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment