Center OS 5.5 下安装 和 配置 Ejabberd 2.1.3

安装jdk

安装mysql


[root@AY131009193734088795Z src]# cp ncurses-5.6.tar.gz /usr/local/src/

[root@AY131009193734088795Z src]# cp ejabberd-2.1.3.tar.gz /usr/local/src/

[root@AY131009193734088795Z src]# cp otp_src_R13B04.tar.gz /usr/local/src/


cd /usr/local/src


yum groupinstall "Development Tools"

yum �Cy install ncurses-devel

yum install openssl-devel

yum install expat-devel

yum install unixODBC unixODBC-devel

yum install zlib


tar zxvf ncurses-5.6.tar.gz

cd ncurses-5.6

./configure -prefix=/usr/local/ncurses -with-shared -without-debug

make

make install


tar zxvf otp_src_R13B04.tar.gz

cd otp_src_R13B04

./configure --prefix=/usr/local/erlang

make

make install


vim /etc/profile

在最后一行加上

export PATH=/usr/local/erlang/bin:$PATH

保存退出后

source /etc/profile

命令行中输入erl看是否安装成功


tar zxvf ejabberd-2.1.3.tar.gz

cd ejabberd-2.1.3/src/

./configure --prefix=/usr/local/ejabberd --enable-odbc --enable-unicode --with-erlang=/usr/local/erlang

make

make install


修改hostname

vim /etc/sysconfig/network


cd /usr/local/ejabberd/etc/ejabberd

vim ejabberd.cfg

{hosts, ["localhost"]}. 修改为: {hosts, ["wetaxi.cn"]}.

%%{acl, admin, {user, "aleksey", "localhost"}}. 修改为: {acl, admin, {user, "admin", "wetaxi.cn"}}.


vim ejabberdctl.cfg

[email protected]


hostname wetaxi.cn

/usr/local/ejabberd/sbin/ejabberdctl start --node [email protected]

/usr/local/ejabberd/sbin/ejabberdctl status

/usr/local/ejabberd/sbin/ejabberdctl register admin wetaxi.cn 1234

/usr/local/ejabberd/sbin/ejabberdctl stop


设置开机自启动

vim /etc/init.d/ejabberd

输入以下内容

------------------------------------------------------------------------

#!/bin/sh
# chkconfig: 345 99 10
# description: Auto-starts tomcat
# /etc/init.d/ejabberd
# Tomcat auto-start
# Source function library.
#. /etc/init.d/functions
# source networking configuration.
#. /etc/sysconfig/network
RETVAL=0
DIR=/usr/local/ejabberd/sbin
CTL="$DIR"/ejabberdctl
start()
{
        if [ -f $CTL ];
          then
            echo $"Starting Ejabberd..."
                $CTL start
        $CTL started
            RETVAL=$?
        sleep 1
        echo "done."
            return $RETVAL
        fi
}
stop()
{
        if [ -f $CTL ];
          then
            echo $"Stopping Ejabberd..."
                $CTL stop
            RETVAL=$?
            sleep 1
            echo "Ejabberd stoped. "
            return $RETVAL
        fi
}
case "$1" in
 start)
        start
        ;;
 stop) 
        stop
        ;;
                                                  
 restart)
         echo $"Restaring Ejabberd..."
         $0 stop
         sleep 1
         $0 start
         ;;
 *)
        echo $"Usage: $0 {start|stop|restart}"
        exit 1
        ;;
esac
exit $RETVAL

-----------------------------------------------------------------------------------------

chmod +x /etc/init.d/ejabberd

chkconfig --add ejabberd

chkconfig --level 2345 ejabberd on


设置外网访问端口

打开5280端口 5222 端口

vim /etc/sysconfig/iptables

-A INPUT -p tcp -m tcp --dport 5222 -j ACCEPT

-A INPUT -p tcp -m tcp --dport 5280 -j ACCEPT


reboot 重启自动生效


你可能感兴趣的:(OS,配置安装,5.5,ejabberd,center,2.1.3)