2016年8月3日 星期三

icecast2 架設

如何在 Liunx 架設網路電台
系統採用 Debian
電台套件 icecast2
安裝 icecast2
apt-get install icecast2
安裝完成後不是自行啟動
先編輯 /etc/default/icecast2
# Full path to the server configuration file
CONFIGFILE="/etc/icecast2/icecast.xml"
# Name or ID of the user and group the daemon should run under
USERID=icecast2
GROUPID=icecast
# Edit /etc/icecast2/icecast.xml and change at least the passwords.
# Change this to true when done to enable the init.d script
ENABLE=true
#指定設定檔位址
CONFIGFILE="/etc/icecast2/icecast.xml"
#指定使用者與群組
USERID=icecast2
GROUPID=icecast
#開機執行
ENABLE=true
再來編輯 /etc/icecast2/icecast.xml
尋找<authentication>區段
<authentication>
    <!-- Sources log in with username 'source' -->
    <source-password>hackme </source-password>
    <!-- Relays log in username 'relay' -->
    <relay-password>hackme </relay-password>
    <!-- Admin logs in with the username given below -->
    <admin-user>admin</admin-user>
    <admin-password>hackme </admin-password>
</authentication>
source-password #串流來源密碼
relay-password    #中繼轉播密碼
admin-user          #管理者帳號
admin-password #管理者密碼
hackme是預設的密碼請改掉
尋找</icecast>
在前面加入
      <mount>
               <mount-name>/live1.mp3</mount-name>
               <fallback-mount>/live2.mp3</fallback-mount>
               <fallback-override>1</fallback-override>
       </mount>
mount-name          #主串流名稱
fallback-mount       #副串流名稱
fallback-override    #自動切回主串流
這個功能在於一個頻道有兩個串流
當主串流沒訊號進入時 fallback-mount 會將聽眾引導到副串流
主串流回覆時 fallback-override 會將聽眾引導回主串流
設定完成後執行 sudo /etc/init.d/icecast2 start
執行 ps -A | grep ic 或用瀏覽器 http://ip-address:8000/
確認 icacast2 正常運作






追蹤者