|
Size: 13591
Comment:
|
Size: 13595
Comment:
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 297: | Line 297: |
| Icecast2 osaa ottaa vastaan myös live-ääntä esimerkiksi Flumotion-palvelimelta, mutta tässä ohjeessa luodaan soittolista podcast-käyttöä varten. | Icecast2 osaa ottaa vastaan myös live-ääntä esimerkiksi ["Flumotion"]-palvelimelta, mutta tässä ohjeessa luodaan soittolista podcast-käyttöä varten. |
Nettiradio - Icecast2
http://www.arkki.info/howto/Icecast2/Icecast2_06.png
Nettiradio: http://173.45.225.152:8000/
Oman nettiradion voi rakentaa Icecast2-palvelinohjelmiston avulla. Tärkeimmät ohjeet, joita on käytetty, ovat nämä:
http://www.icecast.org/docs/icecast-2.3.2/ | http://www.gnuware.com/icecast/
Nettiradio ei vaadi fyysistä äänikorttia, siksi se voidaan rakentaa virtuaalipalvelimeen.
Tämä ohje on tarkoitettu kokeneille käyttäjille, joten aivan jokaista asiaa ei ole selitetty - vain ne on yritetty muistaa, jotka on huomattu asennusta tehtäessä ongelmallisiksi.
http://www.arkki.info/howto/Icecast2/Icecast2_01.png
Nettiradio virtuaalipalvelimeen
Virtuaalipalvelin on hankittu ulkomaisesta palvelusta (http://www.slicehost.com/). Koska uusin Icecast2 2.3.2 ei sisälly Ubuntu 8.04:ään, niin palvelun listalta valittu Linux eli Ubuntu 8.04 on päivitetty seuraavaan. Tämä ohje on siis toteutettu virtuaalipalvelimessa, jossa on Ubuntu 8.10.
{{{root@asmok:/etc/icecast2# uname -a Linux asmok 2.6.24-19-xen #1 SMP Sat Jul 12 00:15:59 UTC 2008 x86_64 GNU/Linux root@asmok:/etc/icecast2#}}}
Asennus on suoraviivainen.
apt-get install icecast2 ices2
Asetustiedostot ovat /etc/icecast2-hakemistossa. Muita hakemistoja ovat /usr/share/icecast2 ja /var/log/icecast2.
{{{root@asmok:/etc/icecast2# ls -al yhteensä 36 drwxrwx--- 5 icecast2 icecast 4096 2008-11-18 14:20 . drwxr-xr-x 69 root root 4096 2008-11-18 12:37 .. drwxrwx--- 2 icecast2 icecast 4096 2008-11-18 10:49 admin drwxr-xr-x 2 icecast2 icecast 4096 2008-11-18 11:36 audio -rw-rw
1 icecast2 icecast 6567 2008-11-18 12:40 icecast.xml -rw-r--r-- 1 icecast2 icecast 1360 2008-11-18 14:16 ices-playlist.xml -rw-r--r-- 1 icecast2 icecast 58 2008-11-18 14:20 playlist.txt drwxrwx--- 2 icecast2 icecast 4096 2008-11-18 10:49 web root@asmok:/etc/icecast2#}}}
{{{drwxr-xr-x 4 root root 4096 2008-11-18 14:18 . drwxr-xr-x 80 root root 4096 2008-11-18 10:48 .. drwxr-xr-x 2 root root 4096 2008-11-18 10:48 admin -rw-r--r-- 1 root root 4 2008-11-18 14:18 ices.pid drwxr-xr-x 2 root root 4096 2008-11-18 10:48 web root@asmok:/usr/share/icecast2#}}}
{{{root@asmok:/var/log/icecast2# ls -al yhteensä 312 drwxr-xr-x 2 icecast2 icecast 4096 2008-11-18 11:23 . drwxr-xr-x 9 root root 4096 2008-11-18 12:28 .. -rw-r--r-- 1 icecast2 icecast 133606 2008-11-18 16:05 access.log -rw-r--r-- 1 icecast2 icecast 94651 2008-11-18 16:06 error.log -rw-r--r-- 1 root root 61738 2008-11-18 16:06 ices.log root@asmok:/var/log/icecast2#}}}
Kaksi asetustiedostoa - icecast.xml ja ices-playlist.xml
Icecast2-ohjelmaan liittyvä asetustiedosto asennetaan asennuksen yhteydessä, mutta Ices2:n asetustiedosto pitää luoda itse.
Icecast2-tiedostossa on tärkeää on vaihtaa salasana admin-käyttäjälle selain-liittymässä, samoin palvelimen ip-numero. Tässä ohjeessa /etc/icecast2-hakemiston tiedostojen omistajaksi on asetettu icecast2:icecast. Icecast2-ohjelma ajetaan tällä tunnuksella; chroot-ympäristöä ei ole määrätty.
Ices2-tiedostossa pitää antaa sama salasana, mikä on määritelty Icecast2-tiedostossa, samoin luonnollisesti palvelimen ip-numero. Ices2:n tiedostossa on paljon kohtia (meta-tietoja), jotka voi vapaasti määritellä. Tärkeää on määritellä playlist.txt-tiedoston sijainti.
<icecast>
<limits>
<clients>100</clients>
<sources>5</sources>
<threadpool>5</threadpool>
<queue-size>524288</queue-size>
<client-timeout>30</client-timeout>
<header-timeout>15</header-timeout>
<source-timeout>10</source-timeout>
<!-- If enabled, this will provide a burst of data when a client
first connects, thereby significantly reducing the startup
time for listeners that do substantial buffering. However,
it also significantly increases latency between the source
client and listening client. For low-latency setups, you
might want to disable this. -->
<burst-on-connect>1</burst-on-connect>
<!-- same as burst-on-connect, but this allows for being more
specific on how much to burst. Most people won't need to
change from the default 64k. Applies to all mountpoints -->
<burst-size>65535</burst-size>
</limits>
<authentication>
<!-- Sources log in with username 'source' -->
<source-password>XXXXXX</source-password>
<!-- Relays log in username 'relay' -->
<relay-password>XXXXXX</relay-password>
<!-- Admin logs in with the username given below -->
<admin-user>admin</admin-user>
<admin-password>XXXXXX</admin-password>
</authentication>
<!-- set the mountpoint for a shoutcast source to use, the default if not
specified is /stream but you can change it here if an alternative is
wanted or an extension is required
<shoutcast-mount>/live.nsv</shoutcast-mount>
-->
<!-- Uncomment this if you want directory listings -->
<!--
<directory>
<yp-url-timeout>15</yp-url-timeout>
<yp-url>http://dir.xiph.org/cgi-bin/yp-cgi</yp-url>
</directory>
-->
<!-- This is the hostname other people will use to connect to your server.
It affects mainly the urls generated by Icecast for playlists and yp
listings. -->
<hostname>173.45.225.152</hostname>
<!-- You may have multiple <listener> elements -->
<listen-socket>
<port>8000</port>
<!-- <bind-address>127.0.0.1</bind-address> -->
<!-- <shoutcast-mount>/stream</shoutcast-mount> -->
</listen-socket>
<!--
<listen-socket>
<port>8001</port>
</listen-socket>
-->
<!--<master-server>127.0.0.1</master-server>-->
<!--<master-server-port>8001</master-server-port>-->
<!--<master-update-interval>120</master-update-interval>-->
<!--<master-password>hackme</master-password>-->
<!-- setting this makes all relays on-demand unless overridden, this is
useful for master relays which do not have <relay> definitions here.
The default is 0 -->
<!--<relays-on-demand>1</relays-on-demand>-->
<!--
<relay>
<server>127.0.0.1</server>
<port>8001</port>
<mount>/example.ogg</mount>
<local-mount>/different.ogg</local-mount>
<on-demand>0</on-demand>
<relay-shoutcast-metadata>0</relay-shoutcast-metadata>
</relay>
-->
<!-- Only define a <mount> section if you want to use advanced options,
like alternative usernames or passwords
<mount>
<mount-name>/example-complex.ogg</mount-name>
<username>othersource</username>
<password>hackmemore</password>
<max-listeners>1</max-listeners>
<dump-file>/tmp/dump-example1.ogg</dump-file>
<burst-size>65536</burst-size>
<fallback-mount>/example2.ogg</fallback-mount>
<fallback-override>1</fallback-override>
<fallback-when-full>1</fallback-when-full>
<intro>/example_intro.ogg</intro>
<hidden>1</hidden>
<no-yp>1</no-yp>
<authentication type="htpasswd">
<option name="filename" value="myauth"/>
<option name="allow_duplicate_users" value="0"/>
</authentication>
<on-connect>/home/icecast/bin/stream-start</on-connect>
<on-disconnect>/home/icecast/bin/stream-stop</on-disconnect>
</mount>
<mount>
<mount-name>/auth_example.ogg</mount-name>
<authentication type="url">
<option name="mount_add" value="http://myauthserver.net/notify_mount.php"/>
<option name="mount_remove" value="http://myauthserver.net/notify_mount.php"/>
<option name="listener_add" value="http://myauthserver.net/notify_listener.php"/>
<option name="listener_remove" value="http://myauthserver.net/notify_listener.php"/>
</authentication>
</mount>
-->
<fileserve>1</fileserve>
<paths>
<!-- basedir is only used if chroot is enabled -->
<basedir>/usr/share/icecast2</basedir>
<!-- Note that if <chroot> is turned on below, these paths must both
be relative to the new root, not the original root -->
<logdir>/var/log/icecast2</logdir>
<webroot>/usr/share/icecast2/web</webroot>
<adminroot>/usr/share/icecast2/admin</adminroot>
<!-- <pidfile>/usr/share/icecast2/icecast.pid</pidfile> -->
<!-- Aliases: treat requests for 'source' path as being for 'dest' path
May be made specific to a port or bound address using the "port"
and "bind-address" attributes.
-->
<!--
<alias source="/foo" dest="/bar"/>
-->
<!-- Aliases: can also be used for simple redirections as well,
this example will redirect all requests for http://server:port/ to
the status page
-->
<alias source="/" dest="/status.xsl"/>
</paths>
<logging>
<accesslog>access.log</accesslog>
<errorlog>error.log</errorlog>
<!-- <playlistlog>playlist.log</playlistlog> -->
<loglevel>3</loglevel> <!-- 4 Debug, 3 Info, 2 Warn, 1 Error -->
<logsize>10000</logsize> <!-- Max size of a logfile -->
<!-- If logarchive is enabled (1), then when logsize is reached
the logfile will be moved to [error|access|playlist].log.DATESTAMP,
otherwise it will be moved to [error|access|playlist].log.old.
Default is non-archive mode (i.e. overwrite)
-->
<!-- <logarchive>1</logarchive> -->
</logging>
<security>
<chroot>0</chroot>
<changeowner>
<user>icecast2</user>
<group>icecast</group>
</changeowner>
</security>
</icecast>
<?xml version="1.0"?>
<ices>
<background>0</background>
<logpath>/var/log/icecast2/</logpath>
<logfile>ices.log</logfile>
<loglevel>4</loglevel>
<consolelog>0</consolelog>
<pidfile>/usr/share/icecast2/ices.pid</pidfile>
<stream>
<metadata>
<name>Asmo Koskinen</name>
<genre>speech</genre>
<description>LTSP5 TP2009</description>
<url>http://173.45.225.152</url>
</metadata>
<input>
<module>playlist</module>
<param name="type">basic</param>
<param name="file">playlist.txt</param>
<param name="random">0</param>
<param name="restart-after-reread">0</param>
<param name="once">0</param>
</input>
<instance>
<hostname>173.45.225.152</hostname>
<port>8000</port>
<password>XXXXXX</password>
<mount>/TP2009</mount>
<reconnectdelay>2</reconnectdelay>
<reconnectattempts>5</reconnectattempts>
<maxqueuelength>80</maxqueuelength>
<encode>
<nominal-bitrate>64000</nominal-bitrate>
<samplerate>44100</samplerate>
<channels>2</channels>
<quality>1</quality>
</encode>
</instance>
</stream>
</ices>
Soittolistan luominen
Icecast2 osaa ottaa vastaan myös live-ääntä esimerkiksi ["Flumotion"]-palvelimelta, mutta tässä ohjeessa luodaan soittolista podcast-käyttöä varten.
Ogg-tiedostoja varten luodaan audio-hakemisto /etc/icecast2-hakemiston juureen. Tähä hakemistoon tuodaan ogg-tiedostot.
{{{root@asmok:/etc/icecast2/audio# ls -al yhteensä 5728 drwxr-xr-x 2 icecast2 icecast 4096 2008-11-18 11:36 . drwxrwx--- 5 icecast2 icecast 4096 2008-11-18 14:20 .. -rwxr-xr-x 1 asmok asmok 788408 2008-05-03 09:15 Studio_04.ogg -rwxr-xr-x 1 asmok asmok 844738 2008-05-09 05:52 Studio_06.ogg -rwxr-xr-x 1 icecast2 icecast 4203731 2008-11-17 17:39 TP2009.ogg root@asmok:/etc/icecast2/audio#}}}
Ices2-ohjelmaa varten luodaan playlist.txt-tiedosto, jossa vain luetellaan soitettavat ogg-tiedostot. Sen sijainti on määritelty ices-playlist.xml-tiedostossa. Soittolistasta voidaan kommentoida pois tiedostoja #-merkinnällä.
Soittolistassa pitää olla ainakin kaksi ogg-tiedostoa! Jos ogg-tiedostoja on vain yksi, niin Ices2 kuolee soitettuaan tämän yhden tiedoston!
{{{root@asmok:/etc/icecast2# cat playlist.txt audio/TP2009.ogg audio/Studio_04.ogg #audio/Studio_06.ogg root@asmok:/etc/icecast2#}}}
Icecast2 ja Ices2 -ohjelmien käynnistäminen
Kun kaikki tarvittavat tiedostot ovat paikoillaan ja palvelimen asetukset ohjelmat voidaan käynnistää hyvin suoraviivaisesti.
root@asmok:/etc/icecast2# icecast2 -b -c /etc/icecast2/icecast.xml
root@asmok:/etc/icecast2# ices2 ices-playlist.xml &
Icecast2-ohjelman Admin-liittymä näyttää tältä, neljä ruutukaappausta.
[http://www.arkki.info/howto/Icecast2/Icecast2_02.png Icecast2_02.png]
[http://www.arkki.info/howto/Icecast2/Icecast2_03.png Icecast2_03.png]
[http://www.arkki.info/howto/Icecast2/Icecast2_04.png Icecast2_04.png]
[http://www.arkki.info/howto/Icecast2/Icecast2_05.png Icecast2_05.png]
