Apache Options Indexes followsymlinks specific explanations

Source: Internet
Author: User



Suppresses the Apache Folder List-indexes followsymlinks
How to change the configuration of the folder to suppress the Apache folder list.
By default, assume that you enter an address in your browser:

http://localhost:8080/
If you have index.html in the root folder of your file, the browser will display the contents of index.html, assuming that there is no index.html, the browser will display the folder List of the root folder of the file, the folder list contains files and subfolders under the root folder of the file.

Same as you enter the address of a virtual folder:

http://localhost:8080/b/
Assuming that there is no index.html under the virtual folder, the browser also displays the folder structure of the virtual folder, listing the files and subfolders under that virtual folder.

How do I disable Apache from displaying a folder list?

To prevent Apache from displaying a list of folder structures, simply remove the Indexes in Option.

For example, let's look at the folder configuration for a folder:

<directory "D:/apa/blabla" >
Options Indexes followsymlinks #---------->options followsymlinks
allowoverride None
Order Allow,deny
allow from all
</Directory>
You just need to remove the Indexes from the above code to prevent Apache from displaying the folder structure. The user will not see the list of files and subfolders under that folder.

The Indexes function is to display the folder structure when there are no index.html files in the folder. Removing Indexes,apache will not show a list of the folders.

A different approach
The workaround:
1. Edit the httpd.conf file
           Vi./conf/httpd.conf

Find for example the following:
?br> <directory "C:/Program Files/apache2.2/htdocs" >
#
# Possible values for the Options directive is "None", "all",
# or any combination of:
Indexes includes followsymlinks symlinksifownermatch execcgi multiviews
#
# Note that "MultiViews" must is 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.2/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks

#
# AllowOverride Controls What directives is placed in. htaccess files.
# It can be ' all ', ' None ', or any combination of the keywords:
#Options FileInfo authconfig Limit
#
AllowOverride None

                          #
                          # Controls who can get stuff from this Server.
                          #
                          Order allow,deny
                          allow from all

</Directory>
...

in the options Indexes followsymlinks in front of the Indexes plus – symbol.


namely: options-indexes followsymlinks
Note: Before indexes, plus + represents consent to folder browsing; plus-represents a ban on folder browsing. 】

Such words belong to the entire Apache Forbidden folder browsing.

Assume that it is in a virtual host. Just add information such as the following:
<directory "D:test" >
Options-indexes FollowSymLinks
AllowOverride None
Order Deny,allow
Allow from all
</Directory>
This prevents folder browsing under TestProject.

Note: Remember to change "allow from all" to "Deny from all". Otherwise, the entire site cannot be opened.
<Finished>

Another way:

Can be entered in the. htaccess file of the root folder

<files *>
Options-indexes
</Files>
will be able to prevent Apache from listing the folder structure.

Apache Options Indexes followsymlinks specific explanations

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.