Red Hat Linux Fedora For Dummies [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

Red Hat Linux Fedora For Dummies [Electronic resources] - نسخه متنی

Jon Hall

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
توضیحات
افزودن یادداشت جدید






Installing Ices2 and Icecast2

In this section, we tell you how to install other applications and services. Neither Ices2 or Icecast2 comes in RPM packages, so you have to build them from scratch.

Building from scratch in the Linux world requires that you follow these general steps:



Configure. The first step requires configuring the software. The configuration process builds dependency files. Several Linux systems are available that do this. The system used by Icecast2 and Ices2 is autogen.sh.



Compile. After the software is configured, you have to compile it. Compiling is a universal computer process that changes source code into executable code. Source code is readable by human beings — well, at least the class of humans known as nerds. Compiling source code changes it into a form that computers can understand. All applications are compiled from source code.



Install. After the result is compiled, it must be installed. Linux uses default directories such as /usr/bin, /usr/sbin, /usr/local/bin, and /usr/ local/sbin to store executable files (applications and services). Most software systems need to be placed in these types of locations to work correctly.



Technical StuffProgrammers use systems like the open source Concurrent Versions System (CVS) to build and maintain large projects. Working with numerous people, who are also geographically separate, on a project like Icecast2 would be impossible without a system to keep everyone organized. CVS allows each individual to “check out” code, work on it, and then optionally reintegrate the modifications back into the system. This, plus other features, allows a group to keep from stepping on each other and keep the project efficiently moving forward.


Download Icecast2 and Ices2


Before you build Ices2 or Icecast2, you have to get it. This section describes how to download the software.

Many of you probably are familiar with compiling software. However, you may not have used the download system you’re about to use in this section. You use the CVS.

TipBy now, you know that Linux uses many names and acronyms, many of which are cryptic at best. So you probably didn’t raise an eyebrow when you encountered the name Ogg Vorbis, Icecast2, or xiph.org. Ogg Vorbis is a science fiction character that its developers like. Icecast2 is a variation on the name Shoutcast, and Xihp is short for Xiphophorus helleri, a small swordtail fish popular in small aquariums.

These steps help you prepare your Red Hat Linux computer to start building the multimedia server:



Log in to your computer as the root user.

Icecast2 depends on several libraries, most of which are already installed on your Red Hat Linux computer. One library, however, is not. Install the xslt library now.



Insert the companion DVD-ROM into the DVD-ROM/CD-ROM drive and run these commands to install the extra software:

rpm -ivh --nodeps /mnt/cdrom/RedHat/RPMS/libxslt*
rpm -ivh /mnt/cdrom/RedHat/RPMS/automake16*

Tip If your computer doesn’t have a DVD-ROM drive, you have to use the coupon in the back of this book to obtain Red Hat Linux on CD-ROMs. After you receive the CD-ROMs, use them to install the libxslt and automake packages.

Now you have to download the Icecast2 and Ices2 software from the Internet.



Connect your computer to the Internet.

The method you use to connect to the Internet depends on the kind of service you subscribe to. Refer to Chapters 5, 6, and 7 for information about how to connect your computer to the Internet.



Enter this command in a GNOME Terminal window:

export CVSROOT=:pserver:anoncvs@xiph.org:/usr/local/ cvsroot

This command sets up an environmental variable that CVS needs in order to complete its download. Environmental variables tell the shell you’re working in — bash, in this case — where to find elements such as files and directories.



Tell your CVS client to log in to the remote CVS server. Enter this command to log in to the remote system:

cvs login



Enter anoncvs when you’re prompted for the CVS server password.

After you have logged in, you can download — or check out (co), in CVS parlance — the software. Enter the first of the following commands in order (wait for each one to finish before continuing to the next one.)



After you’re logged in, you can download — check out (co), in CVS parlance — the software:

cvs co icecast
cvs co ices
cvs co libshout
cvs co ogg

You see the files displayed as they’re downloaded, and the CVS checkout process is complete.



The following set of steps describes how to configure, compile, and install your multimedia server:



Run the command in a terminal emulator:

export LD_LIBRARY_PATH=/lib:/usr/lib:/usr/local/lib

This environmental variable is needed so that the compiler knows where to find several libraries.



Configure, compile, and install the Shoutcast library. Enter this command in a terminal emulator:

cd libshout



Run this command to set up the compilation process:

./autogen.sh



Compile and link the software by running the make command:

make



Install the libraries:

make install



You create the Ogg software by repeating Steps 2–4. These commands summarize the steps:

cd ../ogg
./autogen.sh
make
make install



Create the Ices2 server by repeating Steps 2–4. These commands summarize the steps:

cd ../ices
./autogen.sh
make
make install



You can finish the process by compiling the Icecast2 server. These commands summarize the steps:

cd ../icecast
./autogen.sh
make
make install



Your Ices2 and Icecast2 servers are now ready to broadcast. The following section describes how to configure both servers. After they’re configured, you can serve up multimedia streams.


Configuring Icecast2


Ices2 gets its multimedia content from static files, such as music formatted in Ogg Vorbis. Ices2 then feeds the audio streams to the Icecast2 server. You can then connect to the Icecast2 serves with your client application to listen to the music. All these connections are made over IP networks.

Ices2 and Icecast2 use the loopback (127.0.0.1) interface to communicate. (The loopback interface is an internal network interface that doesn’t use any physical device.) Using the loopback interface provides a simple method for testing your configuration.

TipIcecast2 uses Port 8000 to communicate with its stream source and Port 8001 for administration.

You begin by configuring Icecast2:



Log in to your Red Hat Linux computer as the root user.

The Icecast2 configuration file was installed in the /usr/local/etc directory when you ran the make install command. Now, you have to make only some minor modifications to that file to set up your simple streaming server.



Open the Gedit text editor by clicking the GNOME Menu and choosing AccessoriesText Editor.

In the Gedit window, choose FileOpen.



Enter /usr/local/etc/icecast.xml in the Selection text box and click OK.

The contents of icecast.xml are displayed in the text editor, as shown in Figure 19-1.


Figure 19-1: The icecast. xml file.



Find the part of the configuration file that defines the port number and bind address. Remove the comments from those parameters.

Comments encapsulate the configuration parameters with these character strings: <!-- and -->.



Remove the comments and the code should look like this:

  <!-- You can use these two if you only want a single listener -->
<port>8000</port>
<bind-address>127.0.0.1</bind-address>

These parameters tell the Icecast2 server which port number and IP address to listen to. They also define the master server as the same machine.



Find the Master Server section of the configuration and remove the comments. The configuration should look like this:

    <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>



Find the <logdir> parameter and change it to

<logdir>/var/log/icecast</logdir>

This location is where all the information about the running Icecast2 server is kept (in logs). Information about Icecast2 problems is placed there too.



Find the <security> section. You should set the Icecast2 server to use the user and group identification number nobody:

<security>
<chroot>0</chroot>
<!--
<changeowner>
<user>nobody</user>
<group>nobody</group>
</changeowner>
-->
</security>

Running the server as nobody reduces the security risk — breaking into your Icecast2 server doesn’t provide a hacker with superuser privileges.



Remove the comments from before the <changeowner> parameter and after the </changeowner> parameter:

<security>
<chroot>0</chroot>
<changeowner>
<user>nobody</user>
<group>nobody</group>
</changeowner>
</security>

Removing the comments allows the <user> and <group> directives to become active and force Icecast2 to run as user and group nobody. If you don’t remove the comments, Icecast2 runs as the user and group of the process that starts it. Because you’re logged in as root, Icecast2 runs as the root user when you start it in Step 10. Running a service as root can compromise your computer’s security.



Save your changes by clicking the Save button.

Choose FileQuit and the Gedit window closes.



Open a terminal emulator window by clicking the GNOME Menu and choosing System ToolsTerminal.



Create an Icecast2 log file directory by entering this command:

mkdir /var/log/icecast



Make the user nobody own the new directory:

chown nobody.nobody /var/log/icecast



Enter this command to start the Icecast2 server:

icecast –c /usr/local/etc/icecast.xml &



You just started your multimedia server, but aren’t transmitting anything. You have dead air now. Because you don’t want to run afoul of the FCC, the next section describes how to configure and start the Ices2 server so that you can feed content to the Icecast2 server.


Configuring Ices2


Configuring Ices2 is similar to configuring Icecast2. Follow these steps to configure Ices2 and then feed an audio stream to Icecast2:



Open a GNOME Terminal window.



Change to the /usr/local/etc directory and copy the sample Ices2 configuration file there:

cd /usr/local/etc
cp ~/ices/conf/*.xml .



Open the Gedit text editor by clicking the GNOME Menu and choosing AccessoriesText Editor.



In the Gedit window, choose FileOpen.



Select /usr/local/etc/ices.xml and click OK.

The contents of icecast.xml are displayed in the text editor.

Tip Ices2 can handle both static and live audio streams. The ices-live.xml configuration file deals with live streams, and the ices-playlist.xml configures static streams. However, providing live streams is more than we have space to describe in this book, so we leave it up to you to investigate that subject.

Ices2 uses a configuration file (a playlist) to provide static streams to Icecast2. Playlists define which audio files Ices2 provides to Icecast2.



Use this command to create a simple playlist named playlist:

echo "track1.ogg" > playlist.txt



Modify the ices-playlist.xml file to work with your playlist file. Find the <input> module and modify the file parameter to point to your newly created playlist file:

<input>
<module>playlist</module>
<param name="type">basic</param>
<param name="file">/usr/local/etc/playlist.txt</param>
<param name="random">0</param>
<param name="once">0</param>
</input>

The <input> and </input> delimiters tell Ices2 that these parameters are used to define the playlist:



<module> and </module>: These delimiters define the playlist boundary.



Type: This parameter defines the type of playlist you’re using. In this case, it’s a basic system.



File: The name of the file that contains the playlist is defined here.



Random: If this option is set to 1, the playlist tracks are played randomly.



Once: If this parameter is set to 1, it tells Ices2 to play each track only once.





Save your changes by clicking the Save button.



Choose FileQuit and the Gedit window closes.



Click the terminal emulator window and enter this command to start the Ices2 server:

ices /usr/local/etc/ices-playlist.xml &



Ices2 starts streaming to the Icecast2 server the Ogg Vorbis file you created. You can start listening to your private streaming server. We describe how to do just that in the following section.

/ 194