设为首页 收藏本站
查看: 602|回复: 0

[经验分享] windows下ldap服务器搭建

[复制链接]

尚未签到

发表于 2018-6-15 11:17:10 | 显示全部楼层 |阅读模式
  原文地址: http://mguessan.free.fr/nt/openldap_en.html
  LDAP服务器:http://download.bergmans.us/openldap/openldap-2.2.29/openldap-2.2.29-db-4.3.29-openssl-0.9.8a-win32_Setup.exe
  如果上面的下载不了就用这个路径下载我
  还要修改一个地方:在slapd.conf中把include
  ./schema/core.schema
  改成:
  include ./schema/core.schema
  
include ./schema/cosine.schema
  
include ./schema/misc.schema
  
include ./schema/inetorgperson.schema
  原文:
  Many commercial solutions are available to build an LDAP directory. However most products are either very expensive or not standards compliant (e.g. Active Directory).

  OpenLDAP is an Opensource LDAP server designed for Unix platforms. A Windows>
  Thanks to Lucas Bergman, from FiveSight , such>  For the impatients, or those who don't want to bother with config files, the Ilex company>  Installation
  Download the OpenLDAP installer from: http://download.bergmans.us/openldap/openldap-2.2.29/openldap-2.2.29-db-4.3.29-openssl-0.9.8a-win32_Setup.exe .
  Launch the installer, select language, accept license and choose target installation directory. The default is: c:\Program Files\OpenLDAP . As spaces in directory names usually lead to trouble, choose another place, e.g. c:\openldap .
  Matthias improved the installer to automatically register OpenLDAP as an NT service and install BDB tools. Those are useful to fix a broken database after a system crash.
DSC0000.png

  The installer let you choose service start up mode (auto or manual) and automatically builds a valid configuration. The OpenLDAP start up files are stored in c:\openldap\run , the directory data files end up in c:\openldap\var\openldap-data .
  Configuration
  The main OpenLDAP configuration file is slapd.conf . It has to be customized before launching the server.
  This is just a quick start guide, please have a look at the official OpenLDAP documentation for more information.


  • Specify the Unicode data directory, by default: ./ucdata .
  • Choose the needed LDAP schemas. Schemas define directory structure, like columns and tables in a>
  • Configure the path for OpenLDAP pid and args start up files. The first contains the server pid, the second includes command line arguments.
  • Choose the database type, by default bdb (Berkeley DB).
  • Specify the server suffix. All entries in the directory will have this suffix, which represents the root of the directory tree. For example, with suffix "dc=guessant,dc=org" , the fully qualified name of all entries in the database will end with: dc=guessant,dc=org .
  • Define the name of the administrator entry for the server, named the rootdn , along with its password rootpw . This is the super user of the server. The rootdn name must match the suffix defined above. As stated, all entry names must end with the suffix, and the rootdn is an entry.
  Example configuration file:
  

  
ucdata-path ./ucdata
  
include ./schema/core.schema
  
pidfile ./run/slapd.pid
  
argsfile ./run/slapd.args
  
database bdb
  
suffix "dc=guessant,dc=org"
  
rootdn "cn=Manager,dc=guessant,dc=org"
  
rootpw secret
  
directory ./data
  

  Startup
  The slapd.exe executable is the OpenLDAP server. Double click on this file or launch it from a command line. Do not expect any message, but leave the command window open for the next steps. If you want debug information, use the -d switch:
  

  
slapd -d 1
  

  Server test
  The OpenLDAP command line tools can be used to test the server. The following command executes a search query on the server:
  

  
ldapsearch -x -s base (objectclass=*) namingContexts
  

  Type this command in a cmd window positioned in the OpenLDAP installation directory. For more information on search syntax, try ldapsearch -? .
  In order to ease server administration, you can switch to a graphical LDAP client, such as the LDAP Browser/Editor developed , available at: http://www.ldapbrowser.com/
  Start the client and provide connection information:


DSC0001.jpg
  The connection must succeed, but an error message is displayed in the status bar: List Failed . This error is expected as there is no entry in the database, double click on the message to get more details.
  Build directory content
  In order to insert the first entries in the database, create an init.ldif file and add the following content (according to the configuration specified in slapd.conf):
  

  
dn: dc=guessant,dc=org
  
objectclass: top
  
objectclass: dcObject
  
objectclass: organization
  
o: Guessant
  
dc: guessant
  
dn: cn=Manager,dc=guessant,dc=org
  
objectclass: organizationalRole
  
cn: Manager
  

  Create this file directly in OpenLDAP installation directory or anywhere after adding the installation directory to the system PATH.
  Load entries in directory (adjust slapd.conf and init.ldif files path as needed):
  

  
slapadd -f slapd.conf -l init.ldif
  

  The slapadd command bypasses the LDAP server and applies changes directly to the BDB database. Restart the server to flush its cache.
  Try a new connection with Ldap Browser to check the new entries. A named (i.e. not Anonymous) connection is necessary to add or change entries: uncheck Anonymous Bind and provide User Info.
  According to example configuration, User DN is cn=Manager , check append base DN and use password secret . 不用设置.默认也可以
DSC0002.jpg

  Install as an NT service
  In order to have the server always available, register OpenLDAP as a Windows service. If the option was not checked at installation time, use the following command:
  

  
slapd install
  

  And to remove the service:
  

  
slapd remove
  

  OpenLDAP daemon parameters can be modified by creating registry keys. Create a .reg file with the following content en register keys by double clicking on it:
  

  
REGEDIT4
  
[HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\OpenLDAP-slapd\Parameters]
  
"DebugLevel"=dword:00000000
  
"ConfigFile"=".\\slapd.conf"
  
"Urls"="ldap:///"
  

  See README.txt file included in the distribution for more information on registry keys search algorithm.
  DebugLevel is used to change trace level, ConfigFile is the configuration file path and Urls matches the syntax of the -h command line option.
  For example, set Urls to ldap://localhost:port/ to set a different listen port.

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-524148-1-1.html 上篇帖子: (推荐)Windows Server 2003从入门到精通 下篇帖子: 在Windows2012R2中如何安装IIS8.5-lucky
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表