This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
packages:apache [2013-06-11 20:13] baggins |
packages:apache [2014-02-27 21:34] glen add ldap sample |
||
---|---|---|---|
Line 16: | Line 16: | ||
Detailed information about upgrading and all changes between apache 2.2 and 2.4 can be found [[https://httpd.apache.org/docs/2.4/upgrading.html|here]] | Detailed information about upgrading and all changes between apache 2.2 and 2.4 can be found [[https://httpd.apache.org/docs/2.4/upgrading.html|here]] | ||
+ | |||
+ | as for more complex examples, require ip or password: | ||
+ | |||
+ | <code apache Apache 2.x> | ||
+ | Order Deny,Allow | ||
+ | Deny from all | ||
+ | |||
+ | Allow from my.lan | ||
+ | Allow from 2001:1234:5678::/64 | ||
+ | |||
+ | AuthType Basic | ||
+ | AuthName www.my.lan | ||
+ | AuthBasicProvider ldap | ||
+ | AuthLDAPURL "ldap://server:389/ou=People,dc=example,dc=com?uid?sub?(objectClass=*)" | ||
+ | Require valid-user | ||
+ | |||
+ | Satisfy Any | ||
+ | </code> | ||
+ | |||
+ | The solution is very simple, just list the requirements and 2.4 somehow magically knows what you mean: | ||
+ | |||
+ | <code apache Apache 2.4> | ||
+ | Require host my.lan | ||
+ | Require ip 2001:1234:5678::/64 | ||
+ | |||
+ | AuthType Basic | ||
+ | AuthName www.my.lan | ||
+ | AuthBasicProvider ldap | ||
+ | AuthLDAPURL "ldap://server:389/ou=People,dc=example,dc=com?uid?sub?(objectClass=*)" | ||
+ | |||
+ | Require valid-user | ||
+ | </code> | ||
+ | |||
+ | Source: http://blog.hqcodeshop.fi/archives/63-Migrating-access-control-into-Apache-2.4.html | ||
===== Apache 2.2 and 2.4 compatible configs ===== | ===== Apache 2.2 and 2.4 compatible configs ===== | ||
Line 28: | Line 62: | ||
<code apache> | <code apache> | ||
- | <IfModule mod_authz_core.c> | + | # Apache 2.x |
- | # Apache 2.4 | + | |
- | Require all granted | + | |
- | </IfModule> | + | |
<IfModule !mod_authz_core.c> | <IfModule !mod_authz_core.c> | ||
Order allow,deny | Order allow,deny | ||
Allow from all | Allow from all | ||
+ | </IfModule> | ||
+ | # Apache 2.4 | ||
+ | <IfModule mod_authz_core.c> | ||
+ | Require all granted | ||
</IfModule> | </IfModule> | ||
</code> | </code> | ||
+ | |||