看板FreeBSD
标 题Re: 网页被看光光了
发信站National Sun-Yet-San University (Mon Jan 3 12:24:09 2005)
转信站ptt!ctu-reader!ctu-peer!news.nctu!nctumenews!news.ind.ntou!news.ntu!cb
> 请爬文 【请问】如何让网页不会显示目录内的档案??
综合爬文结果,重点有4:
1.)删除indexes即可,但记得重新启动apache
2.) chmod o-r 目录/ 就好啦
3.)不想改或无权限改设定档就将一个空白档存成 index 档就好了吗
4.)在 /home/www 下新增 .htaccess
vi .htaccess
Options -Indexes
目前实验结果就只设空的 index.html 才得以达成
既然以空的 index.html 就能达成,那理应在 http.conf 里就能控制选项才对
以下是我的操作
一、vi /usr/local/etc/apache2/httpd.conf
把原来的 Options Indexes FollowSymLinks 改为
......
Options FollowSymLinks
或Options SymLinksifOwnerMatch
或Options ExecCGI
或Options MultiViews
或Options All
或Options None
或Options All -Indexes
.......
# /usr/local/etc/rc.d/apache2.sh restart 重启动
情况依旧
二、在 /usr/local/www/ 下建立 .htaccess
或在/usr/local/www/data 下建立 .htaccess
# /usr/local/etc/rc.d/apache2.sh restart 重启动
情况依旧
三、如果在 user 下建一空白的 index.html 就能达成让网页不会显示目录内的档案
四、前 2.) chmod o-r 目录/ 不想更改
五、http.conf 应该可以设定,很不信邪!