Apache2.4 authz_core_module模块使用
| Description: | Core Authorization |
|---|---|
| Status: | Base |
| Moduledentifier: | authz_core_module |
| Sourceile: | mod_authz_core.c |
| Compatibility: | Available in Apache HTTPD 2.3 and later |
这个模块提供了核心授权功能,通过身份验证的用户可以允许或拒绝访问部分网站。mod_authz_core各种授权提供程序提供了注册的功能。它通常是 与
身份验证提供者模块一起使用,如mod_authn_file mod_authz_user等和授权模块。它还允许高级逻辑应用于授权处理。
Example
下面的示例创建两个不同的ldap授权供应商基于ldap-group授权提供者的别名。这个示例允许一个授权的位置检查主机内部多个ldap组成员:
<AuthzProviderAlias ldap-group ldap-group-alias1 cn=my-group,o=ctx>
AuthLDAPBindDN cn=youruser,o=ctx
AuthLDAPBindPassword yourpassword
AuthLDAPURL ldap://ldap.host/o=ctx
</AuthzProviderAlias> <AuthzProviderAlias ldap-group ldap-group-alias2 cn=my-other-group,o=dev>
AuthLDAPBindDN cn=yourotheruser,o=dev
AuthLDAPBindPassword yourotherpassword
AuthLDAPURL ldap://other.ldap.host/o=dev?cn
</AuthzProviderAlias> Alias /secure /webpages/secure
<Directory /webpages/secure>
Require all granted AuthBasicProvider file AuthType Basic
AuthName LDAP_Protected_Place #implied OR operation
Require ldap-group-alias1
Require ldap-group-alias2
</Directory>
Authorization Containers
授权容器指令< RequireAll >、< RequireAny >和< RequireNone >可以相互结合,需要指令来表达复杂的授权逻辑。
下面的例子表达以下授权逻辑。为了访问资源,用户必须是superadmin用户,或者是管理组和管理员LDAP组和属于销售组或LDAP属性销售部门。此外,为了访问资源,用户必须不属于临时工组或LDAP组临时员工。
<Directory /www/mydocs>
<RequireAll>
<RequireAny>
Require user superadmin
<RequireAll>
Require group admins
Require ldap-group cn=Administrators,o=Airius
<RequireAny>
Require group sales
Require ldap-attribute dept="sales"
</RequireAny>
</RequireAll>
</RequireAny>
<RequireNone>
Require group temps
Require ldap-group cn=Temporary Employees,o=Airius
</RequireNone>
</RequireAll>
</Directory>
mod_authz_core提供了一些通用的授权提供程序可用于的指令。
Require env
env提供者允许访问控制服务器基于一个环境变量的存在。当需要指定env这个env-variable时候,然后请求被允许访问环境变量是否env-variable存在。服务器能够以灵活的方式设置环境变量基于客户机请求的特性使用 mod_setenvif提供的指令。因此,该指令可用于允许访问基于等因素客户用户代理(浏览器类型),推荐人或其他HTTP请求头字段。
SetEnvIf User-Agent ^KnockKnock/\. let_me_in
<Directory /docroot>
Require env let_me_in
</Directory>
在这种情况下,浏览器的用户代理字符串,KnockKnock / 2.0将被允许访问,和其他所有人将被拒绝。
当 服务器查找路径通过寻找等内部subrequest DirectoryIndex mod_autoindex或生成一个目录清单,每请求subrequest环境变量并不是遗传的。此外,SetEnvIf指令不单独评估 subrequest由于API阶段mod_setenvif所使用。
Apache2.4 authz_core_module模块使用的更多相关文章
- apache2服务器mod_rewrite模块 开启方法[linux, ubuntu]
在UBUNTU系统中要启用mod_rewrite的方法有两种: 第一种: 在终端中执行 sudo a2enmod rewrite 指 令后,即启用了 Mod_rewrite 模块, apache2服务 ...
- Ubuntu 14 中给 APACHE2安装 SSL 模块 Enable SSL site on Ubuntu 14 LTS, Apache 2.4.7:
Ubuntu 14 中给 APACHE2安装 SSL 模块 Enable SSL site on Ubuntu 14 LTS, Apache 2.4.7: 参考 http://blog.csdn.ne ...
- ubuntu apache2 流量限制模块
mod-bw is an Apache 2 module provided to solve the problem of limiting users’ and virtual hosts’ ban ...
- Ubuntu-server 下Apache2 配置.htaccess 隐藏thinkPHP项目index.php
需要开启Apache2的rewrite模块 1.打开/etc/apache2/apache2.conf 将文件中的AllowOverride None改为AllowOverride All 2.修改m ...
- 转 - ubuntu apache2下目录结构
ubuntu apache2下目录结构 原文:http://blog.csdn.net/jibcy/article/details/8060651 在Windows下,Apache的配置文件通常只有一 ...
- Ubuntu 下apache2开启rewrite隐藏index.php
为了实现 http://www.example.com/route/route 而不是 http://www.example.com/index.php/route/route 需要开启apache2 ...
- ubuntu apache开启重写模块
http://www.iblue.cc/2011/09/ubuntu-apache%E5%BC%80%E5%90%AF%E9%87%8D%E5%86%99%E6%A8%A1%E5%9D%97/ Ubu ...
- SVN-服务器搭建、apache2整合、eclipse使用
如题,分成3个部分: 1.SVN服务器搭建.操作系统Ubuntu 14.04.2 LTS.具体方法度娘很多,不再细数. 安装:sudo apt-get install subversion 创建版本库 ...
- apache动态添加模块
Apache已经安装完毕并投入运行,但是后来却发现部分模块没有加载,当然有两个方法: 1. 一是完全重新编译Apache, 再安装 2. 编译模块为SO文件,使用LoadModule指令加载扩展模块. ...
随机推荐
- 关于Django中路由层(URL-conf)
关于路由层 路由层其实就是项目中urls.py那个文件,那里面存放着url和视图函数的对应关系它的本质是URL与要为该URL调用的视图函数之间的映射表:你就是以这种方式告诉Django,对于客户端发来 ...
- python3 repr()函数笔记
a=[1,2,3,4]print(repr(a))print(type(repr(a)))for i in repr(a): print(i)#repr函数是将对象转换成string类型
- Nginx配置SSL报错 nginx: [emerg] unknown directive "ssl"
Nginx配置SSL报错 nginx: [emerg] unknown directive "ssl" 出现如图所示错误,处理办法如下 去nginx解压目录下执行 ./co ...
- 练习六十七:HTML练习
题目:一个html文件,找出里面的链接 代码: from html.parser import HTMLParser import urllib.request class myhtml(HTMLPa ...
- 页面中使用多个element-ui upload上传组件时绑定对应元素
elemet-ui里提供的upload文件上传组件,功能很强大,能满足单独使用的需求,但是有时候会存在多次复用上传组件的需求,如下图的样子,这时候就出现了问题,页面上有多个上传组件时,要怎么操作呢? ...
- 9-----BBS论坛
BBS论坛(九) 9.1.权限和角色模型定义 (1)cms/models class CMSPermission(object): ALL_PERMISSION = 0b11111111 # 1.访问 ...
- 在本地安装oracle-maven库
mvn install:install-file -DgroupId=com.oracle -DartifactId=ojdbc14 -Dversion=10.2.0.4.0 -Dpackaging= ...
- 输入http://localhost/,apache出现You don't have permission to access/on this server.的提示,如何解决?
本地搭建wamp,输入http://127.0.0.1访问正常,当输入http://localhost/,apache出现You don't have permission to access/on ...
- Linux 进程间通信之管道(pipe),(fifo)
无名管道(pipe) 管道可用于具有亲缘关系进程间的通信,有名管道克服了管道没有名字的限制,因此,除具有管道所具有的功能外,它还允许无亲缘关系进程间的通信: 定义函数: int pipe(int f ...
- 输入一个正整数n (1<n<=10),生成 1个 n*n 方阵 求出对角线之和
#define _CRT_SECURE_NO_WARNINGS #include <Windows.h> #include <stdio.h> #include <std ...