Difference between revisions of "AirTime: Instalasi Manual"

From OnnoWiki
Jump to navigation Jump to search
 
Line 184: Line 184:
  
 
==Pranala Menarik==
 
==Pranala Menarik==
 +
 +
* [[AirTime]]
 +
* [[AirTime: Instalasi]]
 +
* [[AirTime: Instalasi Manual]]
 +
* [[AirTime: Mulai Mengoperasikan]]

Latest revision as of 18:49, 16 July 2011

Kita biasanya tidak membutuhkan untuk menginstalasi Airtime secara manual, kecuali kita melakukan testing dari versi development.

You do not normally need to install Airtime manually, unless you are testing a development version of the software. Building Airtime from source is not recommended unless you have experience of working with Git repositories and compilers.

To install from the Airtime release tarball, first install the list of dependencies. For example, on Ubuntu 10.04 (Lucid Lynx) LTS you could enter the command:

$ sudo apt-get install apache2 curl daemontools daemontools-run ecasound \ gzip libao-ocaml libapache2-mod-php5 libcamomile-ocaml-dev libesd0 \ libmad-ocaml libmp3lame0 libmp3lame-dev libportaudio2 libsamplerate0 \ libsoundtouch-ocaml libtaglib-ocaml libvorbis-ocaml-dev mpg123 multitail \ odbc-postgresql oggvideotools openssl php-pear php5-curl php5-gd \ php5-pgsql poc-streamer pwgen python python-configobj python-mutagen \ python-pip python-setuptools rabbitmq-server tar unzip

Install the Python modules that Airtime requires:

$ sudo pip install kombu
$ sudo pip install poster

The final dependency to install is phing (note that you must use the version number shown):

$ sudo mkdir -p /tmp/pear/cache
$ sudo pear channel-discover pear.phing.info
$ sudo pear install phing/phing-2.4.2

Download Airtime

A link to download the latest tarball version of Airtime is available at:

http://www.sourcefabric.org/en/products/airtime_download/

For example, to download version 1.8.2 from SourceForge in the server console you could enter the command:

$ wget http://downloads.sourceforge.net/project/airtime/1.8.2/airtime-1.8.2.tar.gz

Unzip the file you have just downloaded to the installation directory /var/lib/airtime/ with the following command:

$ sudo tar -xvzf airtime-1.8.2.tar.gz -C /var/lib/

Change the ownership of the installation directory to the root user so that it is more secure:

$ sudo chown -R root.root /var/lib/airtime-1.8.2/

Then enter the following commands to create the Airtime databases, tables, and directories:

$ cd /var/lib/airtime-1.8.2/install/
$ sudo php airtime-install.php

The installation script will indicate which files are being installed on your system, and the directories they are being unpacked into. Finally, it will run a script to check that your server environment is set up correctly.


Configure Apache

Check that the Apache web server modules that Airtime requires are enabled:

$ sudo a2enmod php5 rewrite

The server should respond:

Module php5 already enabled Module rewrite already enabled

Next, create the Airtime virtual host configuration file for Apache:

$ sudo nano /etc/apache2/sites-available/airtime

and enter the information below, substituting your system administrator's email address for admin@example.com. Make sure you set the DocumentRoot and Directory paths correctly. This should match the public directory that the installer unpacked the web interface into, which by default is the /var/www/airtime/public/ directory.

<VirtualHost *:80>
   ServerAdmin admin@example.com
   DocumentRoot /var/www/airtime/public 
  SetEnv APPLICATION_ENV "development" 
  <Directory /var/www/airtime/public>
      DirectoryIndex index.php
      AllowOverride all
      Order allow,deny
      Allow from all
  </Directory>
</VirtualHost>

Press Ctrl+O to save the file, then Ctrl+X to exit the nano editor. Then enter the command:

$ sudo a2ensite airtime

The server should respond:

Enabling site airtime. Run '/etc/init.d/apache2 reload' to activate new configuration!

As suggested by the output of the command above, reload the web server configuration.

$ sudo /etc/init.d/apache2 reload

The server should respond:

* Reloading web server config apache2

Configure PHP

Edit the php.ini file to change PHP settings for the server to those that Airtime requires.

$ sudo nano /etc/php5/apache2/php.ini 


This is a long file, so use the search tool (press Ctrl+W) to find the particular lines that you're looking for. The recommended initial settings for Airtime are:

memory_limit = 256M
magic_quotes_gpc = Off
file_uploads = On
upload_tmp_dir = /tmp
phar.readonly = Off

If any of the above lines are commented out with a semi-colon at the beginning, you will need to remove that semi-colon for the setting to work.

You will also need to set the time zone that Airtime will display to match local time at your station. Find the line in the php.ini file which begins date.timezone, remove the semi-colon comment if present, and add the required time zone to the end of the line. For example:

date.timezone = "America/Toronto"

The time zone value should be in quotes, as above. You can find the correct value for your server's time zone in the appendix of this manual.

Press Ctrl+O to save the php.ini file, then Ctrl+X to exit the nano editor.

Secure and enable Icecast

If you have installed the Icecast streaming media server, before running it for the first time you should edit the file /etc/icecast2/icecast.xml to change the default <source-password>, <relay-password> and <admin-password> values from 'hackme' to something more secure.

$ sudo nano /etc/icecast2/icecast.xml

Then set up the Icecast server to start automatically:

$ sudo nano /etc/default/icecast2

by setting the value of ENABLE to true on the last line of the /etc/default/icecast2 file:

ENABLE=true

Save and close the file with Ctrl+O and Ctrl+X, then start Icecast:

$ sudo service icecast2 start

The server should respond:

Starting icecast2: Starting icecast2 Detaching from the console icecast2.

Configure Liquidsoap

You can open the liquidsoap.cfg file for editing with the command:

$ sudo nano /etc/airtime/liquidsoap.cfg

To set up Airtime for direct streaming, set the value of icecast_pass to the <source-password> value that you set in the Icecast configuration file. If you are streaming to a separate Icecast server, set the value of icecast_host to the domain name or IP address of the other machine. The value of icecast_port can be left as the default of 8000, unless you have been provided with a different port number by the system administrator of the Icecast server.

You can also configure the values of mount_point_mp3, mount_point_vorbis, icecast_url, icecast_description, and icecast_genre to suit your station. The option output_icecast_vorbis_metadata defaults to false because some media player clients are known to disconnect from the stream when Ogg Vorbis metadata changes to show new track information.

If you require direct output to an ALSA soundcard device on the Airtime server, in addition to the Icecast stream, change the value of output_sound_device from the default of false to true:

output_sound_device = true

If you do not require an Icecast stream in either Ogg Vorbis or MP3 format, you can set the values of output_icecast_vorbis or output_icecast_mp3, respectively, to false. Then save and close the file with Ctrl+O and Ctrl+X. Configure Airtime

Optionally, you may wish to edit the file /etc/airtime/airtime.conf to set the directory where Airtime media files are stored. For example, you may wish to store media on a RAID array which is not part of the server's root filesystem.

$ sudo nano /etc/airtime/airtime.conf

Find the line which begins base_files_dir and change the directory path to the one that you require, for example:

base_files_dir = /mnt/raid10/media

You can also set the PostgreSQL database host, and the username and password to connect to the database with in this file. Save and close the file with Ctrl+O and Ctrl+X.


Finally, reboot your server so that daemontools can initialize correctly. After that, you should be able to log in to the Airtime administration interface, as shown in the Getting started chapter.


Referensi

Pranala Menarik