我真的可以使用一些帮助来解决看似微不足道的问题。总之,我想知道在 Windows 环境中访问在 Apache 中运行的 Perl .cgi 的用户的 Window 登录 ID。
这是我的基本 Apache2 conf 添加:
---- 开始 httpd.conf -----
...
LoadModule sspi_auth_module modules/mod_auth_sspi.so
...
<IfModule mod_auth_sspi.c>
<Location "C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin">
AuthName "A Protected Place"
AuthType SSPI
SSPIAuth On
SSPIAuthoritative On
#SSPIBasic On
SSPIOfferBasic On
#SSPIDomain On
#SSPIBasicPreferred
#SSPIUsernameCase lower
require valid-user
</Location>
</IfModule>
...
<Directory "C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin">
AllowOverride None
Order allow,deny
Allow from all
</Directory>
...
---- 结束 httpd.conf -----
此外,我还使用以下出色说明在我的机器上启用了 SSL:http: //tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-serversetup.html#tsvn-serversetup-apache-7
上面的站点要求加载 Apache 模块 mod_auth.so,但我在我的默认 Apache2 安装中找不到它。此外,如您所见,我已将 mod_auth_sspi-1.0.4-2.2.2 模块手动添加到我的 Apache2 环境中。
现在,当我同时尝试http://localhost/cgi-bin/test.cgi和https://localhost/cgi-bin/test.cgi时,我在 http/ 中看不到 REMOTE_USER 的任何内容环境变量。我知道 SSL 正在工作,因为 https 调用显示了大量 SSL 变量。另外,我对 SSL 没有要求,但我只使用它,因为上面的链接说它是获取 Windows 登录信息所必需的。
我真的很感激任何见解。如果有帮助,我很乐意完整分享 httpd.conf 文件。基本上,重申一下,我正在寻找的只是一种在 Windows/Apache2.2 托管环境中捕获我的 Perl .cgi 中的 Windows loginID 的方法。
非常感谢大家的帮助,
猎犬加尼