Directory Listing

Directory Listing

am 18.10.2007 11:59:16 von Hans-Peter Sauer

Is there a way to stop directory listing. i.e. if i have no index file in
my directory the browser displays a full directory listing of all the files
in the directory

Re: Directory Listing

am 18.10.2007 12:15:46 von Hans van Zijst

Hi David,

There is, it's in the Options section. Check out the documentation:

http://httpd.apache.org/docs/2.2/mod/core.html#options

In your configuration, there's probably a statement like

"Options Indexes"

Remove the "Indexes" and Apache won't show the directory listing anymore.

Regards,

Hans


David wrote:
> Is there a way to stop directory listing. i.e. if i have no index file in
> my directory the browser displays a full directory listing of all the files
> in the directory
>
>

Re: Directory Listing

am 18.10.2007 12:36:07 von Hans-Peter Sauer

"Hans van Zijst" wrote in message
news:47173252$0$24365$bf4948fe@news.tele2.nl...
> Hi David,
>
> There is, it's in the Options section. Check out the documentation:
>
> http://httpd.apache.org/docs/2.2/mod/core.html#options
>
> In your configuration, there's probably a statement like
>
> "Options Indexes"
>
> Remove the "Indexes" and Apache won't show the directory listing anymore.
>
> Regards,
>
> Hans
>

Hmm. I assumed the directory index was required to specify which index page
type to look for.

i.e. in each virtual host directory i placed:

DirectoryIndex index.htm index.html index.php

Are you saying this is not required?

Re: Directory Listing

am 18.10.2007 14:08:36 von Hans van Zijst

Hi David,

That's not the same, DirectoryIndex or Indexes. Do read the
documentation, it's good for you :)

DirectoryIndex tells Apache which files to look for in a directory to
show as an index. Indexes tells Apache whether or not to show a
directory listing if the DirectoryIndex isn't found.

Kind regards,

Hans


David wrote:
> Hmm. I assumed the directory index was required to specify which index page
> type to look for.
>
> i.e. in each virtual host directory i placed:
>
> DirectoryIndex index.htm index.html index.php
>
> Are you saying this is not required?
>
>

Re: Directory Listing

am 18.10.2007 23:06:52 von Hans-Peter Sauer

"Hans van Zijst" wrote in message
news:47174cc4$0$24171$bf4948fe@news.tele2.nl...
> Hi David,
>
> That's not the same, DirectoryIndex or Indexes. Do read the
> documentation, it's good for you :)
>
> DirectoryIndex tells Apache which files to look for in a directory to
> show as an index. Indexes tells Apache whether or not to show a
> directory listing if the DirectoryIndex isn't found.
>
> Kind regards,
>
> Hans
>
>


The only config i have for this is

Options Indexes FollowSymLinks

I cant see anyting about directory listing.

Can anyone else elaborate? TIA

Re: Directory Listing

am 19.10.2007 14:40:16 von Hans-Peter Sauer

"David" wrote in message
news:13hfinjgsp3ft85@corp.supernews.com...
>
> "Hans van Zijst" wrote in message
> news:47174cc4$0$24171$bf4948fe@news.tele2.nl...
>> Hi David,
>>
>> That's not the same, DirectoryIndex or Indexes. Do read the
>> documentation, it's good for you :)
>>
>> DirectoryIndex tells Apache which files to look for in a directory to
>> show as an index. Indexes tells Apache whether or not to show a
>> directory listing if the DirectoryIndex isn't found.
>>
>> Kind regards,
>>
>> Hans
>>
>>
>
>
> The only config i have for this is
>
> Options Indexes FollowSymLinks
>
> I cant see anyting about directory listing.
>
> Can anyone else elaborate? TIA
>


to elaborate on this i want to avoid having to add config to each individual
virtual directory.

I want to do this within the httpd file to apply to all sites. The apache
manual is unclear on how to do this imo

Can anyone confirm this is the correct section to edit

#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.0/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks

Should i change this to:

Change to: Options -Indexes FollowSymLinks ??????

TIA

Re: Directory Listing

am 19.10.2007 20:35:52 von Hans van Zijst

David,

You can use the "Options" directive in your default configuration, not
just within a VirtualServer or Directory context. See:

http://httpd.apache.org/docs/2.2/mod/core.html#options

If there's no Options directive in your default config, add one:

Options -Indexes

That should do the trick.

Kind regards,

Hans


David schreef:
>> The only config i have for this is
>>
>> Options Indexes FollowSymLinks
>>
>> I cant see anyting about directory listing.
>>
>> Can anyone else elaborate? TIA
>>
>
>
> to elaborate on this i want to avoid having to add config to each individual
> virtual directory.
>
> I want to do this within the httpd file to apply to all sites. The apache
> manual is unclear on how to do this imo
>
> Can anyone confirm this is the correct section to edit
>
> #
> # Possible values for the Options directive are "None", "All",
> # or any combination of:
> # Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
> #
> # Note that "MultiViews" must be named *explicitly* --- "Options All"
> # doesn't give it to you.
> #
> # The Options directive is both complicated and important. Please see
> # http://httpd.apache.org/docs/2.0/mod/core.html#options
> # for more information.
> #
> Options Indexes FollowSymLinks
>
> Should i change this to:
>
> Change to: Options -Indexes FollowSymLinks ??????
>
> TIA
>
>

Re: Directory Listing

am 19.10.2007 22:13:46 von HansH

"David" schreef in bericht
news:13hh9dmb04lo03e@corp.supernews.com...
> Can anyone confirm this is the correct section to edit
>
> #
> # Possible values for the Options directive are "None", "All",
> # or any combination of:
> # Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI
> MultiViews
> #
> # Note that "MultiViews" must be named *explicitly* --- "Options All"
> # doesn't give it to you.
> #
> # The Options directive is both complicated and important. Please see
> # http://httpd.apache.org/docs/2.0/mod/core.html#options
> # for more information.
> #
> Options Indexes FollowSymLinks
>
> Should i change this to:
>
> Change to: Options -Indexes FollowSymLinks ??????
>
As http://httpd.apache.org/docs/2.2/mod/core.html#options has a warning for
you:
Mixing Options with a + or - with those without is not valid syntax, and is
likely to cause unexpected results.

just change the line to
Options FollowSymLinks
or
Options None


Hansh

Re: Directory Listing

am 20.10.2007 11:34:44 von Hans-Peter Sauer

"HansH" wrote in message
news:4719107e$0$241$e4fe514c@news.xs4all.nl...
> "David" schreef in bericht
> news:13hh9dmb04lo03e@corp.supernews.com...
>> Can anyone confirm this is the correct section to edit
>>
>> #
>> # Possible values for the Options directive are "None", "All",
>> # or any combination of:
>> # Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI
>> MultiViews
>> #
>> # Note that "MultiViews" must be named *explicitly* --- "Options All"
>> # doesn't give it to you.
>> #
>> # The Options directive is both complicated and important. Please see
>> # http://httpd.apache.org/docs/2.0/mod/core.html#options
>> # for more information.
>> #
>> Options Indexes FollowSymLinks
>>
>> Should i change this to:
>>
>> Change to: Options -Indexes FollowSymLinks ??????
>>
> As http://httpd.apache.org/docs/2.2/mod/core.html#options has a warning
> for you:
> Mixing Options with a + or - with those without is not valid syntax, and
> is likely to cause unexpected results.
>
> just change the line to
> Options FollowSymLinks
> or
> Options None
>
>
> Hansh


Thank you Hansh. I have removed Indexes completely rather than using +/-
Thanks for replying