公司的几种常用服务都用了LDAP认证,为了方便快捷的找到这些LDAP认证服务器配置在文件中的位置, 可采用 grep -r “xxx.xxx.xxx.xxx" * 的指令查找当前目录及其子目录下所有ip为 ”xxx.xxx.xxx.xxx"的文件,这样就可以快速的定位并进行LDAP server ip的更改了。
举例: bugzilla, bugzilla sandbox, testlink, testlink sandbox, svn,LDAP server配置所在文件及位置:
[root@axdc-release /usr/local/www]# ls
Discuz_7.0.0_SC_UTF8 bz_old tl0311
UCenter_1.5.0_SC_UTF8 ftpserver tl_bak
apache22 mirrorsite viewvc
bugzilla svn viewvc_trunk
bz_bak testlink wwwroot
bz_new testlink_sandbox
[root@axdc-release /usr/local/www]# grep -r "172.20.1.99" *
bugzilla/data/sandbox/params: 'LDAPserver' => '172.20.1.99:3268',
bugzilla/data/params: 'LDAPserver' => '172.20.1.99:3268',
bz_new/data/params: 'LDAPserver' => '172.20.1.99:3268',
svn/svn.conf: AuthLDAPURL "ldap://172.20.1.99:3268/DC=ADVANTECH,DC=CORP?sAMAccountName?sub?(&(objectClass=person)(objectClass=user)(!(objectClass=computer)))"
testlink/custom_config.inc.php:$tlCfg->authentication['ldap_server'] = '172.20.1.99';
testlink_sandbox/custom_config.inc.php:$tlCfg->authentication['ldap_server'] = '172.20.1.99';
tl0311/custom_config.inc.php:$tlCfg->authentication['ldap_server'] = '172.20.1.99';
tl_bak/custom_config.inc.php://$tlCfg->authentication['ldap_server'] = '172.20.1.99';
=============================================================================
bugzilla 中, LDAP server配置在data/params文件;
bugzilla sandbox, LDAP server配置在data/sandbox/params文件;
testlink /testlink sandbox中, LDAP server配置在custom_config.inc.php文件;
svn 中,LDAP server配置在svn.conf文件;
ftp的配置文件在/etc目录下,针对我们所有的FreeBSD OS, 位置为/usr/local/etc,所以ftp对应LDAP认证 server的配置要在/usr/local/etc目录下查找,如下:
[root@axdc-release /usr/local/etc]# grep -r "172.20.1.99" * apache22/httpd.conf: AuthLDAPURL "ldap://172.20.1.99:3268/DC=ADVANTECH,DC=CORP ?sAMAccountName?sub?(&(objectClass=person)(objectClass=user)(!(objectClass=compu ter)))"
ldap.conf:host 172.20.1.99
=============================================================================
其中 更改ldap.conf文件中的 host 为LDAP server ip即可。
Karen