今天想部署下开源项目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目录的问题的更多相关文章

  1. nginx配置目录列表访问权限

    我们知道apache httpd默认情况下会显示访问目录的文件列表,但是nginx访问时如果目录下面没有默认首页,那么会返回403 Forbidden的错误,表示没有权限访问,比如根目录就是nginx ...

  2. centos中设置apache显示目录列表

    apache中显示目录列表 在http.conf中加入如下代码(如有虚拟主机配置,加在虚拟主机配置段内),并把主目录内的index.pho,index.html,index.htm文件删除 复制代码  ...

  3. Node学习之(第三章:仿Apache显示目录列表的功能)

    前言 今天咱们用Node.js中的核心模块以及上节学习的模板引擎art-template来实现服务器软件Apache的大体功能.用过Apache的朋友都知道,我们只需把本地文件放置在Apache的ww ...

  4. 禁止apache显示目录索引的常见方法(apache禁止列目录)

    禁止Apache显示目录索引,禁止Apache显示目录结构列表,禁止Apache浏览目录,这是网上提问比较多的,其实都是一个意思.下面说下禁止禁止Apache显示目录索引的常见的3种方法. 要实现禁止 ...

  5. 禁止apache显示目录索引

    1)修改目录配置: 复制代码 代码如下: <Directory "D:/Apache/blog.phpha.com">Options Indexes FollowSym ...

  6. 禁止apache显示目录索引 apache禁止列目录

    禁止Apache显示目录索引的常见的3种方法. 要实现禁止Apache显示目录索引,只需将Option中的Indexes去掉即可. 禁止Apache显示目录索引,禁止Apache显示目录结构列表,禁止 ...

  7. 禁止Apache显示目录索引的常见方法

    禁止Apache显示目录索引,禁止Apache显示目录结构列表,禁止Apache浏览目录,这是网上提问比较多的,其实都是一个意思.下面说下禁止禁止Apache显示目录索引的常见的3种方法. 要实现禁止 ...

  8. Apache设置禁止访问网站目录(目录列表显示文件)

    默认apache在当前目录下没有index.html入口就会显示目录.让目录暴露在外面是非常危险的事,如下操作禁止apache显示目录,希望文章对各位有帮助. 进入apache的配置文件 httpd. ...

  9. h5ai目录列表优化

    h5ai是HTTP Web服务器的现代文件索引器,专注于您的文件.目录以有吸引力的方式显示,浏览它们通过不同的视图,面包屑和树状概述增强.最初,h5ai是HTML5 Apache Index的缩写,但 ...

随机推荐

  1. abp记录2

    AbpCoreInstaller只是完成注册系统框架级的所有配置类.Abp支持自动完成符合Conventional(基于约定)的组件的注册. Conventional 的规则要通过继承IConvent ...

  2. IDEA 中 Git Commit message 编写

    IDEA安装插件 Git Commit Template 1. HeaderHeader的部分只有一行,包括三个字段: type(必需), scope(可选), subject(必需) 对应到idea ...

  3. js的类型系统--js基于原型的基石是所有对象最终都能够类型自证

    一.动态类型 变量能够类型自证的类型即为动态类型 二.基础与内置类型 三.对象与类型的关系 1.对象本身能够自证为基本类型: 2.元原型可能为一个空的集合: 3.复合对象的成员能够自证为基本类型: 4 ...

  4. react hooks沉思录

    将UI组件抽象为状态处理机.分为普通状态和副作用状态. 一.综述 useState:处理函数只改变引用的状态本身:副作用状态:会对引用状态以外的状态和变量进行修改:useReducer:用解藕化的机制 ...

  5. 借助xxl-sso实现SSO

    前言 市场上一下主流的SSO技术搭配方案: SpringSecurity + OAuth2 SpringSecurity + CAS 功能较弱,对前后端分离的项目支持不是很好 Shiro + CAS ...

  6. PostgreSQL Autovacuum和vacuum

    1 基础知识 重点: 如果您的数据库运行了很久,并且从来没有打开过autovacuum,那么请在打开autovacuum之前全库手动运行vacuum analyze(可能要非常久的时间)完全禁用aut ...

  7. Shell 变量自增实现方法

    i=`expr $i + `; let i+=; ((i++)); i=$[$i+]; i=$(( $i + )) 参考: https://www.cnblogs.com/faithfu/p/9472 ...

  8. mysql数据库数据入库时间跟当前时间差了8个小时

    vim /etc/my.cnf[mysqld]default-time_zone = '+8:00'重启mysql服务./etc/init.d/mysqld restart 未测试

  9. CT窗宽位宽

    先说一下CT值是什么 CT图像反映的是人体对X射线吸收的系数,但我们关心的是各组织结构的密度差异,即相对密度,如果某组织发生病变,其密度就会发生变化,但由于比较吸收系数非常繁琐,于是亨氏把组织器官对X ...

  10. 假如 Redis Cluster 模式用在 T-io 上

    前言   前几天在学习Redis Cluster 模式的时候,突然想到如果把它的集群模式应用在T-io上也是挺有意思的一件事情. Redis 集群简介    Redis Cluster 中有 N 台实 ...