Solved: Apache won't serve files from external drive on macOS

If you've tried to develop a website and the files are on an external drive, you might find that httpd will refuse to serve the files. In your browser you'll see:

You don't have permission to access this resource.Server unable to read htaccess file, denying access to be safe

And in your Apache error log you'll read:

[core:crit] [pid 45683] (1)Operation not permitted: [client] AH00529: /Volumes/externaldrive/website/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable and that '/Volumes/externaldrive/website/' is executable

The trouble is, you've checked that the directory is readable and it is. Permissions are correct! You might even have messed with the "Ignore ownership on this volume" checkbox but it doesn't fix the problem.

For me, the issue was caused by macOS's builtin Security and Privacy controls. I'm using MacPorts to install my development stack. I have MacPorts set to use launchctl to start my httpd server in /Library/LaunchDaemons/org.macports.apache2.plist. This plist uses the daemondo wrapper to start httpd.

After giving daemondo (and thus its child process, httpd) Full Disk Access, everything was happy.

Solved: Apache SSL virtual host says "\x16\x03\x01"

When setting up a second SSL Apache virtual host, you may be frustrated when your browser can't connect and tells you something like

Safari can't establish a secure connection to the server "servername"

In your ssl_request_log you see baffling entries like this:

"\x16\x03\x01" 240
"\x16\x03" 240

This is because you have forgotten to enable SSL for your virtual host with the following:

SSLEngine on

You'll probably need some other SSL-based directives in there, too.



Subscribe to RSS - Apache