ZKX's LAB

apache显示目录列表 如何让apache显示目录

2020-09-26知识25

请教apache如何设置才能取消将目录中的内容列表显示出来 修改你的apache配置文件httpd.conf找到Options Indexes FollowSymLinks在Indexes前面加上\"-\"符号!然后重启apache就OK了~

apache显示目录列表 如何让apache显示目录

如何让apache显示目录 1.开启关闭apache 服务器所有网站显示目录的配置方法:打开:/ect/conf/httpd.conf 配置文件OptionsIndexes FollowSymLinks#这样就可以让网站显示目录结果了.Options FollowSymLinks#这样是网站关闭网站显示目录AllowOverride All红色代码中的 Indexes 就是控制 网站是否显示目录的开关.比如:当用户访问http://www.lao8.org/的时候,如果index.php不存在就会显示网站下面的所有目录了,当然正常情况下是关闭的indexs的。2.只让一个网站显示目录的配置方法:打开:apache 解析配置文件(默认是/ect/conf/httpd.conf)80>;ServerAdmin xxx@gmail.com ServerName lao8.orgServerAlias www.lao8.orgDocumentRoot/home/web/lao8_orgErrorLog logs/home/web/lao8_org/log/error_logCustomLog logs/home/web/lao8_org/log/access_log commonOptions Indexes FollowSymLinks#Indexes 表示这个网站可以显示结构目录,要关闭的话去掉Indexes即可.3.可以设置.htaccess文件让网站显示目录这个方法可以让网站某个目录显示文件夹结构,只要在网站想要显示网站结构的文件夹里新建.htaccess 文件,添加下面的代码即可.Options Indexes比如我放在网站的laoxiu目录。

apache显示目录列表 如何让apache显示目录

求助APACHE2.2.*如何禁止显示目录列表 显示的是目录,而不是当前的文件内容,表示你的apache没有默认程序入口文件,也就是”index.php,home.php,index.html”等,也就是需要你在apache的配置文件httpd.conf里面找到:DirectoryIndex index.html index.php index.htm加入你希望程序一进来就执行的页面,以下是本人自己的配置文件,你可以参考一下:Options FollowSymLinks ExecCGI IndexesAllowOverride NoneOrder deny,allowDeny from allSatisfy allDirectoryIndex index.php index.html index.htmAddType allows you to add to or override the MIME configurationfile specified in TypesConfig for specific file types.AddType application/x-gzip.tgzAddEncoding allows you to have certain browsers uncompressinformation on the fly.Note:Not all browsers support this.AddEncoding x-compress.ZAddEncoding x-gzip.gz.tgzIf the AddEncoding directives above are commented-out,then youprobably should define those extensions to indicate media types:AddType application/x-compress.ZAddType application/x-gzip.gz.tgzAddType application/x-httpd-。

apache显示目录列表 如何让apache显示目录

#网站目录#文件目录#apache

随机阅读

qrcode
访问手机版