{"id":4190,"date":"2014-10-17T15:58:59","date_gmt":"2014-10-17T07:58:59","guid":{"rendered":"http:\/\/www.hmouse2.tk\/?p=4190"},"modified":"2014-10-24T13:58:24","modified_gmt":"2014-10-24T05:58:24","slug":"ldap%e7%9a%84%e5%ae%89%e8%a3%85%e5%92%8c%e9%85%8d%e7%bd%ae","status":"publish","type":"post","link":"https:\/\/www.hmouse.cn\/?p=4190","title":{"rendered":"LDAP\u7684\u5b89\u88c5\u548c\u914d\u7f6e"},"content":{"rendered":"<p>\u53c2\u8003url\uff1a<a title=\"http:\/\/my.oschina.net\/aiguozhe\/blog\/151554\" href=\"http:\/\/my.oschina.net\/aiguozhe\/blog\/151554\">http:\/\/my.oschina.net\/aiguozhe\/blog\/151554<\/a><\/p>\n<p>\u7f51\u4e0a\u53d1\u73b0\u5f88\u591a\u5b89\u88c5\u7684\u6587\u6863\uff0c\u5f88\u591a\u90fd\u662f\u4e0d\u53ef\u4ee5\u7528\u7684\uff0c\u6240\u4ee5\u81ea\u5df1\u6574\u7406\u4e86\u4e0b\u3002\u6bd4\u8f83\u9760\u8c31\u7684\u5c31\u662f\u8fd9\u4e2a\u53c2\u8003url\u7684\u8bf4\u6cd5\u3002<\/p>\n<p>centos \u4e3b\u8981\u7684\u5c31\u662fopenldap\uff0c\u8fd9\u4e2a\u5b89\u88c5\u7528yum\u7684\u8bdd\u5f88\u7b80\u5355\u3002<\/p>\n<p>yum install openldap openldap-servers openldap-clients -y<\/p>\n<p>\u914d\u7f6e<\/p>\n<p><code>cp<\/code> <code>\/usr\/share\/openldap-servers\/slapd<\/code><code>.conf.obsolete <\/code><code>\/etc\/openldap\/slapd<\/code><code>.conf<\/code> <\/p>\n<p><code>cp<\/code> <code>\/usr\/share\/openldap-servers\/DB_CONFIG<\/code><code>.example <\/code><code>\/var\/lib\/ldap\/DB_CONFIG<\/code> <\/p>\n<p><code>mv<\/code> <code>\/etc\/openldap\/slapd<\/code><code>.d{,.bak}<\/code> <\/p>\n<p>\u4e5f\u8bb8\u4f60\u5df2\u7ecf\u731c\u5230\uff0cslapd.conf\u662fOpenLDAP\u7684\u914d\u7f6e\u6587\u4ef6\u3002\u4e0b\u9762\u5bf9slapd.conf\u7684\u4e00\u4e9b\u914d\u7f6e\u9879\u505a\u4e9b\u8bf4\u660e\uff1a <\/p>\n<p>cat \/etc\/openldap\/slapd.conf | grep -v &#8220;#&#8221; <\/p>\n<p>############# <\/p>\n<p>include&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \/etc\/openldap\/schema\/corba.schema<br \/>include&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \/etc\/openldap\/schema\/core.schema<br \/>include&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \/etc\/openldap\/schema\/cosine.schema<br \/>include&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \/etc\/openldap\/schema\/duaconf.schema<br \/>include&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \/etc\/openldap\/schema\/dyngroup.schema<br \/>include&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \/etc\/openldap\/schema\/inetorgperson.schema<br \/>include&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \/etc\/openldap\/schema\/java.schema<br \/>include&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \/etc\/openldap\/schema\/misc.schema<br \/>include&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \/etc\/openldap\/schema\/nis.schema<br \/>include&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \/etc\/openldap\/schema\/openldap.schema<br \/>include&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \/etc\/openldap\/schema\/ppolicy.schema<br \/>include&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \/etc\/openldap\/schema\/collective.schema<\/p>\n<p>allow bind_v2<\/p>\n<p>pidfile&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \/var\/run\/openldap\/slapd.pid<br \/>argsfile&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \/var\/run\/openldap\/slapd.args<\/p>\n<p>&nbsp;<\/p>\n<p>TLSCACertificatePath \/etc\/openldap\/certs<br \/>TLSCertificateFile &#8220;\\&#8221;OpenLDAP Server\\&#8221;&#8221;<br \/>TLSCertificateKeyFile \/etc\/openldap\/certs\/password<\/p>\n<p>&nbsp;<\/p>\n<p>database config<br \/>access to *<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; by dn.exact=&#8221;gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth&#8221; manage<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; by * none<\/p>\n<p>database monitor<br \/>access to *<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; by dn.exact=&#8221;gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth&#8221; read<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; by dn.exact=&#8221;cn=admin,dc=my-domain,dc=com&#8221; read<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; by * none<\/p>\n<p>database&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bdb<br \/>suffix&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8220;dc=test,dc=com&#8221;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #\u81ea\u5df1\u5b9a\u4e49\u7684dc<br \/>checkpoint&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1024 15<br \/>rootdn&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8220;cn=admin,dc=test,dc=com&#8221; #\u81ea\u5df1\u5b9a\u4e49\u7ba1\u7406\u5458<br \/>rootpw&nbsp; {SSHA}KFAXZdD60RR0I4YmajnX4nQh263Wozh8&nbsp; #\u81ea\u5df1\u5b9a\u4e49\u5bc6\u7801&nbsp; \u53ef\u4ee5\u660e\u6587\u6216\u8005\u7528slappasswd\u52a0\u5bc6<\/p>\n<p>directory&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \/var\/lib\/ldap<\/p>\n<p>index objectClass&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; eq,pres<br \/>index ou,cn,mail,surname,givenname&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; eq,pres,sub<br \/>index uidNumber,gidNumber,loginShell&nbsp;&nbsp;&nbsp; eq,pres<br \/>index uid,memberUid&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; eq,pres,sub<br \/>index nisMapName,nisMapEntry&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; eq,pres,sub<\/p>\n<p><code>\u7136\u540e\u542f\u52a8ldap\uff0c\/etc\/init.d\/slapd start<\/code> <\/p>\n<p><code>\u7136\u540e\u9700\u8981\u5bfc\u5165\u4e00\u4e2aldif\uff0c\u5426\u5219\u65e0\u6cd5\u4f7f\u7528\uff0c\u6211\u5728\u770b\u7f51\u4e0a\u5f88\u591a\u7684\u4f1a\u5c06admin\u4e5f\u5199\u8fdb\u53bb\u5bfc\u5165\uff0c\u53cd\u800c\u62a5\u9519\uff0c\u540e\u6765\u6211\u4fee\u6539\u4e86\u4e0b\u3002<\/code> <\/p>\n<p>[root@localhost ldap]# cat test.ldif<\/p>\n<p>dn:dc=test,dc=com<br \/>objectclass:dcObject<br \/>objectclass:organization<br \/>o:Example, Inc.<\/p>\n<p>\u7136\u540e\u5bfc\u5165\u65e2\u53ef\u4f7f\u7528<\/p>\n<p>ldapadd -x -D &#8220;cn=admin,dc=test,dc=com&#8221; -W -f test.ldif<\/p>\n<p>\u8fd9\u91cc\u63a8\u83502\u4e2a\u5ba2\u6237\u7aef<\/p>\n<p>1\uff1aphpldapadmin<\/p>\n<p>\u5b89\u88c5\u76f4\u63a5yum\u5373\u53ef\uff0c\u914d\u7f6e\u7684\u65f6\u5019\u6ce8\u610f\u4e0bconfig<\/p>\n<p>$servers-&gt;newServer(&#8216;ldap_pla&#8217;);<br \/>$servers-&gt;setValue(&#8216;server&#8217;,&#8217;name&#8217;,&#8217;LDAP Server&#8217;);<br \/>$servers-&gt;setValue(&#8216;server&#8217;,&#8217;host&#8217;,&#8217;127.0.0.1&#8242;);<br \/>$servers-&gt;setValue(&#8216;server&#8217;,&#8217;port&#8217;,389);<br \/>$servers-&gt;setValue(&#8216;server&#8217;,&#8217;base&#8217;,array(&#8216;dc=test,dc=com&#8217;));<br \/>$servers-&gt;setValue(&#8216;login&#8217;,&#8217;auth_type&#8217;,&#8217;cookie&#8217;);<br \/>$servers-&gt;setValue(&#8216;login&#8217;,&#8217;bind_id&#8217;,&#8217;cn=admin,dc=test,dc=com&#8217;);<br \/>$servers-&gt;setValue(&#8216;login&#8217;,&#8217;bind_pass&#8217;,&#8217;test&#8217;);<br \/>$servers-&gt;setValue(&#8216;server&#8217;,&#8217;tls&#8217;,false);<\/p>\n<p>\u6ce8\u610f\u5c06\u6ce8\u91ca\u7b26\u53f7\u53bb\u6389\u3002<\/p>\n<p><a href=\"https:\/\/www.hmouse.cn\/wp-content\/uploads\/2014\/10\/image1.png\"><img loading=\"lazy\" decoding=\"async\" title=\"image\" style=\"border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; border-left: 0px; display: inline; padding-right: 0px\" border=\"0\" alt=\"image\" src=\"https:\/\/www.hmouse.cn\/wp-content\/uploads\/2014\/10\/image_thumb1.png\" width=\"244\" height=\"102\"><\/a><\/p>\n<p>2\uff1a<a href=\"http:\/\/www.google.com.hk\/url?sa=t&amp;rct=j&amp;q=&amp;esrc=s&amp;source=web&amp;cd=1&amp;ved=0CB4QFjAA&amp;url=http%3A%2F%2Fwww.ldapbrowser.com%2F&amp;ei=MOpJVPLtBZfr8AXMhYDoAw&amp;usg=AFQjCNFjLUJT0v2vKflTf21kCTnbP-9O5Q&amp;bvm=bv.77880786,d.dGc&amp;cad=rjt\">Softerra LDAP Administrator<\/a><\/p>\n<p>\u53bb<a title=\"http:\/\/www.ldapbrowser.com\/\" href=\"http:\/\/www.ldapbrowser.com\/\">http:\/\/www.ldapbrowser.com\/<\/a>\u4e0b\u8f7d\u5373\u53ef\uff0cwindows\u4e0b\u5f88\u597d\u4f7f\u7528\uff0c\u914d\u7f6e\u4e5f\u7b80\u5355\uff0c\u53ef\u4ee5\u81ea\u5df1\u5c1d\u8bd5\u4e0b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u53c2\u8003url\uff1a<a title=\"http:\/\/my.oschina.net\/aiguozhe\/blog\/151554\" href=\"http:\/\/my.oschina.net\/aiguozhe\/blog\/151554\">http:\/\/my.oschina.net\/aiguozhe\/blog\/151554<\/a><\/p>\n<p>\u7f51\u4e0a\u53d1\u73b0\u5f88\u591a\u5b89\u88c5\u7684\u6587\u6863\uff0c\u5f88\u591a\u90fd\u662f\u4e0d\u53ef\u4ee5\u7528\u7684\uff0c\u6240\u4ee5\u81ea\u5df1\u6574\u7406\u4e86\u4e0b\u3002\u6bd4\u8f83\u9760\u8c31\u7684\u5c31\u662f\u8fd9\u4e2a\u53c2\u8003url\u7684\u8bf4\u6cd5\u3002<\/p>\n<p>centos \u4e3b\u8981\u7684\u5c31\u662fopenldap\uff0c\u8fd9\u4e2a\u5b89\u88c5\u7528yum\u7684\u8bdd\u5f88\u7b80\u5355\u3002<\/p>\n<p>yum install openldap openldap-servers openldap-clients -y<\/p>\n<p>\u914d\u7f6e<\/p>\n<p><code>cp<\/code> <code>\/usr\/share\/openldap-servers\/slapd<\/code><code>.conf.obsolete <\/code><code>\/etc\/openldap\/slapd<\/code><code>.conf<\/code> <\/p>\n<p><code>cp<\/code> <code>\/usr\/share\/openldap-servers\/DB_CONFIG<\/code><code>.example <\/code><code>\/var\/lib\/ldap\/DB_CONFIG<\/code> <\/p>\n<p><code>mv<\/code> <code>\/etc\/openldap\/slapd<\/code><code>.d{,.bak}<\/code> <\/p>\n<p>\u4e5f\u8bb8\u4f60\u5df2\u7ecf\u731c\u5230\uff0cslapd.conf\u662fOpenLDAP\u7684\u914d\u7f6e\u6587\u4ef6\u3002\u4e0b\u9762\u5bf9slapd.conf\u7684\u4e00\u4e9b\u914d\u7f6e\u9879\u505a\u4e9b\u8bf4\u660e\uff1a <\/p>\n<p>cat \/etc\/openldap\/slapd.conf | grep -v &#8220;#&#8221; <\/p>\n<p>############# <\/p>\n<p>include&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \/etc\/openldap\/schema\/corba.schema<br \/>include&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \/etc\/openldap\/schema\/core.schema<br \/>include&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \/etc\/openldap\/schema\/cosine.schema<br \/>include&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \/etc\/openldap\/schema\/duaconf.schema<br \/>include&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \/etc\/openldap\/schema\/dyngroup.schema<br \/>include&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \/etc\/openldap\/schema\/inetorgperson.schema<br \/>include&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \/etc\/openldap\/schema\/java.schema<br \/>include&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \/etc\/openldap\/schema\/misc.schema<br \/>include&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \/etc\/openldap\/schema\/nis.schema<br \/>include&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \/etc\/openldap\/schema\/openldap.schema<br \/>include&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \/etc\/openldap\/schema\/ppolicy.schema<br \/>include&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \/etc\/openldap\/schema\/collective.schema<\/p>\n<p>allow bind_v2<\/p>\n<p>pidfile&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \/var\/run\/openldap\/slapd.pid<br \/>argsfile&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \/var\/run\/openldap\/slapd.args<\/p>\n<p>&nbsp;<\/p>\n<p>TLSCACertificatePath \/etc\/openldap\/certs<br \/>TLSCertificateFile &#8220;\\&#8221;OpenLDAP Server\\&#8221;&#8221;<br \/>TLSCertificateKeyFile \/etc\/openldap\/certs\/password<\/p>\n<p>&nbsp;<\/p>\n<p>database config<br \/>access to *<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; by dn.exact=&#8221;gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth&#8221; manage<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; by * none<\/p>\n<p>database monitor<br \/>access to *<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; by dn.exact=&#8221;gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth&#8221; read<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; by dn.exact=&#8221;cn=admin,dc=my-domain,dc=com&#8221; read<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; by * none<\/p>\n<p>database&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bdb<br \/>suffix&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8220;dc=test,dc=com&#8221;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #\u81ea\u5df1\u5b9a\u4e49\u7684dc<br \/>checkpoint&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1024 15<br \/>rootdn&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8220;cn=admin,dc=test,dc=com&#8221; #\u81ea\u5df1\u5b9a\u4e49\u7ba1\u7406\u5458<br \/>rootpw&nbsp; {SSHA}KFAXZdD60RR0I4YmajnX4nQh263Wozh8&nbsp; #\u81ea\u5df1\u5b9a\u4e49\u5bc6\u7801&nbsp; \u53ef\u4ee5\u660e\u6587\u6216\u8005\u7528slappasswd\u52a0\u5bc6<\/p>\n<p>directory&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \/var\/lib\/ldap<\/p>\n<p>index objectClass&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; eq,pres<br \/>index ou,cn,mail,surname,givenname&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; eq,pres,sub<br \/>index uidNumber,gidNumber,loginShell&nbsp;&nbsp;&nbsp; eq,pres<br \/>index uid,memberUid&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; eq,pres,sub<br \/>index nisMapName,nisMapEntry&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; eq,pres,sub<\/p>\n<p><code>\u7136\u540e\u542f\u52a8ldap\uff0c\/etc\/init.d\/slapd start<\/code> <\/p>\n<p><code>\u7136\u540e\u9700\u8981\u5bfc\u5165\u4e00\u4e2aldif\uff0c\u5426\u5219\u65e0\u6cd5\u4f7f\u7528\uff0c\u6211\u5728\u770b\u7f51\u4e0a\u5f88\u591a\u7684\u4f1a\u5c06admin\u4e5f\u5199\u8fdb\u53bb\u5bfc\u5165\uff0c\u53cd\u800c\u62a5\u9519\uff0c\u540e\u6765\u6211\u4fee\u6539\u4e86\u4e0b\u3002<\/code> <\/p>\n<p>[root@localhost ldap]# cat test.ldif<\/p>\n<p>dn:dc=test,dc=com<br \/>objectclass:dcObject<br \/>objectclass:organization<br \/>o:Example, Inc.<\/p>\n<p>\u7136\u540e\u5bfc\u5165\u65e2\u53ef\u4f7f\u7528<\/p>\n<p>ldapadd -x -D &#8220;cn=admin,dc=test,dc=com&#8221; -W -f test.ldif<\/p>\n<p>\u8fd9\u91cc\u63a8\u83502\u4e2a\u5ba2\u6237\u7aef<\/p>\n<p>1\uff1aphpldapadmin<\/p>\n<p>\u5b89\u88c5\u76f4\u63a5yum\u5373\u53ef\uff0c\u914d\u7f6e\u7684\u65f6\u5019\u6ce8\u610f\u4e0bconfig<\/p>\n<p>$servers-&gt;newServer(&#8216;ldap_pla&#8217;);<br \/>$servers-&gt;setValue(&#8216;server&#8217;,&#8217;name&#8217;,&#8217;LDAP Server&#8217;);<br \/>$servers-&gt;setValue(&#8216;server&#8217;,&#8217;host&#8217;,&#8217;127.0.0.1&#8242;);<br \/>$servers-&gt;setValue(&#8216;server&#8217;,&#8217;port&#8217;,389);<br \/>$servers-&gt;setValue(&#8216;server&#8217;,&#8217;base&#8217;,array(&#8216;dc=test,dc=com&#8217;));<br \/>$servers-&gt;setValue(&#8216;login&#8217;,&#8217;auth_type&#8217;,&#8217;cookie&#8217;);<br \/>$servers-&gt;setValue(&#8216;login&#8217;,&#8217;bind_id&#8217;,&#8217;cn=admin,dc=test,dc=com&#8217;);<br \/>$servers-&gt;setValue(&#8216;login&#8217;,&#8217;bind_pass&#8217;,&#8217;test&#8217;);<br \/>$servers-&gt;setValue(&#8216;server&#8217;,&#8217;tls&#8217;,false);<\/p>\n<p>\u6ce8\u610f\u5c06\u6ce8\u91ca\u7b26\u53f7\u53bb\u6389\u3002<\/p>\n<p><a href=\"https:\/\/www.hmouse.cn\/wp-content\/uploads\/2014\/10\/image1.png\"><img loading=\"lazy\" decoding=\"async\" title=\"image\" style=\"border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; border-left: 0px; display: inline; padding-right: 0px\" border=\"0\" alt=\"image\" src=\"https:\/\/www.hmouse.cn\/wp-content\/uploads\/2014\/10\/image_thumb1.png\" width=\"244\" height=\"102\"><\/a><\/p>\n<p>2\uff1a<a href=\"http:\/\/www.google.com.hk\/url?sa=t&amp;rct=j&amp;q=&amp;esrc=s&amp;source=web&amp;cd=1&amp;ved=0CB4QFjAA&amp;url=http%3A%2F%2Fwww.ldapbrowser.com%2F&amp;ei=MOpJVPLtBZfr8AXMhYDoAw&amp;usg=AFQjCNFjLUJT0v2vKflTf21kCTnbP-9O5Q&amp;bvm=bv.77880786,d.dGc&amp;cad=rjt\">Softerra LDAP Administrator<\/a><\/p>\n<p>\u53bb<a title=\"http:\/\/www.ldapbrowser.com\/\" href=\"http:\/\/www.ldapbrowser.com\/\">http:\/\/www.ldapbrowser.com\/<\/a>\u4e0b\u8f7d\u5373\u53ef\uff0cwindows\u4e0b\u5f88\u597d\u4f7f\u7528\uff0c\u914d\u7f6e\u4e5f\u7b80\u5355\uff0c\u53ef\u4ee5\u81ea\u5df1\u5c1d\u8bd5\u4e0b\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[55],"class_list":["post-4190","post","type-post","status-publish","format-standard","hentry","category-5","tag-ladp","category-5-id","post-seq-1","post-parity-odd","meta-position-corners","fix"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.hmouse.cn\/index.php?rest_route=\/wp\/v2\/posts\/4190","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hmouse.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hmouse.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hmouse.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hmouse.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4190"}],"version-history":[{"count":2,"href":"https:\/\/www.hmouse.cn\/index.php?rest_route=\/wp\/v2\/posts\/4190\/revisions"}],"predecessor-version":[{"id":4197,"href":"https:\/\/www.hmouse.cn\/index.php?rest_route=\/wp\/v2\/posts\/4190\/revisions\/4197"}],"wp:attachment":[{"href":"https:\/\/www.hmouse.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4190"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hmouse.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4190"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hmouse.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4190"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}