首先把系统的ldap相关认证做好
sudo apt-get install libapache2-mod-php5 php5-mysql mysql-server php5 apache2 libphp-adodb libphp-phpmailer php5-ldap php5-gd libnusoap-php
Mantis_ldap认证
vi /etc/mantis/config_inc.php #添加如下代码 $g_login_method=LDAP; $g_ldap_server = '192.168.1.13'; $g_ldap_port = '389'; $g_ldap_root_dn = 'ou=people,dc=example,dc=net'; $g_ldap_organization = ''; $g_ldap_uid_field = 'uid'; $g_ldap_realname_field = 'uid'; $g_ldap_bind_dn = ''; $g_ldap_bind_passwd = ''; $g_use_ldap_email = ON; $g_use_ldap_realname = OFF; $g_ldap_protocol_version = 3; $g_ldap_follow_referrals = ON; $g_ldap_simulation_file_path = '';
Testlink_ldap认证
vi testlink/config.inc.php $tlCfg->authentication['method'] = 'LDAP';#改为LDAP /** LDAP authentication credentials */ $tlCfg->authentication['ldap_server'] = '192.168.1.13'; $tlCfg->authentication['ldap_port'] = '389'; $tlCfg->authentication['ldap_version'] = '3'; // could be '2' in some cases $tlCfg->authentication['ldap_root_dn'] = 'ou=people,dc=example,dc=net'; $tlCfg->authentication['ldap_organization'] = ''; // e.g. '(organizationname=*Traffic)' $tlCfg->authentication['ldap_uid_field'] = 'uid'; // Use 'sAMAccountName' for Active Directory $tlCfg->authentication['ldap_bind_dn'] = 'cn=directory manager,dc=example,dc=net'; // Left empty for anonymous LDAP binding $tlCfg->authentication['ldap_bind_passwd'] = '123456'; // Left empty for anonymous LDAP binding $tlCfg->authentication['ldap_tls'] = false; // true -> use tls /** Enable/disable Users to create accounts on login page */ $tlCfg->user_self_signup = TRUE;
此时重启apache后,还必须手动添加相关用户,不用输入密码,
Subversion_ldap认证
sudo apt-get install subversion libapache2-svn libapache2-mod-ldap-userdir libapache2-mod-vhost-ldap ldap-utils sudo a2enmod authnz_ldap #如果提示 auth provider ldap... 运行这个 vi /etc/apache2/mods-enabled/dav_svn.conf <Location /svn> DAV svn SVNPath /local_home/subversion/repos AuthType Basic AuthName "Subversion Repository" AuthBasicProvider ldap file #后面加file就是ldap认证失败,再用本地认证 AuthzLDAPAuthoritative off AuthLDAPURL "ldap://192.168.1.13:389/ou=People,dc=example,dc=net?uid?sub?(objectClass=*)" AuthzSVNAccessFile /etc/apache2/repos.authz Require valid-user </Location>
Subversion 这个配置文件前面还加入了binddn什么的,就是找不到用户.直接注释掉,居然OK