How to disable directory listing in Apache

Source: Internet
Author: User

It turns out to be Options Indexes FollowSymLinks. Access a directory. If no default file is displayed under this directory, the file names under this directory will be listed.]

After changing to Options FollowSymLinks, the system prompts 403 fobidden.


Example

The code is as follows: Copy code

<Directory/home/httpd/html>

Option Indexes Includes ExecCGI FollowSymLink

AllowOverride None

Order allow, deny

Allow from

All

</Directory>

The configuration here is for the/home/httpd/html directory.


After you open the page, the directory will not be listed, but the following will be displayed if there is no default homepage.

Forbidden
You don't have permission to access/images/on this server.

Option parameters

The Option command has many parameters, which have the following meanings:
All allow All of the following functions (except MultiViews)

Multiviews: Multiviews that allow content negotiation

If no index file exists in the directory, Indexes allows you to display the files in the directory for selection.

IncludesNOEXEC allows SSI (Server-side supported DES), but # exec and # include functions cannot be used.

Supported des allows SSI

FollowSymLinks allow symbolic links to other directories

ExecCGI allows CGI to be used in this directory.

Order Command: used to set who can get control from this server. It also has two parameters:

Allow can achieve control

Deny forbidden to obtain control

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.