一、下载并安装CentOS 6.5 32位或64位操作系统,需要确保此操作系统能正常上外网(具体过程略)
(注:以下步骤均是在命令行完成)
二、在/home/目录下创建Makefile文件,并将以下内容写入此文件
#
# FreeSWITCH auto-build Makefile (CentOS 6.5/Debian 7 Nike Edition, JUST DO IT!)
# http://www.freeswitch.org
# put this file anywhere and type make to
# create a fully-built freeswitch.git from scratch
# in that same directory.
#
#
RPMS=git gcc-c++ autoconf automake libtool wget python ncurses-devel zlib-devel libjpeg-devel openssl-devel e2fsprogs-devel sqlite-devel libcurl-devel pcre-devel speex-devel ldns-devel libedit-devel
DEBS=git build-essential automake autoconf libtool wget python uuid-dev zlib1g-dev libjpeg-dev libncurses5-dev libssl-dev libpcre3-dev libcurl4-openssl-dev libldns-dev libedit-dev libspeexdsp-dev libspeexdsp-dev libsqlite3-dev perl libgdbm-dev libdb-dev bison libvlc-dev libtool-bin pkg-config
freeswitch: deps has-git freeswitch.git/Makefile
cd freeswitch.git && make
freeswitch.git/Makefile: freeswitch.git/configure
cd freeswitch.git && ./configure
freeswitch.git/configure: freeswitch.git/bootstrap.sh
cd freeswitch.git && sh bootstrap.sh
freeswitch.git/bootstrap.sh: has-git
test -d freeswitch.git || git clone https://freeswitch.org/stash/scm/fs/freeswitch.git freeswitch.git
rpmforge:
(which rpm && rpm -i http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm) || true
install:
cd freeswitch.git && make install cd-sounds-install cd-moh-install
has-git:
@git --version || (echo "please install git" && false)
deps: rpmforge
((which yum && yum -y install $(RPMS)) || (which apt-get && apt-get -y install $(DEBS))) || true
三、在/home/目录下,用命令行执行make命令,此时系统会自动安装和升级相关操作系统所需环境,并且用git下载最新版的freeswitch源码,以freeswitch.git目录名保存在当前目录下,即会创建/home/freeswitch.git/路径
四、完成第三步后,进入/home/freeswitch.git/目录下,执行以下命令
cd /usr/local
useradd --system --home-dir /usr/local/freeswitch -G daemon freeswitch
passwd -l freeswitch
chown -R freeswitch:daemon /usr/local/freeswitch/
chmod -R 770 /usr/local/freeswitch/
chmod -R 750 /usr/local/freeswitch/bin/*
mkdir /var/run/freeswitch
chown -R freeswitch:daemon /var/run/freeswitch
ln -s /usr/local/freeswitch/bin/freeswitch /usr/bin/ # needed by /etc/init.d/freeswitch
五、启动FreeSwitch
1)、非后台服务方式启动时:
cd /usr/local/freeswitch/bin
./freeswitch
此时,你将在控制台看到启动信息,如果有错误,当然也是会显示,当启动成功时,你将看到类似下面的提示:
freeswitch@brian.freeswitch>
这是CLI命令行,你输入help可以查看各个命令的使用方法,具体的命令该如何使用可从这里获取帮助:
https://freeswitch.org/confluence/display/FREESWITCH/mod_commands
2)、后台服务方式启动:
cp /usr/src/freeswitch/build/freeswitch.init.redhat /etc/init.d/freeswitch
chmod 750 /etc/init.d/freeswitch
chown freeswitch:daemon /etc/init.d/freeswitch
chkconfig --add freeswitch && chkconfig --levels 35 freeswitch on