您的位置:首页 > 运维架构 > Linux

Centos安装turn stun 服务器

2015-09-22 23:09 971 查看
1.install and download prerequisite for CentOS
yum install -y make gcc cc gcc-c++ wget
yum install -y openssl-devel libevent libevent-devel mysql-devel mysql-server

2. download and install LibEvent modules
wget https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz tar zxvf libevent-2.0.21-stable.tar.gz
cd libevent-2.0.21-stable && ./configure
sudo make && sudo make install && cd ..

3.download and install TURN modules
wget http://turnserver.open-sys.org/downloads/v4.4.5.2/turnserver-4.4.5.2.tar.gz tar -zxvf turnserver-4.4.5.2.tar.gz
cd turnserver-4.4.5.2 && ./configure
sudo make && sudo make install

==================================================================
1) If you system supports automatic start-up system daemon services,
the, to enable the turnserver as an automatically started system
service, you have to:

a) Create and edit /etc/turnserver.conf or
/usr/local/etc/turnserver.conf .
Use /usr/local/etc/turnserver.conf.default as an example.

b) For user accounts settings: set up SQLite or PostgreSQL or
MySQL or MongoDB or Redis database for user accounts.
Use /usr/local/share/turnserver/schema.sql as SQL database schema,
or use /usr/local/share/turnserver/schema.userdb.redis as Redis
database schema description and/or
/usr/local/share/turnserver/schema.stats.redis
as Redis status & statistics database schema description.

If you are using SQLite, the default database location is in
/var/db/turndb or in /usr/local/var/db/turndb or in /var/lib/turn/turndb.

c) add whatever is necessary to enable start-up daemon for the
/usr/local/bin/turnserver.

2) If you do not want the turnserver to be a system service,
then you can start/stop it "manually", using the "turnserver"
executable with appropriate options (see the documentation).

3) To create database schema, use schema in file
/usr/local/share/turnserver/schema.sql.

4) For additional information, run:

$ man turnserver
$ man turnadmin
$ man turnutils

==================================================================

4.Configure “turnserver.conf” file
cp /usr/local/etc/turnserver.conf.default /etc/turnserver.conf
vi /etc/turnserver.conf

listeningi-port=3478
listening-ip=xxx.xxx.xxx.xxx
user=cube:cube
external-ip=xxx.xxx.xxx.xxx/xxx.xxx.xxx.xxx
pidfile="/var/run/turnserver.pid"
log-file=/var/tmp/turn.log

5.Run TURN server
nohup turnserver -v -r 123.57.232.224:3478 -a -o -c /etc/turnserver.conf > /dev/null &

turnserver -v -r 123.57.232.224:3478 -a -o -c /etc/turnserver.conf

6.Stop TURN
cat /var/run/turnserver.pid or /var/tmp/turnserver.pid
12345
kill 12345
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: