Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to accomplish "AuthType None" in Apache 2.2

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>
like image 300
Technorati Avatar asked Apr 14 '10 23:04

Technorati


2 Answers

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>
like image 57
Frank Henard Avatar answered Sep 29 '22 00:09

Frank Henard


You just need to set Allow from all and Satisfy Any

This worked for me:

Alias /example "/opt/example.com"

<Directory "/opt/example.com">
  Options None
  AllowOverride None
  Order allow,deny
  Allow from all
  Satisfy Any
</Directory>
like image 32
Gustavo Soares Avatar answered Sep 28 '22 22:09

Gustavo Soares