zoukankan      html  css  js  c++  java
  • apache 目录网站显示indexs

    Apache Options Indexes FollowSymLinks详解

    第一种方法

    <Directory "E:myvirtualhostlocalhost">
       Options Indexes FollowSymLinks   #Options FollowSymLinks
       AllowOverride None
       Order allow,deny
       Allow from all
    </Directory>

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

    第二种方法
            1、编辑httpd.conf文件

      找到如下内容:

    DocumentRoot "E:/laragonvirtualhost"
    <Directory "E:/laragonvirtualhost">
      #
      # 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.4/mod/core.html#options
      # for more information.
      #
      Options Indexes FollowSymLinks Includes ExecCGI

      #
      # AllowOverride controls what directives may be placed in .htaccess files.
      # It can be "All", "None", or any combination of the keywords:
      # AllowOverride FileInfo AuthConfig Limit
      #
      AllowOverride None

      #
      # Controls who can get stuff from this server.
      #
      Require all granted
    </Directory>

         在Options Indexes FollowSymLinks Includes ExecCGI 在Indexes前面加上 – 符号。
         即: Options -Indexes FollowSymLinks Includes ExecCGI 【在Indexes前,加 + 代表允许目录浏览;加 – 代表禁止目录浏览。】
       

     第三种方法

      可以在根目录的 .htaccess 文件中输入

      <Files *>
        Options -Indexes
      </Files>
      就可以阻止Apache 将目录结构列表出来。

  • 相关阅读:
    maven项目的构建命令
    linux的find命令
    python函数中参数前面的*和**的含义
    python中字典和集合的使用
    python中列表和元组的基本操作
    在Python中写中文注释格式
    linux 文件操作基本命令
    linux脚本实现递归阶乘
    base64
    从DispatcherServlet中的doService了解spring组件之间的处理流程
  • 原文地址:https://www.cnblogs.com/shynshyn/p/7893036.html
Copyright © 2011-2022 走看看