禁止显示Apache目录列表-Indexes FollowSymLinks
如何修改目录的配置以禁止显示 Apache 目录列表。
缺省情况下如果你在浏览器输入地址:

http://localhost:8080/
如果你的文件根目录里有 index.html,浏览器就会显示 index.html的内容,如果没有 index.html,浏览器就会显示文件根目录的目录列表,目录列表包括文件根目录下的文件和子目录。

同样你输入一个虚拟目录的地址:

http://localhost:8080/b/
如果该虚拟目录下没有 index.html,浏览器也会显示该虚拟目录的目录结构,列出该虚拟目录下的文件和子目录。

如何禁止 Apache 显示目录列表呢?

要禁止 Apache 显示目录结构列表,只需将 Option 中的 Indexes 去掉即可。

比如我们看看一个目录的目录配置:

<Directory "D:/Apa/blabla">
 Options Indexes FollowSymLinks #---------->Options FollowSymLinks
 AllowOverride None
 Order allow,deny
 Allow from all
</Directory>
你只需要将上面代码中的 Indexes 去掉,就可以禁止 Apache 显示该目录结构。用户就不会看到该目录下的文件和子目录列表了。

Indexes 的作用就是当该目录下没有 index.html 文件时,就显示目录结构,去掉 Indexes,Apache 就不会显示该目录的列表了。

第二种方法
解决办法:
        1、编辑httpd.conf文件
            vi ./conf/httpd.conf

找到如下内容:
          ?BR>          <Directory “C:/Program Files/Apache2.2/htdocs”>
              #
              # 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.2/mod/core.html#options
              # for more information.
              #
              Options Indexes FollowSymLinks

#
              # AllowOverride controls what directives may be 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

from:http://blog.sina.com.cn/s/blog_a03d702f0101133h.html

【转】Apache Options Indexes FollowSymLinks详解的更多相关文章

  1. Apache Options Indexes FollowSymLinks详解

    禁止显示Apache目录列表-Indexes FollowSymLinks如何修改目录的配置以禁止显示 Apache 目录列表.缺省情况下如果你在浏览器输入地址: http://localhost:8 ...

  2. Apache服务器的Options 的 Indexes FollowSymLinks详解

    禁止显示Apache目录列表 - Indexes FollowSymLinks 如何修改目录的配置以禁止显示 Apache 目录列表. 缺省情况下如果你在浏览器输入地址: http://localho ...

  3. Apache Options Indexes FollowSymLinks之讲解

    禁止显示Apache目录列表-Indexes FollowSymLinks 如何修改目录的配置以禁止显示 Apache 目录列表. 缺省情况下如果你在浏览器输入地址: http://localhost ...

  4. Apache Options Indexes FollowSymLinks具体解释

     禁止显示Apache文件夹列表-Indexes FollowSymLinks 怎样改动文件夹的配置以禁止显示 Apache 文件夹列表. 缺省情况下假设你在浏览器输入地址: http://loc ...

  5. Apache(httpd)详解

    httpd详解(思维导图) 1. httpd服务 ASF 服务器类型 http服务器 应用程序服务器 httpd的特性 高度模块化 DSO机制 MPM httpd的并发响应模型 prefork wor ...

  6. apache httpd.conf 参数详解

    由于网站需要,需要配置多个虚拟主机,但是apache主机的参数太多,记不住,下面做一下总结 归纳: ServerRoot:apache安装位置 Listen:服务器监听的端口号 LoadModule: ...

  7. Apache 的 httpd.conf 详解

    ServerRoot “/usr/local“ ServerRoot用于指定守护进程httpd的运行目录,httpd在启动之后将自动将进程的当前目录改变为这个目录,因此如果设置文件中指定的文件或目录是 ...

  8. Ubuntu16.04+Apache虚拟主机配置详解

    在window下,Apache的配置文件是httpd.conf,但在Linux下安装了Apache后发现其配置并不像window下那么简单,Linux下Apache将各个设置项分在了不同的配置文件中, ...

  9. Apache的httpd命令详解

    Apache的httpd命令详解 来源:全栈开发者 发布时间:2012-01-03 阅读次数:10965 4   httpd.exe为Apache HTTP服务器程序.直接执行程序可启动服务器的服务. ...

随机推荐

  1. 【LEETCODE OJ】Binary Tree Preorder Traversal

    Problem Link: http://oj.leetcode.com/problems/binary-tree-preorder-traversal/ Even iterative solutio ...

  2. 学习笔记:jquery1.9版本后废弃的函数和方法

    jQuery1.9+ 废弃的函数和方法 升级Jquery版本遇到的问题 (转载自:http://www.ppblog.cn/jquery1-9live.html  版权归原作者所有) jQuery1. ...

  3. [转]Golang Gob编码

    Golang Gob编码 2012-08-24 09:47 by 轩脉刃, 5119 阅读, 1 评论, 收藏, 编辑 gob是Golang包自带的一个数据结构序列化的编码/解码工具.编码使用Enco ...

  4. phpcms站---去除域名绑定目录中的HTML

    原网址:http://www.xker.com/page/e2014/1207/148536.html 打开 \install_package 打开 \caches\configs 目录下的 syst ...

  5. Think Python - Chapter 15 - Classes and objects

    15.1 User-defined typesWe have used many of Python’s built-in types; now we are going to define a ne ...

  6. Java 最简单的计算器——使用Args参数

    public class Test{ public static void main(String[] args){ if(args.length<3){ System.out.println( ...

  7. ZOJ 1074 To the Max

    原题链接 题目大意:这是一道好题.在<算法导论>这本书里面,有一节是介绍如何求最大子序列的.这道题有点类似,区别是从数组变成了矩阵,求最大子矩阵. 解法:完全没有算法功底的人当然不知道最大 ...

  8. my PhoneWeb

    <meta name="viewport" content="width=device-width, user-scalable=yes, minimum-scal ...

  9. 设置Eclipse支持C++ 11

    设置Eclipse支持C++ 11 两个步骤: 项目 > Properties > C/C++ Build > Setting > GCC C++ Compiler > ...

  10. NOI 银河英雄传说

    并查集水题,记录祖先,大小和深度即可,每次用祖先的大小和深度更新后代的深度. #include <cstdio> #include <iostream> #include &l ...