English 中文(简体)
阿帕奇方案——不工作的Indexes配置
原标题:Apache Options -Indexes configuration not working

我需要停止在网站上张贴图像目录。 I m 配置一个现场的图像和javascript的无孔径。 我已经做了国家空间活动委员会的组成,并在httpd.conf文档中增加了以下虚拟东道国组合。 但是,如果能够直接进入这一无 co的领域,则将整个目录内容列入其中。 如何解决这一问题?

<VirtualHost ipaddr:80>
    ServerAdmin webmaster@site.com
    ServerName imgs.site.com
    ServerAlias www.imgs.site.com
    DocumentRoot /usr/tomcat/webapps/site/images

    <Directory /usr/tomcat/webapps/site/images>
       Options -Indexes FollowSymLinks
       AllowOverride none
    </Directory>

    CustomLog logs/imgs.site.com_access_log "%h %l %u %t "%r" %>s %b "%{Referer}i" "%{User-agent}i""
    ErrorLog logs/imgs.site.com_error_log 
</VirtualHost>

<VirtualHost ipaddr:80>
    ServerAdmin webmaster@site.com
    ServerName imgs.site.com
    ServerAlias www.imgs.site.com imgs.site.net
    DocumentRoot /usr/tomcat/webapps/site/images

    <Directory /usr/tomcat/webapps/site/images>
       Options -Indexes FollowSymLinks
       AllowOverride none
    </Directory>

    CustomLog logs/imgs.site.com_access_log "%h %l %u %t "%r" %>s %b "%{Referer}i" "%{User-agent}i""
    ErrorLog logs/imgs.site.com_error_log
</VirtualHost>
最佳回答

快速工作是将<代码>index.html文档输入目录,内容武断。 索引将显示该档案的内容而不是目录。

问题回答

我认为,<编码>名录指令中的道路附在上,因此您实际上正在订购。 * E/CN.6/2009/1。 而采用以下配置:

DocumentRoot /usr/tomcat/webapps/site

<Directory ~ "/.*/">
    Options -Indexes
</Directory>

在<代码>/usr/tomcat/webapps/site下,例如:/usr/tomcat/webapps/site/images/code>、/usr/tomcat/webapps/site/fubar/code>下的所有文件夹中,这种编号应为可分的目录。





相关问题
Using SimplePie with CodeIgniter and XAMPP

I am using CodeIgniter 1.7.2 with XAMPP 1.7.2 on a Windows computer. I am trying to make use of SimplePie. I followed all the instructions I could find: a copy of simplepie.inc is in my applications/...

Multiple Sites with common files

I have developed over 50 sites that all use the exact same files other than CSS and IMAGES, I currently duplicate the files each time I create a new site and upload different css and images. What ...

http server validation

I finish a litle http server, writing from scratch. I would like to be sure that my imlementation is conforme to the HTTP specifications. W3C give us tools for HTML/XML conformance, but i see nothing ...