DevHeads.net

Apache 2.4 and DirectoryIndex and htaccess

I have a working webroot, and it has an index.php file. In httpd.conf I havre DirectoryIndex for /usr/local/www set to “index.php index.html"

I create a folder under the webroot named foo and I put an index.html file in the folder.

I can access the files directly, but if I access the folder, I get a permission error.

If I created foo/.htaccess with the content “foo goes here” and load the directory or the file, I get a server error (so .htaccess isn’t being ignored by an AllowOverrid none upstream).

If I change the .htaccess to read

DirectoryIndex index.html

I can access the file directly, but I still get a permission error if I access the directory <http://www.example.com/foo/>

“Forbidden You don't have permission to access /renna/ on this server.”

The only thing in the http-error.log is:

[Mon Jun 11 12:26:28.390150 2018] [ssl:info] [pid 34433] [client xx.xx.xx.xx:56493] AH01964: Connection to child 9 established …

Httpd-access.log shows:

xx.xx.xx.xx - - [11/Jun/2018:12:26:28 -0600] "GET /foo/ HTTP/1.1" 403 215 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.79 Safari/537.36"
xx.xx.xx.xx - - [11/Jun/2018:12:26:28 -0600] "GET /favicon.ico HTTP/1.1" 200 34494 "https://www.example.com/foo/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.79 Safari/537.36”