Re: undocumented silent failure of mod_autoindex (without mod_dir)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Sep 5, 2015 at 4:26 PM, Eric Covener <covener@xxxxxxxxx> wrote:
> On Sat, Sep 5, 2015 at 7:06 PM, Parke <parke.nexus@xxxxxxxxx> wrote:
>> Undocumented, silent failures can be frustrating to diagnose.
>>
>> Perhaps the mod_autoindex documentation could be improved to include:
>> 1) an explicit explanation of mod_autoindex's dependency on mod_dir
>> and DirectoryIndex
>> 2) a sample, minimal, functioning configuration of mod_autoindex
>
> I think you're mis-observing something here.  The relationship is
> exactly the intiutitive relationship as its described at the top of
> mod_autoindex:
>
> http://httpd.apache.org/docs/2.4/mod/mod_autoindex.html
>
> Summary
>
> The index of a directory can come from one of two sources:
>
> * A file written by the user, typically called index.html. The
> DirectoryIndex directive sets the name of this file. This is
> controlled by mod_dir.

> * Otherwise, a listing generated by the server. The other directives
> control the format of this listing. The AddIcon, AddIconByEncoding and
> AddIconByType are used to set a list of icons to display for various
> file types; for each file listed, the first icon listed that matches
> the file is displayed. These are controlled by mod_autoindex.

It is not intuitive to me that "Otherwise" means "if (and only if)
both mod_dir is loaded and no DirectoryIndex is found".

I read "Otherwise" as meaning "if the index does not come from
mod_dir".  In my case, there were at least two good reason to believe
that the index would not come from "mod_dir".  (1) mod_dir was not
loaded.  (2) there was no "index.html" file in the requested
directory.

> mod_autoindex works without mod_dir loaded and works with mod_dir
> loaded as when you request a directory that doesn't have one of the
> named DirectoryIndex files. If it's failing for you, it's something
> more nuanced (like some other directives changing where the request is
> mapped to)

I did some more testing, and it turns out that I was partly incorrect.
Setting DirectoryIndex to disabled has no effect.  However, I still
need to load mod_dir before I get indexes from mod_autoindex.

If there are nuances in my configuration file that are causing
mod_autoindex to silently fail, I'd be happy to know what those
nuances are.

Here is the relevant configuration file in its entirety.

----

ServerName              localhost
DocumentRoot            /tmp
Listen                  8005

ErrorLog                /tmp/error
PidFile                 /tmp/pid

###  core apache 2.4
LoadModule  authn_core_module   /usr/lib/apache2/modules/mod_authn_core.so
LoadModule  authz_core_module   /usr/lib/apache2/modules/mod_authz_core.so
LoadModule  mpm_prefork_module  /usr/lib/apache2/modules/mod_mpm_prefork.so

###  auto index
LoadModule  autoindex_module    /usr/lib/apache2/modules/mod_autoindex.so
Options                 +Indexes
IndexOptions            FancyIndexing

# uncomment the next line to actiavte mod_autoindex
# LoadModule  dir_module          /usr/lib/apache2/modules/mod_dir.so

----

I am running on Ubuntu 14.04, with apache2 package version
2.4.7-1ubuntu4.5.  I am running apache2 as non-root.

Thanks!

-Parke

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx




[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux