LDAP Account Manager(LAM)採 用PHP4/5編寫,是基於Web的LDAP用戶、用戶組、主機和LDAP目錄的管理系統,管理員可以通過加密的方式進行操作,增強了安全性。LAM支持 管理的帳號類型有Samba2/3、Unix地址簿接口和計算機需要的信息,包括NIS映射、E-mail假名,MAC地址等。LDAP Account Manager強大功能1、使用LAM,可以通過Web接口較爲直觀的、簡便的管理存儲在LDAP目錄裏的用戶、用戶組和計算機系統賬戶。2、管理Unix的用戶、用戶組、主機、域名。3、強大的過濾和排序功能。4、帳號屬性管理。5、多構造屬性。6、直觀樹狀查看模式。7、計劃查看模式。8、通過文件上傳創建帳號。9、所有帳號可導出爲PDF文件格式。10、管理用戶、用戶組、配額和自動創建刪除用戶的Home目錄。11、支持LDAP+SSL加密模式。12、多國語言支持,如Catalan、Chinese(Traditional)等。安裝需求1、PHP5語言環境和Perl語言環境。2、OpenLDAP2.0或更高版本。3、支持CSS的網頁瀏覽器。4、Apache WebServer,建議安裝SSL、PHP-Module(PHP-Module with ldap、Gettext、XML、Mcrypt+mhash)等模塊。
安裝Openssl
[root@chenyi ldmp]# tar zxf openssl-1.0.0e.tar.gz [root@chenyi ldmp]# cd openssl-1.0.0e [root@chenyi openssl-1.0.0e]# ./config --prefix=/software/ssl --openssldir=/software/openssl shared [root@chenyi openssl-1.0.0e]# make && make test &&make install
安裝apr
[root@chenyi ldmp]# tar zxf apr-1.4.5.tar.gz [root@chenyi ldmp]# cd apr-1.4.5 [root@chenyi apr-1.4.5]# ./configure --prefix=/software/apr [root@chenyi apr-1.4.5]# make && make install
安裝apr-util
[root@chenyi apr-util-1.3.12]# tar zxf apr-util-1.3.12.tar.gz [root@chenyi apr-util-1.3.12]# cd apr-util-1.3.12 [root@chenyi apr-util-1.3.12]# ./configure --prefix=/software/apr-util --with-apr=/software/apr/ --with-ldap-include=/software/openldap/include/ --with-ldap-lib=/software/openldap/lib/ --with-berkeley-db=/software/BerkeleyDB.5.2/ [root@chenyi apr-util-1.3.12]# make && make install
安裝Apache [這裏我多次嘗試使用2.2.29版進行編譯,但終遇到各種挫折,由於沒有得到完善的解決,所以選用了2.2.21,根據你的需要,可酌情刪減編譯參數]
[root@chenyi httpd-2.2.21]# tar zxf httpd-2.2.21.tar.gz [root@chenyi httpd-2.2.21]# cd httpd-2.2.21 [root@chenyi httpd-2.2.21]# ./configure --prefix=/software/apache2 --sysconfdir=/etc/httpd --enable-ssl --with-ssl=/software/openssl/ --with-z=/software/zlib/ --enable-rewrite=shared --enable-static-support --enable-deflate=shared --enable-so --enable-dav --enable-dav-fs --enable-ldap --enable-authnz-ldap --with-included-apr --with-ldap --with-ldap-include=/software/openldap/include/ --with-ldap-lib=/software/openldap/lib --with-apr=/software/apr/bin/apr-1-config --with-apr-util=/software/apr-util/bin/apu-1-config [root@chenyi httpd-2.2.21]# make && make install
安裝gettext
[root@chenyi ldmp]# tar zxf gettext-0.17.tar.gz [root@chenyi ldmp]# cd gettext-0.17 [root@chenyi gettext-0.17]# ./configure --prefix=/software/gettext [root@chenyi gettext-0.17]# make && make install
加入配置庫搜索路徑
[root@chenyi gettext-0.17]# echo "/software/gettext/lib/" >> /etc/ld.so.conf && ldconfig -v [root@chenyi gettext-0.17]# rpm -qa | grep zlib-devel 檢測zlib-devel 如果沒安裝則yum zlib-devel-1.2.3-27.el6.i686
添加PHP支持
[root@chenyi ldmp]# tar zxf php-5.2.6.tar.gz [root@chenyi ldmp]# cd php-5.2.6 [root@chenyi php-5.2.6]# ./configure --prefix=/software/php --enable-zip --with-config-file-path=/software/php/etc --with-apxs2=/software/apache2/bin/apxs --with-libxml-dir=/software/libxml2 --with-png-dir=/software/libpng --with-jpeg-dir=/software/jpeg6 --with-freetype-dir=/software/freetype/ --with-gd=/software/gd2/ --with-ldap=/software/openldap/ --with-gettext=/software/gettext/ --with-zlib-dir=/software/zlib/ --with-mcrypt=/software/libmcrypt --enable-soap --enable-mbstring=all--enable-sockets [root@chenyi php-5.2.6]# make && make install
創建php配置文件
[root@chenyi php-5.2.6]# cp php.ini-dist /software/php/etc/php.ini #創建配置文件 [root@chenyi php-5.2.6]# vi /etc/httpd/httpd.conf #修改ServerName 添加相關配置 LoadModule php5_module modules/libphp5.so #查看是否有這一行 AddType application/x-httpd-php .php .php4 .php5 .php .phtml #查看是否有這一行,(表示以這些擴展名結尾的文件,在apache中使用php解析器解析)。
接着重啓apache服務器,創建一個php文件訪問則可以看到結果了!這裏也沒什麼必要演示了
下載LAM壓縮包,然後解壓後修改php.ini,內容如下
[root@chenyi ldmp]# tar zxf ldap-account-manager-3.7.RC1.tar.gz [root@chenyi ldmp]# mv ldap-account-manager-3.7.RC1 /software/apache2/htdocs/lam [root@chenyi config]# pwd #進入config目錄,創建配置文件 /software/apache2/htdocs/lam/config [root@chenyi config]# cp config.cfg_sample config.cfg [root@chenyi ~]# /software/openldap/sbin/slappasswd -s itchenyi #使用slappasswd生成密碼 {SSHA}WakGiZTwkh5e2MD8vgy9AUf9h18l6YlG
新建ldif文件 注:ldif文件中,每一行中冒號後有一個空格,行尾一定不能有空格(同時也可以通過migrationtools這個組件來建立ldif文件)
dn: dc=itchenyi, dc=com objectClass: dcObject objectClass: organization o: itchenyi Inc dc: itchenyi dn: cn=Manager, dc=itchenyi, dc=com objectCalss: organizationalRole cn: Manager dn: ou=group, dc=itchenyi, dc=com objectClass: top objectClass: organizationalUnit ou: group dn: ou=it, dc=itchenyi, dc=com objectClass: top objectClass: organizationalUnit ou: it
複製模版文件(如果沒有,你在通過-d 256 調試時可以看到顯著的錯誤)
[root@chenyi config]# cp /software/openldap/etc/openldap/DB_CONFIG.example /software/openldap/var/openldap-data/DB_CONFIG
關閉slapd進程,導入ldif文件
[root@chenyi config]# kill -INT `cat /software/openldap/var/run/slapd.pid` [root@chenyi config]# /software/openldap/sbin/slapadd -v -l ./itchenyi.ldif
幾個常用選項:
1: -v選項表示啓用verbose模式,即輸出執行中的具體信息。
2: -l表示後面附加ldif文件。
3:-d 指定debug向日志文件輸出信息,後面跟日誌級別。
4: -f 指定要讀取的配置文件。
啓動服務進程
[root@chenyi config]# /software/openldap/libexec/slapd -d 256
通過http://ip/lam 進行訪問
創建配置文件可以通過默認密碼lam 進行編輯創建