Icecast2

De MochilaWiki
Revisão de 15h16min de 28 de outubro de 2012 por Banto Palmarino (discussão | contribs)
Ir para navegaçãoIr para pesquisar

acrescentem em /etc/apt/sources.list

deb http://ftp.br.debian.org/debian/ squeeze main contrib non-free
deb-src http://ftp.br.debian.org/debian/ squeeze main contrib non-free
deb http://security.debian.org/ squeeze/updates main
deb-src http://security.debian.org/ squeeze/updates main
deb http://ftp.br.debian.org/debian/ squeeze-updates main
deb-src http://ftp.br.debian.org/debian/ squeeze-updates main
deb http://ftp.br.debian.org/debian-multimedia stable main
deb-src http://ftp.br.debian.org/debian-multimedia stable main

instalando dependências:

wget http://debian-multimedia.org/gpgkey.pub -O - | apt-key add -
apt-get update
apt-get build-dep icecast2
apt-get install libtool automake

instalando icecast

cd /usr/src
wget http://downloads.xiph.org/releases/icecast/icecast-2.4-beta.tar.gz
tar zxvf icecast-2.4-beta.tar.gz
cd icecast-2.3.99.0/
./configure
make
make install

ajustando configurações

addgroup --system icecast
adduser --system --disabled-password --disabled-login \
--home /usr/share/icecast2 --no-create-home --ingroup icecast \
icecast2
mkdir /etc/icecast2
mkdir /usr/local/var/log/icecast/
chown -R icecast2: /etc/icecast2 /usr/local/var/log/icecast/
chmod -R ug+rw,o+r,ugo+X /etc/icecast2
cp /usr/local/etc/icecast.xml /etc/icecast2/icecast.xml
chown icecast2: /etc/icecast2/icecast.xml
chmod ug+rw,o=,ug+X /etc/icecast2/icecast.xml
wget http://pub.nkosi.org/icecast.init -O /etc/init.d/icecast
chmod +x /etc/init.d/icecast
update-rc.d -f icecast defaults

redirecionando porta 8000 para 80

iptables -A PREROUTING -t nat -p tcp -d 192.168.2.32 --dport 80 -j REDIRECT --to-port 8000
iptables-save > /etc/iptables.up.rules
echo 'pre-up iptables-restore < /etc/iptables.up.rules' >> /etc/network/interfaces

criando ponto de montagem

para criar um ponto de montagem coloque esse exemplo simples em /etc/icecast2/icecast.xml:

  • para mp3
<mount>
  <mount-name>radio</mount-name>
  <password>m4l4t4est4</password>
  <max-listeners>1000</max-listeners>
</mount>
  • para ogg
<mount>
  <mount-name>/radio.ogg</mount-name>
  <password>m4l4test4</password>
  <max-listeners>1000</max-listeners>
</mount>

agora basta iniciar o serviço:

# /etc/init.d/icecast2 restart