禁止目录浏览,在default设置了没有用。

Web、Mail、Ftp、DNS、Proxy、VPN、Samba、LDAP 等基础网络服务
回复
shgen
帖子: 30
注册时间: 2010-08-18 14:47

禁止目录浏览,在default设置了没有用。

#1

帖子 shgen » 2010-12-17 16:16

在default里:
找到了。
<Directory /var/www/>
Options -Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
对这行:
Options -Indexes FollowSymLinks MultiViews
改了,在indexes前面加了一横,可是还是可以浏览目录。为什么呢?


:em03
头像
hiphen
帖子: 803
注册时间: 2010-08-27 15:53

Re: 禁止目录浏览,在default设置了没有用。

#2

帖子 hiphen » 2010-12-17 18:17

Options FollowSymLinks MultiViews
基础问题,请看入门手册http://people.ubuntu.com/~happyaron/udc-cn/lucid-html/

Acer aspire 4736G / Ubuntu 10.04LTS
Asus eeepc900 / Xandros
Nokia N900 / Maemo 1.2.12
shgen
帖子: 30
注册时间: 2010-08-18 14:47

Re: 禁止目录浏览,在default设置了没有用。

#3

帖子 shgen » 2010-12-20 16:14

这样也不可以的,只有把这行放到相关的主机定义里才行,这比win里烦点。
可能我哪里没有掌握。先这样弄好了。

<VirtualHost 184.82.101.90:80>
ServerName a.aaa.com
ServerAdmin admin@w.com
DocumentRoot "/var/www/a/a"
ErrorLog "/var/log/apache2/errors.log"
CustomLog "/var/log/apache2/accesses.log" common
Options FollowSymLinks
</VirtualHost>
纯白色棉拖
帖子: 6
注册时间: 2010-11-21 16:00

Re: 禁止目录浏览,在default设置了没有用。

#4

帖子 纯白色棉拖 » 2010-12-21 18:40

把 indexes 删掉就可以了,我和你添加虚拟主机的方法不一样 我的 httpd.conf 配置文件时空的。我实在 sites-available 文件夹里面添加的配置文件, 每个网站一个配置文件 方便管理,
回复