apache 目录网站显示indexs
Apache Options Indexes FollowSymLinks详解
第一种方法
<Directory "E:\myvirtualhost\localhost">
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 将目录结构列表出来。
apache 目录网站显示indexs的更多相关文章
- CentOS Linux系统下更改Apache默认网站目录
引言: Apache默认的网站目录是在/var/www/html,我们现在要把网站目录更改到/home/wwwroot/web1/htdocs,操作如下 准备工作: 创建目录: cd /home mk ...
- CentOS 6.8下更改Apache默认网站安装目录
首先,当我们搭建好LAMP环境后,Apache服务器默认的网站安装目录是/var/www/html 然而我们搭建项目时为了方便,我们是按照自己的意愿更改网站目录的 现在假设,按照意愿设定的网站目录为/ ...
- CentOS 更改Apache默认网站目录
http://www.osyunwei.com/archives/789.html引言:Apache默认的网站目录是在/var/www/html, 现在要把网站目录更改到/home/wwwroot/w ...
- Apache服务器网站访问伪静态内页出现No input file specified.的完美解决方案
原文地址:Apache服务器网站访问伪静态内页出现No input file specified.的完美解决方案 启用REWRITE的伪静态功能的时候,首页可以访问,而访问内页的时候,就提示:&quo ...
- 更改Apache默认网站根目录
Apache服务器网站根目录配置是个比较基本的操作,之前经常用,现在记一下笔记 打开Apache的配置文件,一般在Apache安装目录下的conf/httpd.conf配置文件中修改, 找到 Docu ...
- apache目录及文件讲解
apache目录下bin,conf,htdocs,logs,modules讲解 bin: ab 压力测试工具 apachectl 启动命令 apxs ...
- phpstudy如何安装景安ssl证书 window下apache服务器网站https访问
1. 下载景安免费证书 https://www.zzidc.com/help/helpDetail?id=555 2.文件解压上传至服务器,位置自己决定 3. 调整apache配置 景安原文链接:ht ...
- Apache目录结构(一)
一.Apache 目录结构 bin: 该目录用于存放apache常用的命令,比如httpd cig-bin:该目录存放linux下的常用命令 .sh conf:存放配置文件httpd.conf,在ht ...
- Apache目录结构解释
源地址:http://blog.51cto.com/marsman/1913676 本文主要讲述apache主要目录结构及主要配置文件 1.apache目录结构 [root@test apache]# ...
随机推荐
- WWDC2018 之 优化 App Assets Optimizing App Assets
该篇博客记录了观看WWDC Session227<Optimizing App Assets>的内容以及一些理解. 引言 该session主要讲述了使用Assets Catalog的新特性 ...
- 【Python系统学习02】数据类型与类型转换
一.数据类型 字符串 整数 浮点数 [补充中...] 1.字符串 str 字符串:英文string,简写str. name = '小石头:' print(name,'2019', '12', '24' ...
- ArrayList、LinkedList、Vector、CopyOnWriteArrayList的区别和源码分析
1. ArrayList ArrayList 是一个数组队列,相当于动态数组.与Java中的数组相比,它的容量能动态增长.它继承于AbstractList,实现了List, RandomAccess, ...
- 十三、springboot 优雅集成spring-boot-admin 实现程序监控
前言 我们知道项目的监控是尤为重要的,但是我们如果用jdk 自带的jconsole 和jvisualvm 的话会非常繁琐,且界面不是很友好.之前我们使用了spring boot 项目,但是都没有对项目 ...
- [工具] Git版本管理(一)(基本操作)
一.版本控制的发展 1.用文件来做版本控制 我们在写论文.做方案等的时候,一般都会同时在文件夹中存在很多版本的文件. 例如: 这种方式很常用,在很多领域都是用这种方式来进行版本控制的. 2.本地版本控 ...
- Python3 虚拟开发环境搭建
虚拟环境的搭建 优点 1.使不同应用开发环境相互独立 2.环境升级不影响其他应用,也不会影响全局的python环境 3.防止出现包管理混乱及包版本冲突 windows 安装 # 建议使用pip3安装到 ...
- Freemarker 的基础使用 (二)
freemarker 的基础使用二 ftl 文件 <html> <head> <meta http-equiv="Content-Type" cont ...
- Arduino_URO端口与AtMega328p引脚对应图
Arduino微控制器的数字端口和模拟端口与ATMEGA 328芯片引脚的对应关系图如下.标有0~13标号的引脚对应的是数字端口,在0~13前面有符号“~”的引脚对应的端口具有PWM输出功能.标有A0 ...
- js删除数组的某个元素
最近在刷算法题,我是用js语言去写的,其中一题需要删除数组的某个元素,查了一下资料,总结一下 使用splice()方法 array.splice(start[, deleteCount[, item1 ...
- 在IIS上发布netcore项目
保证电脑上有.net core sdk或者.net core runtime; 需要安装AspNetCoreModule托管模块:DotNetCore.2.0.5-WindowsHosting.exe ...