(1)首先安装EPEL Repository
## RHEL/CentOS 6 32-Bit ##
# wget http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
# rpm -ivh epel-release-6-8.noarch.rpm
## RHEL/CentOS 6 64-Bit ##
# wget http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
# rpm -ivh epel-release-6-8.noarch.rpm
(2)什么是EPEL 及 Centos上安装EPEL
安装epel,centos6选6,5就选5
32位系统选择:
rpm -ivh http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
rpm -ivh http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
64位系统选择:
rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -ivh http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
导入key:
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-5
如果用比较新的软件,用epel-test.repo这个文件就行了
别忘了安装yum install yum-priorities
(3) yum -y install ejabberd
安装完成后配置参考http://blog.163.com/na_llong/blog/static/1135416092013634567224
1.{host,["localhost","192.168.xx.xx"]}
2.{acl,admin,["user","admin","192.168.xx.xx"]}
3.service ejabberd force-reload
/etc/init.d/ejabberd start|stop|status
4.设置密码,下面实例为给admin设置密码为adminxxx
ejabberdctl register admin 192.168.xx.xx adminxxx
--------------------------------------------
如果碰到报错
Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again
则 cd /etc/yum.repos.d/
nano epel.repo在第一个epel里面有两种方法:(1)mirrorlist=http去掉s。(2)baseurl去掉#,mirrorlist添加#
[epel]
name=Extra Packages for Enterprise Linux 6 - $basearch
#baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch
mirrorlist=http://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch
[epel]
name=Extra Packages for Enterprise Linux 6 - $basearch
baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch
参考url:http://www.tecmint.com/how-to-enable-epel-repository-for-rhel-centos-6-5/