AWS EC2 coturn 安裝 Published by Anita Chou October 25th, 2017 下載 coturn取得最新的版本要安裝coturn 在AWS EC2,可以參考coturn的安裝文件安裝 coturn如安裝文件所描述Current Amazon TURN Server public AMI: ami-908316f0 // 目前AWS 的 TURN Server 公開的AMI是:ami-908316f0 This image is available in US West (Oregon) region: //這個image只能在Oregon地區取得使用 search by "coturn" string or by the AMI name. //請搜尋"coturn"關鍵字簡單的說,就是作者提供coturn 的image 在 AWS EC2平台上,你可以直接使用他提供的 image,運行 EC2實體。二話不說,直接登入EC2主控台步驟1先選擇區域並運行一個實體(instance),記得區域要選擇"Oregon"步驟2點選左下角" Community AMIs ",然後搜尋 "coturn", 你就可以搜尋到該image。點選"Select" 剩下步驟就跟建立新EC2實體一樣,你可以參照這個文件設定 Coturn 系統建立完Coturn實體後,服務並沒有起來,你需要先設定系統你需要到 /etc/turnserver.conf 修改一些內容搜尋以下文字,並取消註解listening-port=3478user=ninefingers:youhavetoberealistic修改 external-ip的值,將你剛剛建立的實體的對外IP填進來重啟coturn服務$sudo/etc/rc.d/init.d/coturnstop$sudo/etc/rc.d/init.d/coturnstart新增 inbound Coturn 預設的port為 3478, 所以你需要開放 tcp,upd的potocal 並且聽port 3478。關於設定inbound,你可以參考這裡測試 stun/turn server 是否成功測試 stun server填入以下的欄位,點選"Add Server"STUN or TURN URI: turn:<EC2 instance public IP>:port IceTransports value: 選擇all然後點選 "Gather candidates" 成功的話,會有資訊跑出來。 測試 turn server至測試頁面,填入以下的欄位,點選"Add Server"STUN or TURN URI: turn :<EC2 instance public IP>:port TURN username: ninefingers TURN password: youhavetoberealistic IceTransports value: 選擇 relay 其餘步驟與測試stun server一樣新增予刪除 turn 使用者$ turnadmin -a -u <username> -r north.gov -p <password> //新增使用者 $ turnadmin -d -u <username> -r north.gov -p <password> //刪除使用者 更多訊息請參考官網https://github.com/coturn/coturn/wiki/turnadmin參照https://github.com/coturn/coturn/wiki/CoturnConfighttps://madurad.wordpress.com/2017/06/04/turn-server-installation-configuration-on-aws/#more-452http://uniray7-blog.logdown.com/posts/259368-installhttps://github.com/coturn/coturn/issues/91https://www.webrtc-experiment.com/docs/TURN-server-installation-guide.html#coturn /link/aws-ec2-coturn-an-zhuang Aws Ec2, Webrtc