XAMPP Authentication required

突然发现XAMPP总是莫名其妙的需要验证:

xampp Authentication required!

xampp Authentication required!

访问不存在的链接,不报404,却返回401,搞的人很是郁闷:

 wget http://localhost/in.txt
--2013-08-27 20:09:58--  http://localhost/in.txt
Resolving localhost... 127.0.0.1
Connecting to localhost|127.0.0.1|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://localhost/xampp/ [following]
--2013-08-27 20:09:58--  http://localhost/xampp/
Reusing existing connection to localhost:80.
HTTP request sent, awaiting response... 401 Authorization Required
Authorization failed.

几乎打算重装了。

然而重装也很麻烦,于是去检查conf文件盒error.log,在errror.log里发现大量一样的记录:

[Tue Aug 27 20:09:55 2013] [error] [client 127.0.0.1] Options FollowSymLinks or SymLinksIfOwnerMatch is off which implies that RewriteRule directive is forbidden: D:/xampp/apache/error/HTTP_UNAUTHORIZED.html.var
[Tue Aug 27 20:09:57 2013] [error] [client 127.0.0.1] Options FollowSymLinks or SymLinksIfOwnerMatch is off which implies that RewriteRule directive is forbidden: D:/xampp/apache/error/HTTP_UNAUTHORIZED.html.var
[Tue Aug 27 20:12:24 2013] [error] [client 127.0.0.1] Options FollowSymLinks or SymLinksIfOwnerMatch is off which implies that RewriteRule directive is forbidden: D:/xampp/apache/error/HTTP_UNAUTHORIZED.html.var

百度了一下,是和伪静态有关的,鉴于本机基本也用不到伪静态,就直接注释掉了mod_rewrite,重启apache,结果又是500错误,打开error.log:

[Tue Aug 27 20:14:22 2013] [alert] [client 127.0.0.1] D:/.htaccess: Invalid command 'RewriteCond', perhaps misspelled or defined by a module not included in the server configuration
[Tue Aug 27 20:14:22 2013] [alert] [client 127.0.0.1] D:/.htaccess: Invalid command 'RewriteCond', perhaps misspelled or defined by a module not included in the server configuration

才发现原来是D盘根目录下的.htaccess在作怪。好奇怪,只是在一个盘而已,又没在htdocs目录,居然也可以影响服务器行为(PS:之前搞图片防盗链的时候就被折腾过一回了,.htaccess直接放D盘,结果本地网站全是防盗链图片---怎么就没长记性呢 /kel/ )

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注