I wanted to install the Apache-Module X-Sendfile as shown in http://elivz.com/blog/single/mod_xsendfile/ on my Mac OS X 10.9 (Mavericks) setup.

After downloading and unpacking the files, I've used the command sudo apxs -cia mod_xsendfile.c to run the install.

After fixing the Error "Not a directory" by creating a symlink (shown in this answer), a new problem occured :

lduer:mod_xsendfile-0.12 lduer$ sudo apxs -cia mod_xsendfile.c
/usr/share/apr-1/build-1/libtool --silent --mode=compile /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.9.xctoolchain/usr/bin/cc    -DDARWIN -DSIGPROCMASK_SETS_THREAD_MASK -I/usr/local/include -I/usr/include/apache2  -I/usr/include/apr-1   -I/usr/include/apr-1   -c -o mod_xsendfile.lo mod_xsendfile.c && touch mod_xsendfile.slo
env: /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.9.xctoolchain/usr/bin/cc: Not a directory
apxs:Error: Command failed with rc=65536

I haven't found any solutions by searching the web with the error code.

Edit 2013-12-13: I want to mention that the requested Path where the Error Not a directory occured (env: /Applications/[...]/bin/cc)is a symlink, linking to the file "clang" in the same directory. Maybe this helps to answer the question.

  • At the risk of 'Me too' did you figure this out? Having the same problem with Mavericks server.
    – glenstorey
    Commented Dec 11, 2013 at 8:37
  • I haven't found a solution yet. I've edited the question and added some additional informations - maybe someone can help??
    – lduer
    Commented Dec 13, 2013 at 7:48

2 Answers 2


Here's how I installed the module:

  1. Download source code from [mod_xsendfile github repository)[https://github.com/nmaier/mod_xsendfile/releases]
  2. Install a newer Apache via homebrew, i.e. brew install httpd (note: it will not remove or damage your current, Apple-provided apache install)
  3. Go to sbin in apache dir, i.e. /usr/local/Cellar/httpd/2.2.23/sbin
  4. Compile the module (as fat-module variant):

    ./apxs -cia -Wc,"-arch i386 -arch x86_64" -Wl,"-arch i386 -arch x86_64" /path/to/mod_xsendfile.c
  5. Restart apache.

  • 1
    Yes, the "secret" here is to give up trying to modify the Apple installed Apache and put your own in place. It is then much easier to get extras working. Always my first advice. Commented Jan 23, 2014 at 14:10
  1. create your own apxs script: https://gist.github.com/dnozay/a08d4ee903af37832174 this will fix the CC path that is hardcoded in the apxs and libtool script.
  2. run sudo ./apxs -cia mod_xsendfile.c

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .