如何实现与QUOT;没有进行AuthType"在Apache 2.2的 [英] How to accomplish "AuthType None" in Apache 2.2
问题描述
<一个href=\"http://httpd.apache.org/docs/trunk/mod/mod_authn_core.html#authtype\">http://httpd.apache.org/docs/trunk/mod/mod_authn_core.html#authtype关于无AuthType选项会谈,并具有正是我需要做一个真棒例子 - 不幸的是,这似乎是新的2.3 / 2.4。是否有任何等效功能在2.2?
认证类型无禁用
验证。当认证
启用,它通常是由遗传
每个后续配置部分,
除非一个不同的身份验证类型
被指定。如果没有认证
期望的一个第
认证部,该
身份验证类型无可以使用;
在下面的例子中,客户端可
访问/ WWW /文档/ public目录
无验证:&LT;目录/ WWW /文档&GT;
AuthType选项基本
AuthName指令文件
AuthBasicProvider文件
AuthUserFile文件在/ usr /本地/ Apache / passwd文件/密码
需要有效的用户
&LT; /目录&GT;&LT;目录/ WWW /文档/公共&GT;
AuthType选项无
要求所有批准
&LT; /目录&GT;
块引用>解决方案像下面的东西对我的作品与Apache 2.2。我把它从<一个href=\"http://httpd.apache.org/docs/2.2/mod/core.html#require\">http://httpd.apache.org/docs/2.2/mod/core.html#require
&LT;目录/ WWW /文档&GT;
AuthType选项基本
AuthName指令文件
AuthBasicProvider文件
AuthUserFile文件在/ usr /本地/ Apache / passwd文件/密码
需要有效的用户
&LT; /目录&GT;
&LT;目录/ WWW /文档/公共&GT;
#所有访问控制和认证被禁用
#此目录中
满足任何
所有允许
&LT; /目录&GT;http://httpd.apache.org/docs/trunk/mod/mod_authn_core.html#authtype talks about "AuthType None", and has an awesome example of exactly what I need to do - unfortunately, it appears to be new to 2.3/2.4. Is there any equivalent feature in 2.2?
The authentication type None disables authentication. When authentication is enabled, it is normally inherited by each subsequent configuration section, unless a different authentication type is specified. If no authentication is desired for a subsection of an authenticated section, the authentication type None may be used; in the following example, clients may access the /www/docs/public directory without authenticating:
<Directory /www/docs> AuthType Basic AuthName Documents AuthBasicProvider file AuthUserFile /usr/local/apache/passwd/passwords Require valid-user </Directory> <Directory /www/docs/public> AuthType None Require all granted </Directory>
解决方案Something like below works for me with apache 2.2. I took it from http://httpd.apache.org/docs/2.2/mod/core.html#require
<Directory /www/docs> AuthType Basic AuthName Documents AuthBasicProvider file AuthUserFile /usr/local/apache/passwd/passwords Require valid-user </Directory> <Directory /www/docs/public> # All access controls and authentication are disabled # in this directory Satisfy Any Allow from all </Directory>
这篇关于如何实现与QUOT;没有进行AuthType&QUOT;在Apache 2.2的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!