Terry.Li-彬

虚其心,可解天下之问;专其心,可治天下之学;静其心,可悟天下之理;恒其心,可成天下之业。

  BlogJava :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理 ::
  143 随笔 :: 344 文章 :: 130 评论 :: 0 Trackbacks
https://github.com/fly2wind/TSShellScript

#!/bin/sh
########################################################################################
#
# Install Ejabberd Server
#
# Shawn Ma
#
########################################################################################
# Define
TARGET=v2.1.11.tar.gz
SOURCE=https://nodeload.github.com/processone/ejabberd/tar.gz/v2.1.11

# Create a build directory
mkdir -p /opt/install/ejabberd && cd /opt/install/ejabberd

# Prepare for compilation source
curl -o $TARGET $SOURCE
mkdir -p tmp && tar -zxvf $TARGET -C tmp

# Install build dependencies
yum install -y gcc gcc-c++ make cmake autoconf automake
yum install -y expat-devel

# Create a User Group
groupadd ejabberd
useradd -r -g ejabberd ejabberd

# Compile and deploy
mv tmp/* source && cd source\src
./configure \
--prefix=/opt/server/xmpp/ejabberd \
--enable-user=ejabberd \
--enable-full-xml \
--enable-nif
make
make install

cd /opt/server/xmpp/ejabberd
curl -o etc/ejabberd/ejabberd.cfg https://raw.github.com/fly2wind/TSShellScript/master/ejabberd/conf/ejabberd.cfg
curl -o etc/ejabberd/ejabberdctl.cfg https://raw.github.com/fly2wind/TSShellScript/master/ejabberd/conf/ejabberdctl.cfg
curl -o etc/ejabberd/inetrc https://raw.github.com/fly2wind/TSShellScript/master/ejabberd/conf/inetrc

# Postinstallation setup
cd /opt/server/xmpp/ejabberd
chown -R ejabberd .
chgrp -R ejabberd .
chown -R root .
chown -R ejabberd var

# Configuration
sed -i "/^ERL=.*/a\PMD=\/opt\/environment\/erlang\/R15B03\/bin\/epmd" sbin/ejabberdctl
sed -i -e "s/epmd -names | grep -q name || epmd -kill/\$PMD -names | grep -q name || \$PMD -kill/" sbin/ejabberdctl
curl -o /etc/init.d/ejabberd https://raw.github.com/fly2wind/TSShellScript/master/ejabberd/init/ejabberd
chmod a+x /etc/init.d/ejabberd

# Additional
chkconfig --add ejabberd
chkconfig ejabberd on


posted on 2013-01-09 14:55 礼物 阅读(1147) 评论(0)  编辑  收藏 所属分类: Linux