11.29日更正配置文件编辑部份
-------------------------------------
之前已经yum安装过gcc和mysql
rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm
yum install expat expat-devel libidn libidn-devel udns udns-devel libgsasl libgsasl-devel openssl openssl-devel mysql-devel
cd ~
mkdir src
mkdir /opt/jabberd
cd src
wget http://codex.xiaoka.com/pub/jabberd2/releases/jabberd-2.2.11.tar.bz2
tar jxvf jabb*
cd jabb*
#初始化mysql
mysql -uroot -pxxxxx < tools/db-setup.mysql
./configure --prefix=/opt/jabberd --enable-mio=epoll --enable-mysql --enable-debug --enable-mio-debug
#因为我是开发之用所以加了调试选项--enable-debug --enable-mio-debug
make
make install
#为启动服务添加一个用户
useradd -d /dev/null jabber
cd /opt/jabberd
chown jabber:jabber -R ./
#然后按照文档改配置文件,下面直接写成sed表达式,方便以后自动化完成:http://www.jabberdoc.org/AdminGuide
#example.com
sed -i "s/\(]*>\)[^<]*/\1example.com/" etc/c2s.xml
#example.com
sed -i "s/\(\)[^<]*/\1example.com/" etc/sm.xml
#存储方式改成mysql
sed -i "s/sqlite<\/module>/mysql<\/module>/" etc/c2s.xml etc/sm.xml
#设置用户名和密码
sed -i "30,\$s/.*<\/user>/DBUSER<\/user>/" etc/c2s.xml etc/sm.xml
sed -i "30,\$s/.*<\/pass>/DBPASS<\/pass>/" etc/c2s.xml etc/sm.xml
安装和配置到此结束,启动一下~
sudo -u jabber bin/jabberd
输出调试信息
sudo -u jabber bin/jabberd -D
-----------
post by gmail~
暂时没有留言。