--- title: Configuration sidebar_position: 20 --- The streaming host configuration for LibreTime is shown in the file `/etc/airtime/liquidsoap.cfg` which is automatically generated by the **Streams** page, found on the **System** menu of the LibreTime administration interface. For this reason, you would not normally edit the streaming configuration manually, as any changes are likely to be overwritten by the administration interface. ## Database and RabbitMQ hosts Optionally, you may wish to edit the file `/etc/airtime/airtime.conf` to set the PostgreSQL database host, and the username and password to connect to the database with. You can also set options for RabbitMQ messaging and the LibreTime server in this file, although you shouldn't normally need to adjust the defaults unless you are running a large LibreTime system distributed across multiple servers. To run the LibreTime server in demo mode, which changes the greeting on the login page and prevents user accounts from being created or modified, set the value of _demo_ to 1. ```ini title="/etc/airtime/airtime.conf" [database] host = localhost port = 5432 name = libretime user = libretime password = libretime [rabbitmq] host = 127.0.0.1 port = 5672 user = airtime password = XXXXXXXXXXXXXXXXXXXX vhost = /airtime [general] api_key = XXXXXXXXXXXXXXXXXXXXX web_server_user = www-data airtime_dir = /usr/share/airtime base_url = libretime.example.com base_port = 80 base_dir = / cache_ahead_hours = 1 [monit] monit_user = guest monit_password = airtime [demo] demo = 0 ``` Save and close the file then, run the following commands to restart LibreTime's services: ```bash sudo systemctl restart libretime-liquidsoap sudo systemctl restart libretime-playout sudo systemctl restart libretime-celery sudo systemctl restart libretime-analyzer ``` ## Apache max file size configuration By default, the maximum upload file size is 40 MB, which may not be large enough for some stations, especially if they're uploading prerecorded shows. The setting for this is located in `/etc/apache2/sites-available/airtime.config`. Search for and update the following in megabytes: ```ini ; Maximum allowed size for uploaded files. upload_max_filesize = 40M ; Must be greater than or equal to upload_max_filesize post_max_size = 40M ``` For quick reference, 1024 MB = 1 GB and 2048 MB = 2 GB, but most should be okay with rounding to the nearest thousand. After updating the config file, restart Apache with `sudo systemctl restart apache2`. ## Playout settings Settings for pypo, the playout engine used by LibreTime, are found in the file `/etc/airtime/airtime.conf`. After making changes to this file, run `sudo systemctl restart libretime-playout`. ```ini ############################################ # pypo - configuration # ############################################ # Set the type of client you are using. # Currently supported types: # 1) "obp" = Open Broadcast Platform # 2) "airtime" # api_client = airtime ############################################ # Cache Directories # # *include* trailing slash !! # ############################################ cache_dir = /var/tmp/airtime/pypo/cache/ file_dir = /var/tmp/airtime/pypo/files/ tmp_dir = /var/tmp/airtime/pypo/tmp/ ############################################ # Setup Directories # # Do *not* include trailing slash !! # ############################################ cache_base_dir = /var/tmp/airtime/pypo bin_dir = /usr/lib/airtime/pypo log_base_dir = /var/log/airtime pypo_log_dir = /var/log/airtime/pypo liquidsoap_log_dir = /var/log/airtime/pypo-liquidsoap ############################################ # Liquidsoap settings # ############################################ ls_host = 127.0.0.1 ls_port = 1234 ############################################ # RabbitMQ settings # ############################################ rabbitmq_host = localhost rabbitmq_user = airtime rabbitmq_password = XXXXXXXXXXXXXXXXXXXX rabbitmq_vhost = /airtime ############################################ # pypo preferences # ############################################ # Poll interval in seconds. # # This will rarely need to be changed because any schedule changes are # automatically sent to pypo immediately. # # This is how often the poll script downloads new schedules and files from the # server in the event that no changes are made to the schedule. # poll_interval = 3600# in seconds. # Push interval in seconds. # # This is how often the push script checks whether it has something new to # push to liquidsoap. # # It's hard to imagine a situation where this should be more than 1 second. # push_interval = 1# in seconds # 'pre' or 'otf'. 'pre' cues while playlist preparation # while 'otf' (on the fly) cues while loading into ls # (needs the post_processor patch) cue_style = pre ``` ## RabbitMQ hostname changes If the Airtime logs indicate failures to connect to the RabbitMQ server, such as: ``` 2013-10-31 08:21:11,255 ERROR - [pypomessagehandler.py : main() : line 99] - Error connecting to RabbitMQ Server. Trying again in few seconds 2013-10-31 08:21:11,255 ERROR - \[pypomessagehandler.py : main() : line 99\] - Error connecting to RabbitMQ Server. Trying again in few seconds - See more at: https://forum.sourcefabric.org/discussion/16050/#sthash.W8OJrNFm.dpuf ``` but the RabbitMQ server is running normally, this error might be due to a change in the server's hostname since LibreTime installation. Directory names under `/var/lib/rabbitmq/mnesia/` indicate that RabbitMQ's database files are organized according to the hostname of the server (ex. `rabbit@airtime`) where the hostname is `airtime.example.com`. If the hostname has changed, it may be necessary to reconfigure RabbitMQ manually, as follows: 1. Delete the files in `/var/lib/rabbitmq/mnesia/` ```bash sudo rm -r /var/lib/rabbitmq/mnesia/* ``` 2. Restart RabbitMQ: ```bash sudo systemctl restart rabbitmq-server ``` 3. Enter the following commands to set up authentication and grant permissions. The _rabbitmqctl add_user_ command requires the RabbitMQ password from the /etc/airtime/airtime.conf file as an argument. The _rabbitmqctl set_permissions_ command should be entered on one line, with the list of Airtime services repeated three times: ```bash rabbitmqctl add_vhost /airtime rabbitmqctl add_user airtime XXXXXXXXXXXXXXXXXXXX rabbitmqctl set_permissions -p /airtime airtime "airtime-pypo|pypo-fetch|airtime-analyzer|media-monitor" "airtime-pypo|pypo-fetch|airtime-analyzer|media-monitor" "airtime-pypo|pypo-fetch|airtime-analyzer|media-monitor" ```