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”

Comments

Re: Apache 2.4 and DirectoryIndex and htaccess

By LuKreme at 06/13/2018 - 13:20

No ideas?

On 11 Jun 2018, at 12:34, @lbutlr < ... at kreme dot com> wrote:

Re: Re: Apache 2.4 and DirectoryIndex and htaccess

By Frank Gingras at 06/13/2018 - 13:25

What does the error log say, exactly?

Re: Apache 2.4 and DirectoryIndex and htaccess

By LuKreme at 06/13/2018 - 13:37

On 13 Jun 2018, at 11:25, Frank Gingras < ... at apache dot org> wrote:
From the original message:

Re: Re: Apache 2.4 and DirectoryIndex and htaccess

By Frank Gingras at 06/13/2018 - 13:50

That isn't the relevant error from the error log. We need that entry to
help you.

A 403 as such is always logged in the error log, perhaps with the exception
of cases when you use a RewriteRule with [F], or a third-party module to
limit access.

Re: Apache 2.4 and DirectoryIndex and htaccess

By LuKreme at 06/14/2018 - 23:36

On Jun 13, 2018, at 11:50, Frank Gingras < ... at apache dot org> wrote:
That is the ONLY thing logged in the error log.

I’ll check on that. For now I’ve moved the directory to a top-level directory and pointed a subdomain at it.