SSL + LDAP 认证的配置

 
Apache2.2.9 + SSL + LDAP 认证配置目前均在 Windows 2003 上实现,linux 上的实现方式应该类似。

必需软件/系统
  • 附带 openssl 的 apache server 安装程序。
  • 已经配置好并可正常运行的 LDAP 系统,比如 Openldap 或 Sun Directory Server。在此示例中使用的是 Sun Directory Server,OpenLdap 的连接配置应该雷同
  • 已经生成好的服务器证书和密钥,server.crt server.key
配置步骤:
  1. 将 server.crt 和 server.key 放在 conf/ssl 下
  2. 根据以上两个文件的位置修改 conf/extra/http-ssl.conf 的配置
  3. 完成后,运行 bin/httpd 启动 httpd 服务器。浏览器测试 https://localhost 应该成功
  4. 再次打开 conf/extra/http-ssl.conf 添加 LDAP 认证信息,保存并再次运行 https://localhost 应该先出现用户名和密码的提示框。详细配置见后面的内容

配置文件内容:

conf/httpd.conf 相关配置片段

  1. # Secure (SSL/TLS) connections
  2. Include conf/extra/httpd-ssl.conf
  3. #
  4. # Note: The following must must be present to support
  5. #       starting without SSL on platforms with no /dev/random equivalent
  6. #       but a statically compiled-in mod_ssl.
  7. #
  8. <IfModule ssl_module>
  9. SSLRandomSeed startup builtin
  10. SSLRandomSeed connect builtin
  11. </IfModule>


conf/extra/http-ssl.conf


  1. #
  2. # This is the Apache server configuration file providing SSL support.
  3. # It contains the configuration directives to instruct the server how to
  4. # serve pages over an https connection. For detailing information about these 
  5. # directives see <URL:http://httpd.apache.org/docs/2.2/mod/mod_ssl.html>
  6. # Do NOT simply read the instructions in here without understanding
  7. # what they do.  They're here only as hints or reminders.  If you are unsure
  8. # consult the online docs. You have been warned.  
  9. #

  10. #
  11. # Pseudo Random Number Generator (PRNG):
  12. # Configure one or more sources to seed the PRNG of the SSL library.
  13. # The seed data should be of good random quality.
  14. # WARNING! On some platforms /dev/random blocks if not enough entropy
  15. # is available. This means you then cannot use the /dev/random device
  16. # because it would lead to very long connection times (as long as
  17. # it requires to make more entropy available). But usually those
  18. # platforms additionally provide a /dev/urandom device which doesn't
  19. # block. So, if available, use this one instead. Read the mod_ssl User
  20. # Manual for more details.
  21. #
  22. #SSLRandomSeed startup file:/dev/random  512
  23. #SSLRandomSeed startup file:/dev/urandom 512
  24. #SSLRandomSeed connect file:/dev/random  512
  25. #SSLRandomSeed connect file:/dev/urandom 512


  26. #
  27. # When we also provide SSL we have to listen to the 
  28. # standard HTTP port (see above) and to the HTTPS port
  29. #
  30. # Note: Configurations that use IPv6 but not IPv4-mapped addresses need two
  31. #       Listen directives: "Listen [::]:443" and "Listen 0.0.0.0:443"
  32. #
  33. Listen 443

  34. ##
  35. ##  SSL Global Context
  36. #
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值