Docs: slaying dragons round 1!

This commit is contained in:
ryan 2018-10-05 12:23:04 -05:00
parent 244b95382e
commit 6fa53f58d0
22 changed files with 0 additions and 517 deletions

View File

@ -1,224 +0,0 @@
***Beware, here be dragons!***
These Airtime instructions are outdated, see [install.md](../../install.md) for LibreTime instructions.
This installation method is intended for computers running Ubuntu or Debian GNU/Linux, and is the recommended method for production Airtime systems. If you have previously performed a manual installation of Airtime on the server, you should run the *airtime-uninstall* script to remove it before setting up the server for automated installation.
Set up repositories for Ubuntu
------------------------------
When installing on an Ubuntu server, a few of the packages that Airtime relies on are in the Ubuntu *universe* or *multiverse* repositories. If either of these repositories is disabled, you can enable them in the */etc/apt/sources.list* file, by opening the *nano* editor in your server's console. The *nano* editor should be installed by default, but if not, you can install it with the command:
sudo apt-get install nano 
Then open the *sources.list* file with the command:
sudo nano /etc/apt/sources.list
For an Ubuntu 10.04 Lucid server, find the lines which begin *deb* and end with *lucid universe* or *lucid-updates universe*, adding *multiverse* to the end of these lines, if it is not there already. Other versions of Ubuntu will have similar lines. The *multiverse* repository is required for the *libmp3lame0* library, which is an MP3 encoder. Later versions of Ubuntu, such as 12.04 Precise, have *libmp3lame0* in the *universe* repository.
![](static/Screenshot75-Sources_list.png)
The exact repository mirror URLs in your *sources.list* file will differ from the above screenshot, depending on your location.
The Sourcefabric repository contains packages for Airtime, and any other packages which Airtime requires. To add the Sourcefabric repository to an Ubuntu Lucid server, scroll to the end of the *sources.list* file and add the following line:
deb http://apt.sourcefabric.org/ lucid main
For Ubuntu 12.04 Precise, 12.10 Quantal, 13.04 Raring or 13.10 Saucy substitute *precise*, *quantal*, *raring* or *saucy* in place of *lucid* in the line above.
![](static/Screenshot61-Sources_list.png)
Press Ctrl+O (the Ctrl key and the letter O together) to save the file, then Ctrl+X to exit the nano editor.
Set up repositories for Debian
------------------------------
On a Debian squeeze or wheezy server, you can edit the */etc/apt/sources.list* file as root with the command:
nano /etc/apt/sources.list
Packages for MP3 encoding are not included in the Debian squeeze repositories. If your server runs squeeze, you can obtain the necessary *libmp3lame0* package by adding the following repository to the end of the file:
deb http://backports.debian.org/debian-backports squeeze-backports main
To add the Sourcefabric repository to a Debian squeeze server, add the following line to the end of the file:
deb http://apt.sourcefabric.org/ squeeze main
or for Debian wheezy:
deb http://apt.sourcefabric.org/ wheezy main
Press Ctrl+O (the Ctrl key and the letter O together) to save the file, then Ctrl+X to exit the *nano* editor.
Install the Sourcefabric signing key 
-------------------------------------
Reload the system's package list with:
sudo apt-get update
You will see an error message about a missing public key.
![](static/Screenshot62-No_pubkey.png)
To fix this system error, you need to install the *sourcefabric-keyring* package, which contains the package signing key. This encryption key is a security measure which helps ensure that the Airtime packages you will be downloading in future have not been tampered with by a third party. You can install the key with the command:
sudo apt-get install sourcefabric-keyring
When prompted, press the *y* key on your keyboard to install the *sourcefabric-keyring* package without verification. If you wish to verify the authenticity of the package signing key, please contact Sourcefabric for assistance.
![](static/Screenshot63-Sourcefabric_keyring.png)
Update your computer's software sources again, to confirm that you are now using a trusted software repository:
sudo apt-get update
You should no longer see the error message about the missing public key.
Install the database management system
--------------------------------------
Airtime uses a PostgreSQL database to keep track of media assets and associated metadata in its storage server. Depending on the scale of your Airtime installation and the hardware available, you may wish to install PostgreSQL on a separate server. If you only have one server, you can install the *postgresql* package on the same machine as Airtime with the command:
sudo apt-get install postgresql
Install a streaming server
--------------------------
Optionally, you may wish to stream directly from Airtime to an **Icecast** media distribution server, without requiring a soundcard or mixer in the broadcast chain. This option is particularly suitable for fully automated stations, in which all shows are played out using Airtime. You can install the **icecast2** package on your server with the command:
sudo apt-get install icecast2
In some scenarios, you may wish to stream from Airtime to a remote Icecast server, for example when Icecast is installed on a server in a data center with greater bandwidth available than an Airtime server located at your broadcast studio has. This separation may become necessary if your stream becomes popular, because each additional listener which connects to the Icecast stream uses additional bandwidth. In this case, you do not need to install the **icecast2** package on the same server as Airtime.
Before running Icecast on a remote server for the first time, you should change the default *<source-password>*, *<relay-password>* and *<admin-password>* values from *hackme* to something more secure. On more recent GNU/Linux distributions, such as Ubuntu 12.04 'Precise Pangolin' or later, you may be prompted for these settings during the installation of Icecast. If not, you can edit the Icecast configuration manually, with the command:
sudo nano /etc/icecast2/icecast.xml
![](static/Screenshot77-Icecast_config.png)
You should also set the value of *<hostname>* to the domain name of the Icecast server, for example:
<hostname>icecast.example.com</hostname>
This step ensures that stream URLs are generated correctly by the Icecast server.
Save and close the *icecast.xml* file with Ctrl+O and Ctrl+X. Then check the Icecast server is set to start automatically when the server boots in the */etc/default/icecast2* file:
sudo nano /etc/default/icecast2
The value of *ENABLE* should be set to *true* on the last line of that file:
ENABLE=true
Save and close this 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.
Install Airtime
---------------
You can now install the Airtime package with:
sudo apt-get install airtime
This command will install all of the Airtime components, plus any other packages that Airtime requires in order to run.
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
airtime-audio-samples
The following NEW packages will be installed
airtime
0 upgraded, 1 newly installed, 0 to remove and 2 not upgraded.
Need to get 8,446kB of archives.
After this operation, 33.3MB of additional disk space will be used.
Get: 1 http://apt.sourcefabric.org/ precise/main airtime 2.5.0-1 [8,446kB]
Fetched 8,446kB in 8s (1,015kB/s)
Preconfiguring packages ...
Selecting previously deselected package airtime.
(Reading database ... 657254 files and directories currently installed.)
Unpacking airtime (from .../airtime_2.5.0-1_all.deb) ...
Once all the packages have been downloaded and installed, you will be asked a few questions about the configuration of the Airtime system. You can accept the default settings by pressing the **Enter** key, or use the **Tab** key to change your selection.
Firstly, you will asked if you wish to create an **Apache** virtual host web server configuration automatically.
![](static/Screenshot65-Create_vhost.png)
If so, you will need to enter the domain name that your station staff will use to access Airtime. This would normally be a fully qualified domain name (FQDN) which is already set up in DNS, or dynamic DNS, to point to the IP address of the Airtime server. For a test server that will only be accessed directly from the same machine, you can use the default setting of *localhost* here.
![](static/Screenshot66-Set_domain.png)
Next, set the contact email address of the server administrator, which is good practice in case of any server problems. For a test server, using an address at the *localhost* is acceptable.
![](static/Screenshot67-Admin_email.png)
Debian and Ubuntu servers are set up with a default Apache configuration, which might block station staff from accessing Airtime. If you wish, this default configuration can be removed automatically for you.
![](static/Screenshot68-Remove_default.png)
If you are installing Airtime and Icecast on the same machine, you can set the hostname and passwords for the Icecast server during the Airtime installation.
![](static/Screenshot184-Configure_Icecast.png)
First, set the hostname of the Icecast server. For test installs in which you have Icecast installed on the same machine as Airtime, you can use *localhost* here.
![](static/Screenshot185-Icecast_hostname.png)
The security of your streaming server depends on the strength of the passwords that you choose. You should set strong passwords for *source*, *relay* and *admin* access.
![](static/Screenshot186-Icecast_source_password.png)
By default, Airtime stores media files under the path */srv/airtime/stor/* but you can specify an alternative path if you wish. If you change this setting, the new path must end with a slash. This main storage path is separate from the *watched folders* which are configured after installation, in the Airtime administration interface. See the chapter *Media Folders* for details of how to add watched folders.
![](static/Screenshot381-Specify_storage_path.png)
Finally, you have the option to set a more secure password for Airtime's *admin* user than the default of *admin*. You could change the password for the *admin* user later, in the Airtime administration interface, but this would mean that your installation would be insecure until you carried out that task.
![](static/Screenshot281-Set_admin_password.png)
On some GNU/Linux distributions, you may be warned about upgrading the **rabbitmq-server** package, even if you have never installed this package before. If RabbitMQ is only being used by Airtime on your server, it is safe to press the **Enter** key to continue.
![](static/Screenshot73-Rabbit_upgrade.png)
The Airtime installer will then run a script to check that your server environment is set up correctly.
*** Verifying your system environment, running airtime-check-system ***
AIRTIME_STATUS_URL = http://airtime.example.com:80/api/status/format/json/api_key/%%api_key%%
AIRTIME_SERVER_RESPONDING = OK
KERNEL_VERSION = 3.2.0-4-amd64
MACHINE_ARCHITECTURE = x86_64
TOTAL_MEMORY_MBYTES = 2963688
TOTAL_SWAP_MBYTES = 7812092
AIRTIME_VERSION = 2.5.1
OS = Debian GNU/Linux 7.1 (wheezy) x86_64
CPU = AMD Turion(tm) II Neo N40L Dual-Core Processor
WEB_SERVER = Apache/2.2.22 (Debian)
PLAYOUT_ENGINE_PROCESS_ID = 4446
PLAYOUT_ENGINE_RUNNING_SECONDS = 55
PLAYOUT_ENGINE_MEM_PERC = 0.5%
PLAYOUT_ENGINE_CPU_PERC = 0.4%
LIQUIDSOAP_PROCESS_ID = 4685
LIQUIDSOAP_RUNNING_SECONDS = 49
LIQUIDSOAP_MEM_PERC = 0.7%
LIQUIDSOAP_CPU_PERC = 7.4%
MEDIA_MONITOR_PROCESS_ID = 4410
MEDIA_MONITOR_RUNNING_SECONDS = 55
MEDIA_MONITOR_MEM_PERC = 0.5%
MEDIA_MONITOR_CPU_PERC = 0.0%
-- Your installation of Airtime looks OK!
************ Install Complete ************
You should now be able to log in to the Airtime administration interface, as shown in the *Getting started* chapter. See the *Host configuration* chapter for advanced settings.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

View File

@ -1,54 +0,0 @@
***Beware, here be dragons!***
These Airtime instructions are outdated, see [install.md](../../install.md) for LibreTime instructions.
The **airtime-easy-setup** package sets up a typical Airtime configuration without prompting you for any settings. You can then install the latest Airtime package from the Sourcefabric repository with a few clicks.
After that, the Airtime administration interface can be accessed at the default domain name of the computer (such as *http://airtime.example.com*). If you have not yet set a fully qualified domain name for the computer, you can use a URL such as *http://ubuntu/* on the localhost for testing purposes. Whichever domain name you use, the Icecast administration interface will be at port 8000 of the same URL (such as *http://airtime.example.com:8000*).
You can download the **airtime-easy-setup** package from <http://apt.sourcefabric.org/misc/airtime-easy-setup.deb> which is a link to the latest version of the package. You should stay connected to the Internet throughout the installation, as a number of dependency packages have to be installed from online repositories.
On Ubuntu 10.04 'lucid', Debian 6.0 'squeeze' or Debian 7.2 'wheezy', you can run the **airtime-easy-setup** ** package from your browser using the program **GDebi**.
![](static/Screenshot278-Opening_airtime-easy-setup.png) 
If you have chosen to save the package to your computer instead, in the desktop file manager, right-click on the **airtime-easy-setup** ** package and select **Open with GDebi Package Installer**:
![](static/Screenshot279-Downloaded_airtime-easy-setup.png) 
Or for an Ubuntu Lucid or Debian server without a desktop, you can use <span style="font-weight: bold;">gdebi</span> on the command line:
sudo apt-get update
sudo gdebi airtime-easy-setup.deb
If gdebi is not installed, you can run this command first:
sudo apt-get install gdebi
Later versions of Ubuntu have replaced GDebi with the program **software-center**. On a desktop installation, right-click on the package and select **Open with Ubuntu Software Centre**. This desktop program can also be run from the command line, for example: 
software-center airtime-easy-setup.deb
![](static/Screenshot523-Easy_setup_software_center.png)
Any of the methods above should resolve package dependencies automatically.
Install Airtime
---------------
Once the installation of **airtime-easy-setup** has completed, you can install the latest Airtime package on a desktop system using your usual package manager, such as **Ubuntu Software Centre**, or **Synaptic** on Debian.
![](static/Screenshot524-Package_installed_software_center.png)
On a server, you can use the command:
sudo airtime-easy-setup
Configure for production
------------------------
To convert a test installation into a production installation, you can run the command:
sudo dpkg-reconfigure airtime
The **dkpg-reconfigure** command will run through the configuration steps shown in the *Automated installation* chapter, so that you can set the correct hostnames and passwords for your production Airtime server.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

View File

@ -1,239 +0,0 @@
***Beware, here be dragons!***
These Airtime instructions are outdated, see [install.md](../../install.md) for LibreTime instructions.
You do not normally need to install Airtime manually, unless you are testing a development version of the software. Versions of Airtime recommended for production use are available for download and upgrade via *secure apt*, as shown in the *Automated installation* chapter.
Dependencies provided by Sourcefabric
-------------------------------------
The <http://apt.sourcefabric.org/> repository contains up-to-date Debian and Ubuntu packages of Airtime dependencies such as **liquidsoap** and **silan** which you may find convenient to install, even if you are installing Airtime manually. Refer to the chapter *Automated installation* for repository setup details.
Airtime requires a version of **python-virtualenv** later than 1.4.8, but Ubuntu Lucid includes the older version 1.4.5 of this package. Before performing a manual installation on Lucid, you should update **python-virtualenv** using the backported package available from the <http://apt.sourcefabric.org/> repository. This step is not necessary when performing an automated installation, in which dependencies are resolved automatically.
Full install
------------
The **airtime-full-install** script is designed to configure your server for you, using typical default settings.
1. In the server terminal or console, download Airtime from <https://github.com/sourcefabric/Airtime/releases> with **wget**. For example, to download version 2.5.1, you could use the command:
wget https://github.com/sourcefabric/Airtime/archive/airtime-2.5.1-ga.tar.gz
Then unzip the downloaded file in your home directory. This action will create a subdirectory called *airtime-2.5.1*:
tar -xvzf airtime-2.5.1-ga.tar.gz -C ~/
Alternatively, clone the git repository if you wish to work on the latest Airtime source code:
git clone https://github.com/sourcefabric/Airtime.git
In order to return your code improvements to Airtime, you will need to create your own fork of the Airtime git repository and send pull requests. See the GitHub help page <https://help.github.com/articles/fork-a-repo> for details.
2. Run the **airtime-full-install** script, for example on Ubuntu:
sudo ~/airtime-2.5.1/install_full/ubuntu/airtime-full-install
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 the **airtime-check-system** script to confirm that your server environment is set up correctly.
*** Verifying your system environment, running airtime-check-system ***
AIRTIME_STATUS_URL = http://airtime.example.com:80/api/status/format/json/api_key/%%api_key%%
AIRTIME_SERVER_RESPONDING = OK
KERNEL_VERSION = 3.2.0-4-amd64
MACHINE_ARCHITECTURE = x86_64
TOTAL_MEMORY_MBYTES = 2963688
TOTAL_SWAP_MBYTES = 7812092
AIRTIME_VERSION = 2.5.1
OS = Debian GNU/Linux 7.1 (wheezy) x86_64
CPU = AMD Turion(tm) II Neo N40L Dual-Core Processor
WEB_SERVER = Apache/2.2.22 (Debian)
PLAYOUT_ENGINE_PROCESS_ID = 4446
PLAYOUT_ENGINE_RUNNING_SECONDS = 55
PLAYOUT_ENGINE_MEM_PERC = 0.5%
PLAYOUT_ENGINE_CPU_PERC = 0.4%
LIQUIDSOAP_PROCESS_ID = 4685
LIQUIDSOAP_RUNNING_SECONDS = 49
LIQUIDSOAP_MEM_PERC = 0.7%
LIQUIDSOAP_CPU_PERC = 7.4%
MEDIA_MONITOR_PROCESS_ID = 4410
MEDIA_MONITOR_RUNNING_SECONDS = 55
MEDIA_MONITOR_MEM_PERC = 0.5%
MEDIA_MONITOR_CPU_PERC = 0.0%
-- Your installation of Airtime looks OK!
************ Install Complete ************
You are now ready to proceed to the *Configuration* chapter.
Minimal install
---------------
The alternative **airtime-install** script does not attempt to configure your server, an option which you may find more suitable if you have special requirements.
1. In the server terminal or console, install the list of dependencies. For example, on Ubuntu you could enter the command:
sudo apt-get install postgresql python-virtualenv apache2 coreutils \
curl ecasound flac gzip libapache2-mod-php5 libcamomile-ocaml-data \
liquidsoap locales lsof monit mp3gain multitail patch php5-cli \
php5-curl php5-gd php5-json php5-pgsql php-apc php-pear pwgen \
python rabbitmq-server silan sudo sysv-rc tar unzip \
vorbisgain vorbis-tools libzend-framework-php
On Debian, install *zendframework* instead of the *libzend-framework-php* package.
2. 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
3. Create a directory to contain the Airtime web interface:
sudo mkdir -p /usr/share/airtime/public
4. Next, create the Airtime virtual host configuration file for Apache:
sudo nano /etc/apache2/sites-available/airtime.conf
and enter the information below, substituting your server's hostname for *airtime.example.com* and your system administrator's email address for *admin@example.com*. Make sure you set the *DocumentRoot* and *Directory* paths correctly. This should normally match the *public* directory that the installer will unpack the web interface into, which by default is the */usr/share/airtime/public/* directory. From Airtime 2.3.0 onwards, the web interface can be installed in a subdirectory of the *DocumentRoot* if you require it to be.
For Apache 2.2, you can use the following syntax:
<VirtualHost *:80>
ServerName airtime.example.com
ServerAdmin admin@example.com
DocumentRoot /usr/share/airtime/public
php_admin_value upload_tmp_dir /tmp
<Directory /usr/share/airtime/public>
DirectoryIndex index.php
AllowOverride all
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
Apache 2.4 uses a different access control syntax in the Directory stanza:
<VirtualHost *:80>
ServerName airtime.example.com
ServerAdmin admin@example.com
DocumentRoot /usr/share/airtime/public
php_admin_value upload_tmp_dir /tmp
<Directory /usr/share/airtime/public>
DirectoryIndex index.php
AllowOverride all
Require all granted
</Directory>
</VirtualHost>
Press Ctrl+O to save the file, then Ctrl+X to exit the **nano** editor.
5. Create the PHP configuration file */etc/airtime/airtime.ini* in nano:
sudo nano /etc/airtime/airtime.ini
with the following contents:
[PHP]
memory_limit = 512M
magic_quotes_gpc = Off
file_uploads = On
upload_tmp_dir = /tmp
apc.write_lock = 1
apc.slam_defense = 0
Save and exit nano, then link this file to the system's PHP configuration with the command:
sudo ln -s /etc/airtime/airtime.ini /etc/php5/conf.d/airtime.ini
6. Enable the new configuration by entering the command:
sudo a2ensite airtime
The server should respond:
Enabling site airtime.
Run '/etc/init.d/apache2 reload' to activate new configuration!
You may also need to disable the default site configuration, which may otherwise interfere with your Airtime installation:
sudo a2dissite default
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
7. Download Airtime from <https://github.com/sourcefabric/Airtime/releases> with **wget**, and unzip the downloaded file in your home directory. This action will create a subdirectory called *airtime-2.5.1*:
wget https://github.com/sourcefabric/Airtime/archive/airtime-2.5.1-ga.tar.gz
tar -xvzf airtime-2.5.1-ga.tar.gz -C ~/
Alternatively, clone the Airtime git repository as shown above.
8. Monit is a utility which Airtime uses to make sure that the system runs smoothly. Enable it by opening the */etc/default/monit* file in the **nano** editor: 
sudo nano /etc/default/monit
Find the line that begins with *START* and change the value to *yes*:
START=yes
Save the file with Ctrl+O and close nano with Ctrl+X. Now copy the Monit configuration from the Airtime install directory to the */etc/monit/conf.d/* directory:
sudo cp ~/airtime-2.5.1/python_apps/monit/airtime-monit.cfg /etc/monit/conf.d/
Open the */etc/monit/monitrc* file in **nano**:
sudo nano /etc/monit/monitrc
At the end of the file, add the line:
include /etc/monit/conf.d/*
Save the file with Ctrl+O and close nano with Ctrl+X. Then start Monit with:
sudo invoke-rc.d monit start
More information about monit is available in the chapter *Using Monit*.
9. On Debian squeeze, make sure the rabbitmq-server daemon has started:
sudo invoke-rc.d rabbitmq-server start
10. Finally, run the minimal **airtime-install** script: 
sudo ~/airtime-2.5.1/install_minimal/airtime-install 
Once the **airtime-check-system** script confirms that the install has been successful, you should now be able to log in to the Airtime administration interface, as shown in the *Getting started* chapter, with the username *admin* and the password *admin*. See the *Configuration* chapter for advanced settings.
Install script options
----------------------
By default, the **airtime-install** script preserves any existing configuration or installation that it finds on the server. However, it is also possible to dictate the behaviour of the script with a command line option, as follows:
--help|-h            Displays usage information.
--overwrite|-o       Overwrite any existing config files.
--preserve|-p        Keep any existing config files.
--no-db|-n           Turn off database install.
--reinstall|-r       Force a fresh install of this Airtime version.
Manual uninstall
----------------
To manually uninstall Airtime from the server, run the **airtime-uninstall** script from the minimal installation directory, for example:
sudo ~/airtime-2.5.1/install_minimal/airtime-uninstall
Optionally, you can also delete the Airtime storage and configuration folders, if you have backups and are not going to need the data on this particular server again. The **rm** command should be used with caution, because it has no undo feature.
sudo rm -r /srv/airtime
sudo rm -r /etc/airtime