Apache help Tips – How to Disable directory indexes?

Posted by Jiltin     27 March, 2009    8,693 views   

Apache ServerDefault apache server configuration file (httpd.conf) comes with directory index listing. It is often desirable not to list indexes so that you avoid unauthorized uses/visits to your site’s sub directory. To prevent the server from showing a listing of the existing files in case there is no index (as defined by DirectoryIndex) in one folder. In my opinion if you need this enabled then you should enable it only on some particular directory where you need it and disable it server wide. Also it might be useful that in the places you have it enabled to hide any files that need to be private as shown in my previous tip: “Hide a file type from directory indexes“.

Options – Indexes

The Options directive is the place where you can enable or disable the index generation. This is set by default to ALL (meaning that it will turn ON also Indexes), but normally you will see this overwritten by each distribution either globally or inside the default vhost definition.

As I said previously my approach is to start by disabling directory indexes globally. This is done in the main server config, by adding the Options directive (or only adding to it the -Indexes part in case you have other global options defined):

Options -Indexes

Now as long as you will not overwrite this inside any directory or vhost it will disable the generation of directory indexes. Your root directory may look like this for example:

<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>

the important thing is to not include the addition of Indexes. As long as you have AllowOverride None it will prevent any accidental changes done in .htaccess files.

If you want to enable indexes generation on some particular directory or vhost just add the Indexes option:

<Directory /www/somefolder>
Options Indexes FollowSymLinks
AllowOverride None
</Directory>

and this will enable only in that folder the generation of indexes. In this case, you might want to prevent the listing of some file types as seen in my previous post: “Hide a file type from directory indexes“.

Following Google Searches Lead To This Post: apache no listar directorio indexes
prevent folder listing subdirectories
directory indexing off
disable DirectoryIndex
apache how to turn off showing file directory index
how to disable php in apache directory
“disable help in oracle application”
apache2 global disable directory
stop apache showing directory
apache enable list dir
apache2 disable folder
apache disable directory index
fedora hiding phpmyadmin folder
disabled root directory appche
apache Global Directory Index
apache show index of
apache director list enabled
apache2 avoid directory listing
apache directory index off windows
disable “index of” apache2
disable Options Indexes FollowSymLinks
disable directory list apache2
turn on indexes options apache
apache index of disable
apache enabling directory index
apache disallow dir index
apache showing directory
apache disable of displaying files if no index
stop apache from showing directory
apache 2.0 turn off directory listing
apache root directory showing as list
disable display index apahce
how to disable DirectoryIndex apche windows
apache allow indexes for subdirectory
not allow apache to display root directory index
apache windows prevent directory listing
prevent index directories apache “Options -Indexes”
disable floder listing on apache2
enable apache google indexer
apache disable index vhost
vhosts disable index
httpd hide folder options Indexes
apache prevent viewing root folder
turn off file directory listing linux
disable indexes global
apache +indexes no show
apache disable index file
apache indexes followsymlinks
disable index listing
apache turn on directoryindexes
disable directory indexing apache2
apache disable root directory
‘URL to hide folders+apache’
apache how to disable root directory
apache virtualhost disable indexes
oracle apache and prevent passing scripting tags
directory indexes apache seo
apache turn off site indexing
turn off file displaying in apache
disabling index of in directory listing
Disable directory indexes
apache disable index generation
disable log in some directories apache
apache2 hide directory files
apache2 prevent explore subdir
apache enable directory listing
show index of apache disable
enable list subdirectories apache
enable list subdirectories web apache
how to disable “index of” web page
“enable directory” apache
apache2 disable indexes
apache turn of indexed folders
apache dir index howto
directory listing apache2
show “Options -Indexes” off on ?
apache +indexes security
apache windows disable directory
apache disable an option globally
apache disabling show version
how to prevent display folders in apathe + php
apache options directive stop indexing
apache folder list disable
apache hide index.php
apache disable +DirectoryIndex
apache forbid directory index
apache vhost syntax “option index”
disable apache displaying directory
apache2 default index for folder
disable directory indexes + c#
apache2 disable followsymlinks
hide index apache2
apache disable directory listing on subdir
apache disable directory content
apache showing the index of
disable directory index in httpd
apache fedora disable directory listing
How to avoid directory listing in Apache
disable list directory in apache
apache enable directory listing only
11i oracle apps apache folder list
apache show index directory
apache turn off FollowSymLinks
display index but not subdirectory httpd.conf
disable folder indexing in apache
apache: hide directories with no index.php
disallow directory listing in linux
Options +Indexes only show files
“-indexes” still shows index apache
apache deactivating php
“apache2″+”hide directory”
“apache2″+”hide”+”folders”
remove ‘Indexes’ from Apache ‘Options’ list
global DirectoryIndex apache
how to enable directory index in apache
apache show index of /
apache disabling global indexes
php list directories avoid apache2
apache disallowing index listings
httpd.conf “disallow directory indexes”
apache stop showing directory files
preventing folder listing in apache
apache2 avoid show server version
apache2 password hide directory
globally turn off index listing in vhosts apache
apache indexesoff
“options indexes off” directory
apache indexing globally off
apache disable OPTIONS
apache how to hide root directory
apache disable directory “index of”
Options Indexes directory
disable list apache
apache indexes disable
apache shows Index of /
how to enable apache root folder listing
APACHE DISABLE INDEXES FOLDER
vhosts disable directory listing
disable root directory apache enable
disable root index apache enable
disable global directory listing
how to not show indexes of directories in apache
how to disable showing directory files with no ndex
apache enable Directory index in folder
how to disable directories from being displayed on apache2
prevent apache showing folder list
apache 2.0 prevent display of filetype
remove ‘Indexes’ from Apache ‘Options’ list.
Disable global indexing apache
unix linux disable listing in folder
how to turn off root directory to display
apache disable list dir
apache turn off indexes global

Post to Twitter  Post to Delicious  Post to Digg    Post to StumbleUpon

Categories : Scripts Unix, Web & Scripts Tags : , ,

Comments

No comments yet.


Leave a comment

(required)

(required)