基于Apache2的windows集成认证

本文介绍如何使用AuthenNTLM为Apache2配置NTLM集成认证。步骤包括安装必要的Perl模块、下载并编译AuthenNTLM、配置Apache以启用KeepAlive等功能、设置NTLM认证参数等。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

昨天占了个坑, 今天来编辑


我这次选用的是AuthenNTLM来做Apache2的集成认证工具


1. 安装Perl 模块用于编译安装 AuthenNTLM (我的OS是Ubuntu)
        aptitude install libapache2-mod-perl

2. 下载AuthenNTLM

http://search.cpan.org/~speeves/Apache-AuthenNTLM-2.10

过程很common

make

make install


3.    安装

aptitude install libapache2-authenntlm-perl
 

4.    Edit the Apache configuration and enable KeepAlive  /etc/apache2/apche2.conf

KeepAlive On

 

5.   在hosts(/etc/hosts)文件中 编辑PDC (原因: NTLM只能识别不超过16字节的域名)

172.16.5.1      PDC01

6.    In /etc/apache2/sites-available/000-default add:


 Alias /iwa "/home/yangchun/yangchun_kss/iwa/"
    <Location "/iwa">
        # Enable the Authentication module
        PerlAuthenHandler Apache2::AuthenNTLM

        # Do NTLM and basic authentication
        AuthType ntlm,basic

        # The name that should be displayed in the Auth box, if NTLM fails.
        # This will not succeed on our setup where apache is not configured to authenticate on its own
        AuthName hengtiansoftcom

        # Ask for a valid user.
        require valid-user

        #                    domain      pdc         bdc
        # Domain : Your windows domain
        # pdc : Primary Domain Controller
        # bdc : Backup Domain controller.
        #
        # Note : Multiple domains can be specified.

        #PerlAddVar ntdomain  "OURDOMAIN  domainpdc domainsdc"
        PerlAddVar ntdomain  "Domain PDC01 PDC02"

        # What should be the default domain
        PerlSetVar defaultdomain Domain

        # The user names are in the form "OURDOMAIN\user_name". Let us split it.
        PerlSetVar splitdomainprefix 1

        # Set the debug variables
        PerlSetVar ntlmdebug 0
        PerlSetVar ntlmauthoritative off

   </Location>

7 重启, 这样可以得到REMOTE_USER 变量用于验证

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值