【原創】Centos配置turn服務器


使用ssh工具,進入命令行,安裝下面的就是可以配置turn-server(coturn)

轉請注明出處。

1.安裝centos必須的庫文件

     yum install -y make gcc cc gcc-c++ wget
     yum install -y openssl-devel libevent libevent-devel mysql-devel mysql-server
 
2. 下載並安裝 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.下載並安裝 TURN modules
另外具體版面可以到: http://turnserver.open-sys.org/downloads/ 查看
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.配置“turnserver.conf” file
cp /usr/local/etc/turnserver.conf.default   /etc/turnserver.conf
vi /etc/turnserver.conf
 
#監聽端口可以不設置會默認的使用3478
listening-port=3478
#listening-ip,注意必須是你的內網IP地址如(如果你是阿里雲的,就是私網地址):
listening-ip=172.xx.xx.xx
#relay-ip可以不設置,默認會使用你的外網ip地址作為轉發包的中繼地址,建議不設置,使用默認就可以:
#external-ip,注意必須使用你的外網IP地址如:
external-ip=xxx.xxx.xxx.xxx
#設置用戶名及密碼,這個是作為TURN服務器使用必須設置的,可以設置多個,我這里配置2個
user=user:simon
user=user:simon2
 
5.啟動 turn server 
     turnserver -v -r  外網地址:3478 -a -o -c /etc/turnserver.conf
 
6.停止turn sever
ps -ef|grep turnserver
kill -9 xxxx
 
7.測試服務器地址:
 
配置成功后會出現
 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM