這幾天折騰ejabberd,總算有點眉目,目前看來,ejabberd整合到ldap上,應該是沒有問題。
EPEL上的rpm包,是2.05的版本,這個rpm,有一個bug,若是你在root目錄下,從新啓動ejabberd的服務,就會報錯,你切換到其餘目錄,如/opt的目錄下,那麼就沒有問題,這個bug已經和打包的開發者證明。
在centos下安裝,你能夠採用rpm包,這樣比較簡單,不過還能夠經過ejabberd網站下載bin包安裝,過程也很簡單。
安裝iredmail0.6
LDAP suffix: dc=test,dc=com
virtual domain: test.com
ejabberd
到官方網站,下載http://www.process-on
e.net/en/ejabberd/downloads
根據你的平臺,下載i386或者64bit的ejabber。這是一個bin的包。
# ls e*
ejabberd-2.1.2-linux-x86-installer.bin.gz
# gunzip ejabberd-2.1.2-linux-x86-installer.bin.gz
# chmod +x ejabberd-2.1.2-linux-x86-installer.bin
# ./ejabberd-2.1.2-linux-x86-installer.bin
Language Selection
Please select the installation language
[1] Dutch - Nederlands
[2] English - English
[3] French - Fran?ais
[4] German - Deutsch
[5] Russian - Русский
[6] Simplified Chinese - 簡體中文
[7] Spanish - Espa?ol
Please choose an option [2] :
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.
Press [Enter] to continue :
Do you accept this license? [y/n]: y
----------------------------------------------------------------------------
Please specify the directory where ejabberd will be installed.
Installation Directory [/opt/ejabberd-2.1.2]:
----------------------------------------------------------------------------
ejabberd server domain
Please enter the desired ejabberd domain name. The domain is the visible attribute that is added to the username to form the Jabber Identifier (for example: user@example.net). This computer must be known on the network with this address name.
ejabberd server domain [centos5.test.com]: test.com
Administrator username
Please enter the administrator username for the current ejabberd installation. A Jabber account with this username will be created and granted administrative privileges. Don't use blankspaces in the username.
Administrator username [admin]:
----------------------------------------------------------------------------
Administrator password
Please provide a password for the administrator user (at least 5 characters).
Administrator password :
Retype password :
----------------------------------------------------------------------------
Cluster
Will this node be part of a cluster ? (Please note ejabberd clustering is intended for advanced users).
Cluster [y/N]:
----------------------------------------------------------------------------
Setup is now ready to begin installing ejabberd on your computer.
Do you want to continue? [Y/n]:
----------------------------------------------------------------------------
Please wait while Setup installs ejabberd on your computer.
Installing
0% ______________ 50% ______________ 100%
#########################################
----------------------------------------------------------------------------
Setup has finished installing ejabberd on your computer.
View Readme file? [Y/n]: n
這就把ejabberd裝完,是安裝到opt的目錄下。
啓動
# cd /opt/ejabberd-2.1.2/bin
./start
http://192.168.1.69:5280/admin
用戶:admin@test.com
pass: pass
這個時候,ejabber是採用ejabber自帶的數據庫驗證。
設置ejabberd,採用iRedMail ldap驗證 配置文件/opt/ejabberd-2.1.2/conf/ejabberd.cfg 1:註釋掉這hosts,統一放到後面,方便維護 %%{hosts, ["test.com"]}. 2:註釋掉,這是採用內部驗證的意思 {auth_method, internal}. 3:設置admin 設置虛擬domain的管理員,這裏我改爲www用戶,讓他能夠登陸後臺管理 {acl, admin, {user, "admin", "test.com"}}. 改爲 {acl, admin, {user, "www", "test.com"}}. 3:添加下面 {hosts, ["test.com"]}. %%% Authenticate against LDAP. {auth_method, ldap}. {ldap_servers, ["127.0.0.1"]}. %%% {ldap_encrypt, tls}. {ldap_port, 389}. {ldap_base, "o=domains,dc=test,dc=com"}. {ldap_rootdn, "cn=vmail,dc=test,dc=com"}. {ldap_password, "xSSxj1IpZ82z9Ra1oYqIWaUzqPBILP"}. %%% Enable both normal mail user and mail admin. {ldap_filter, "(&(object zid="196">{ldap_uids, [{"mail", "%u@%d"}]}. 上面你惟一須要修改的就是ldap_password. 檢測 這個時候,你就應該能夠經過http://ip:5280/admin 使用www@test.com 登陸,這樣賬號就實現統一。