让apache进行ad认证

公司内网都是通过ad进行认证的,为了方便就想到直接用apache basic认证来做网页的认证,毕竟项目只是内网使用。

首先是要让apache支持perl,这个在ubuntu上很容易

apt-get install libapache2-mod-perl2

接着是安装相关perl认证的模块

cpan -i YAML
cpan -i Apache2::AuthenMSAD
cpan -i Apache2::AuthenNTLM
cpan -i Authen::Simple::Apached

最后在apache配置文件中具体网站配置项中添加如下


PerlAuthenHandler Apache2::AuthenMSAD
PerlSetVar MSADDomain xxxx-inc.com #AD认证域
PerlSetVar MSADServer ad.xxxx.com #AD认证服务器
PerlSetVar MSADBaseDN DC=xxxx-inc,DC=com
AuthName "xxxx-INC AD Authentication" #弹出窗口的显示名字
AuthType Basic
PerlSetVar MSADGroup 'xxxx-sysadmin'
PerlSetVar MSADUser timo
Require valid-user

###########################################

Best regards
Timo Seven
blog:http://www.timoseven.com
twitter: http://twitter.com/zauc
Linux System Admin & MySQL DBA

关于 Timo
XNIX SA & MYSQL DBA

发表评论

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / 更改 )

Twitter picture

You are commenting using your Twitter account. Log Out / 更改 )

Facebook photo

You are commenting using your Facebook account. Log Out / 更改 )

Google+ photo

You are commenting using your Google+ account. Log Out / 更改 )

Connecting to %s

%d 博主赞过: