Apache显示目录列表及icons目录的问题
今天想部署下开源项目pig,发现它的mysql需要5.7.8 +,为了能支持多个版本并且可以方便切换,所以选择了phpstudy_pro
刚开始Apache不支持目录访问
修改配置
<VirtualHost _default_:80>
DocumentRoot "D:/WWW"
FcgidInitialEnv PHPRC "D:/phpstudy_pro/Extensions/php/php7.3.4nts"
AddHandler fcgid-script .php
FcgidWrapper "D:/phpstudy_pro/Extensions/php/php7.3.4nts/php-cgi.exe" .php
<Directory "D:/WWW">
Options Indexes FollowSymLinks ExecCGI
AllowOverride All
Order allow,deny
Allow from all
Require all granted
DirectoryIndex index.php index.html
</Directory>
</VirtualHost>
关键: Indexes显示目录
添加后发现

搜索了下Apache的配置目录conf,发现在conf/original/extra/httpd-autoindex.conf,将下面的都注释掉
#Alias /icons/ "${SRVROOT}/icons/"
#<Directory "${SRVROOT}/icons">
# Options Indexes MultiViews
# AllowOverride None
# Require all granted
#</Directory>
#
# AddIcon* directives tell the server which icon to show for different
# files or filename extensions. These are only displayed for
# FancyIndexed directories.
#
AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip
#AddIconByType (TXT,/icons/text.gif) text/*
#AddIconByType (IMG,/icons/image2.gif) image/*
#AddIconByType (SND,/icons/sound2.gif) audio/*
#AddIconByType (VID,/icons/movie.gif) video/*
#AddIcon /icons/binary.gif .bin .exe
#AddIcon /icons/binhex.gif .hqx
#AddIcon /icons/tar.gif .tar
#AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv
#AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip
#AddIcon /icons/a.gif .ps .ai .eps
#AddIcon /icons/layout.gif .html .shtml .htm .pdf
#AddIcon /icons/text.gif .txt
#AddIcon /icons/c.gif .c
#AddIcon /icons/p.gif .pl .py
#AddIcon /icons/f.gif .for
#AddIcon /icons/dvi.gif .dvi
#AddIcon /icons/uuencoded.gif .uu
#AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl
#AddIcon /icons/tex.gif .tex
#AddIcon /icons/bomb.gif core
#AddIcon /icons/back.gif ..
#AddIcon /icons/hand.right.gif README
#AddIcon /icons/folder.gif ^^DIRECTORY^^
#AddIcon /icons/blank.gif ^^BLANKICON^^
注:
对于没有进行安全配置的Apache服务器,默认情况可以用xxx.com/icons/的方式打开Apache目录下的icons文件夹,并且会罗列出文件列表,这样很不安全。
所以对上面代码进行注释,可以增加安全性。
当然也应该禁止Apache显示目录索引(只需将 Option 中的 Indexes 去掉即可),这里是为了方便本地使用才打开的
重启Apache

Apache显示目录列表及icons目录的问题的更多相关文章
- nginx配置目录列表访问权限
我们知道apache httpd默认情况下会显示访问目录的文件列表,但是nginx访问时如果目录下面没有默认首页,那么会返回403 Forbidden的错误,表示没有权限访问,比如根目录就是nginx ...
- centos中设置apache显示目录列表
apache中显示目录列表 在http.conf中加入如下代码(如有虚拟主机配置,加在虚拟主机配置段内),并把主目录内的index.pho,index.html,index.htm文件删除 复制代码 ...
- Node学习之(第三章:仿Apache显示目录列表的功能)
前言 今天咱们用Node.js中的核心模块以及上节学习的模板引擎art-template来实现服务器软件Apache的大体功能.用过Apache的朋友都知道,我们只需把本地文件放置在Apache的ww ...
- 禁止apache显示目录索引的常见方法(apache禁止列目录)
禁止Apache显示目录索引,禁止Apache显示目录结构列表,禁止Apache浏览目录,这是网上提问比较多的,其实都是一个意思.下面说下禁止禁止Apache显示目录索引的常见的3种方法. 要实现禁止 ...
- 禁止apache显示目录索引
1)修改目录配置: 复制代码 代码如下: <Directory "D:/Apache/blog.phpha.com">Options Indexes FollowSym ...
- 禁止apache显示目录索引 apache禁止列目录
禁止Apache显示目录索引的常见的3种方法. 要实现禁止Apache显示目录索引,只需将Option中的Indexes去掉即可. 禁止Apache显示目录索引,禁止Apache显示目录结构列表,禁止 ...
- 禁止Apache显示目录索引的常见方法
禁止Apache显示目录索引,禁止Apache显示目录结构列表,禁止Apache浏览目录,这是网上提问比较多的,其实都是一个意思.下面说下禁止禁止Apache显示目录索引的常见的3种方法. 要实现禁止 ...
- Apache设置禁止访问网站目录(目录列表显示文件)
默认apache在当前目录下没有index.html入口就会显示目录.让目录暴露在外面是非常危险的事,如下操作禁止apache显示目录,希望文章对各位有帮助. 进入apache的配置文件 httpd. ...
- h5ai目录列表优化
h5ai是HTTP Web服务器的现代文件索引器,专注于您的文件.目录以有吸引力的方式显示,浏览它们通过不同的视图,面包屑和树状概述增强.最初,h5ai是HTML5 Apache Index的缩写,但 ...
随机推荐
- 使用 Express Generator快速创建Express应用
全局安装express-generator npm install express-generator -g 根据需求生成自己需要的模板 生成ejs模板:express demo --view=ejs ...
- Spring动态切换多数据源事务开启后,动态数据源切换失效解决方案
关于某操作中开启事务后,动态切换数据源机制失效的问题,暂时想到一个取巧的方法,在Spring声明式事务配置中,可对不改变数据库数据的方法采用不支持事务的配置,如下: 对单纯查询数据的操作设置为不支持事 ...
- mysql使用过程中出现的问题总结
1.mysql命令窗口输入密码后窗口闪退 密码输入错误.(其他暂不清楚) 2. 出现这个错误的原因是,数据库的编码格式不一致. https://www.cnblogs.com/lsr-flying/p ...
- Blink示例程序
打开Arduino IDE(话说与Processing IDE的UI好像啊 然后将这段代码输入.也可从文件>例子>01.Basics/Blink(File/Examples/01.Basi ...
- jQuery中判断数组
判断数组里面是否包含某个元素可以使用 $.inArray("元素(字符串)",数组名称) 进行判断 ,当存在该元素(字符串)时,返回该元素在数组的下标,不存在时返回 -1 jQ=& ...
- rhce备战笔记
1)配置selinuxvim /etc/slinux/config SELINUX=enforcingsetenforce 1getenforce两台都做 2)配置SSHvim /etc/ssh ...
- 爬虫 -- UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe6 in position 301: unexpected end of data
errors参数有3个值:strict, ignore, replace html.decode("utf-8"),这种形式有时会报错,那么修改为下面形式,将decode函数 ...
- kuma kong 团队开发的可视化&&安全的service mesh
最近service mesh 的开源产品是越来越多了,好多团队都开源了自己的解决方案 maesh 最近kong 团队也开源了自己的service meshkuma 一张参考图 说明 kuma 没有基于 ...
- GoCN每日新闻(2019-11-04)
GoCN每日新闻(2019-11-04) GoCN每日新闻(2019-11-04) 1. Go中垃圾收集器是如何标记内存的 https://medium.com/a-journey-with-go ...
- pytest . class
#在当前测试类的开始与结束执行. setup_class teardown_class #在每个测试方法开始与结束执行. setup teardown #在每个测试方法开始与结束执行,与setup/t ...