我们在CentOS 5.5
Linux上的Apache / 2.2.19上为.html文件配置了一个带SSI的网站.工作正常,但偶尔会获得403的根页面(index.html作为目录索引).页面工作时没有文件系统更改,不起作用然后再次工作.
当它不起作用时,就好像Apache已经确定index.html文件不存在所以尝试提供目录列表,但我们的配置故意拒绝这样做.
Apache virtualhost特定错误日志包含以下条目:
[Tue Aug 09 03:10:47 2011] [error] [client 66.249.72.3] Directory index forbidden by Options directive: /main/directory/
Apache virtualhost特定访问日志包含以下条目:
66.249.72.3 - - [09/Aug/2011:03:10:47 +0100] "GET / HTTP/1.1" 403 230 "-" "SAMSUNG-SGH-E250/1.0 Profile/MIDP-2.0 Configuration/CLDC-1.1 UP.browser/6.2.3.3.c.1.101 (GUI) MMP/2.0 (compatible; Googlebot-Mobile/2.1; +http://www.google.com/bot.html)"
总体分布:
# fgrep 'GET / ' `ls -tr domain-access_log*` | cut -d ' ' -f 9 | sort | uniq -c 1339 200 1 206 31 304 29 403
Apache配置看起来像lke:
<VirtualHost ip.address:80> ServerName domain.here DocumentRoot /main/directory ErrorLog logs/domain-error_log CustomLog logs/domain-access_log combined DirectoryIndex index.html AliasMatch ^/(robots\.txt|sitemap.*\.xml(?:\.gz)?)$/other/directory/$1 CacheEnable disk / Cachedisable /sitemap.xml.gz Cachedisable /robots.txt CacheIgnoreHeaders Set-Cookie CacheIgnoreNoLastMod On AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css application/x-javascript <Directory /main/directory> Options Includes AddOutputFilter INCLUDES .html Order allow,deny Allow from all </Directory> <Directory /other/directory> Order allow,deny Allow from all </Directory> </VirtualHost>
解决方法
原文地址:https://www.jb51.cc/linux/397789.html
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。