| | 34 | If you're using Apache 2.2, you'll need to take a couple extra steps. |
|---|
| | 35 | |
|---|
| | 36 | You'll need to ensure that ``mod_auth_basic`` and ``mod_authz_user`` |
|---|
| | 37 | are loaded. These might be compiled staticly into Apache, or you might |
|---|
| | 38 | need to use ``LoadModule`` to load them dynamically (as shown in the |
|---|
| | 39 | example at the bottom of this note). |
|---|
| | 40 | |
|---|
| | 41 | You'll also need to insert configuration directives that prevent Apache |
|---|
| | 42 | from trying to use other authentication modules. Depnding on which other |
|---|
| | 43 | authentication modules you have loaded, you might need one or more of |
|---|
| | 44 | the following directives:: |
|---|
| | 45 | |
|---|
| | 46 | AuthBasicAuthoritative Off |
|---|
| | 47 | AuthDefaultAuthoritative Off |
|---|
| | 48 | AuthzLDAPAuthoritative Off |
|---|
| | 49 | AuthzDBMAuthoritative Off |
|---|
| | 50 | AuthzDefaultAuthoritative Off |
|---|
| | 51 | AuthzGroupFileAuthoritative Off |
|---|
| | 52 | AuthzOwnerAuthoritative Off |
|---|
| | 53 | AuthzUserAuthoritative Off |
|---|
| | 54 | |
|---|
| | 55 | A complete configuration, with differences between Apache 2.0 and |
|---|
| | 56 | Apache 2.2 marked in bold, would look something like: |
|---|
| | 57 | |
|---|
| | 58 | .. parsed-literal:: |
|---|
| | 59 | |
|---|
| | 60 | **LoadModule auth_basic_module modules/mod_auth_basic.so** |
|---|
| | 61 | **LoadModule authz_user_module modules/mod_authz_user.so** |
|---|
| | 62 | |
|---|
| | 63 | ... |
|---|
| | 64 | |
|---|
| | 65 | <Location /exmaple/> |
|---|
| | 66 | AuthType Basic |
|---|
| | 67 | AuthName "example.com" |
|---|
| | 68 | **AuthBasicAuthoritative Off** |
|---|
| | 69 | Require valid-user |
|---|
| | 70 | |
|---|
| | 71 | SetEnv DJANGO_SETTINGS_MODULE mysite.settings |
|---|
| | 72 | PythonAuthenHandler django.contrib.auth.handlers.modpython |
|---|
| | 73 | </Location> |
|---|
| | 74 | |
|---|