Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I wanted to install the Apache-Module X-Sendfile as shown in 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/    -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/ 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.

share|improve this question
At the risk of 'Me too' did you figure this out? Having the same problem with Mavericks server. – glenstorey Dec 11 '13 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 Dec 13 '13 at 7:48

Here's how I installed the module:

  1. Download source code from [mod_xsendfile github repository)[]
  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.

share|improve this answer
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. – Tony Williams Jan 23 '14 at 14:10
  1. create your own apxs script: this will fix the CC path that is hardcoded in the apxs and libtool script.
  2. run sudo ./apxs -cia mod_xsendfile.c
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.