mod_auth_basic implements the HTTP basic authentication.
conf/mod_auth_basic/mod_auth_basic.conf
Config Item | Description |
---|---|
Basic.DataPath | String path of rule configuration |
Log.OpenDebug | Boolean whether enable debug log Default False |
[basic]
DataPath = mod_auth_basic/auth_basic_rule.data
[log]
OpenDebug = false
Config Item | Description |
---|---|
Version | String Version of config file |
Config | Object Auth rules for each product |
Config{k} | String Product name |
Config{v} | Object A list of auth rules |
Config{v}[] | Object A auth rule |
Config{v}[].Cond | String Condition expression, See Condition |
Config{v}[].UserFile | String Path of password configuration |
Config{v}[].Realm | String Realm, ie. protection space Default "Restricted" |
Description about password configuration:
- The password configuration can be generated using htpasswd or openssl
- Generated using openssl:
printf "user1:$(openssl passwd -apr1 123456)\n" >> ./userfile
- Password configuration example
# user1, 123456
user1:$apr1$mI7SilJz$CWwYJyYKbhVDNl26sdUSh/
user2:{SHA}fEqNCco3Yq9h5ZUglD3CZJT4lBs=:user2, 123456
{
"Config": {
"example_product": [
{
"Cond": "req_host_in(\"www.example.org\")",
"UserFile": "../conf/mod_auth_basic/userfile",
"Realm": "example_product"
}
]
},
Version": "20190101000000"
}