× Warning! This forum is in archival status. New contributions may not work.
Airtime 2.5.1 Ubuntu 14.04 LTS SSL 2018 Update
  • [1] Generate an SSL certificate with certbot.
    apt-get install software-properties-common -y
    apt-get update && add-apt-repository ppa:certbot/certbot
    apt install python-certbot-apache -y
    certbot --apache -d <example.com> -d <www.example.com>
    * Replace <example.com> and <www.example.com> with your radio station domain name

    [2] Make sure that /usr/share/ is setup to allow override.
    nano /etc/apache2/apache2.conf
    * Make sure that the /usr/share section looks like this

    <Directory /usr/share/>
    Options Indexes FollowSymLinks
    AllowOverride All
    Require all granted
    </Directory>

    *If you make changes to the apache conf file be sure to restart Apache for the changes to take effect
    service apache2 restart

    [3] Create a .htaccess file in /usr/share/airtime/public with the following contents.

    php_value post_max_size 500M
    php_value upload_max_filesize 500M
    php_value request_order "GPC"
    php_value session.gc_probability 0
    php_value session.auto_start 0

    RewriteEngine On
    RewriteCond %{HTTPS} off
    RewriteCond %{REQUEST_URI} ^\/dashboard [NC,OR]
    RewriteCond %{REQUEST_URI} ^\/library [NC,OR]
    RewriteCond %{REQUEST_URI} ^\/listenerstat [NC,OR]
    RewriteCond %{REQUEST_URI} ^\/login [NC,OR]
    RewriteCond %{REQUEST_URI} ^\/playouthistory [NC,OR]
    RewriteCond %{REQUEST_URI} ^\/plupload [NC,OR]
    RewriteCond %{REQUEST_URI} ^\/preference [NC,OR]
    RewriteCond %{REQUEST_URI} ^\/schedule [NC,OR]
    RewriteCond %{REQUEST_URI} ^\/showbuilder [NC,OR]
    RewriteCond %{REQUEST_URI} ^\/systemstatus [NC,OR]
    RewriteCond %{REQUEST_URI} ^\/user [NC]
    RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
    RewriteCond %{REQUEST_FILENAME} -s [OR]
    RewriteCond %{REQUEST_FILENAME} -l [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^.*$ - [NC,L]
    RewriteRule ^.*$ index.php [NC,L]
    RewriteBase /

    AddOutputFilterByType DEFLATE text/plain
    AddOutputFilterByType DEFLATE text/html
    AddOutputFilterByType DEFLATE text/xml
    AddOutputFilterByType DEFLATE text/css
    AddOutputFilterByType DEFLATE application/xml
    AddOutputFilterByType DEFLATE application/xhtml+xml
    AddOutputFilterByType DEFLATE application/rss+xml
    AddOutputFilterByType DEFLATE application/javascript
    AddOutputFilterByType DEFLATE application/x-javascript
    AddOutputFilterByType DEFLATE application/json

    Your Airtime installation should now be secure on all web pages but not interfere with liquidsoap or any of the other services that might be affected by forcing all requests to HTTPS.

    Please let me know if I have missed any URL's and let me know how you get on.

    Andy - BlastFM Ltd
    AndyC - BlastFM Internet Radio Stations
  • 1 Comment sorted by
  • Thanks for this Andy!