Ubuntu 17.04: Install Tiny Tiny RSS for web base RSS reader

This article will installing Tiny Tiny RSS which is web base RSS reader.

1 Install Tiny Tiny RSS

The following script will install Tiny Tiny RSS.

  • MYSQL_PASSWD is root user's password of MySQL.
  • TT_RSS_PASSWD is tt-rss user's password of MySQL.
  • TT_RSS_FQDN is a server machine's FQDN. Please change your server machine which will be installed Tiny Tiny RSS.
#!/bin/sh

set -e

export DEBIAN_FRONTEND=noninteractive
MYSQL_VERSION=5.7
[ -z "${MYSQL_PASSWD}" ] && MYSQL_PASSWD=mysql
[ -z "${TT_RSS_PASSWD}" ] && TT_RSS_PASSWD=tt-rss
[ -z "${TT_RSS_URL}" ] && TT_RSS_FQDN=tt-rss.hiroom2.com
TT_RSS_URL=https://${TT_RSS_FQDN}/tt-rss

mysql_install()
{
  cat <<EOF | sudo debconf-set-selections
mysql-server-${MYSQL_VERSION} mysql-server/root_password password ${MYSQL_PASSWD}
mysql-server-${MYSQL_VERSION} mysql-server/root_password_again password ${MYSQL_PASSWD}
EOF
  sudo apt install -y mysql-server
}

ttrss_install()
{
  cat <<EOF | sudo debconf-set-selections
tt-rss tt-rss/dbconfig-install      boolean     true
tt-rss tt-rss/database-type         select      mysql
tt-rss tt-rss/mysql/admin-pass      password    ${MYSQL_PASSWD}
tt-rss tt-rss/password-confirm      password    ${MYSQL_PASSWD}
tt-rss tt-rss/mysql/app-pass        password    ${TT_RSS_PASSWD}
tt-rss tt-rss/app-password-confirm  password    ${TT_RSS_PASSWD}
tt-rss tt-rss/reconfigure-webserver multiselect apache2
# tt-rss/self_url_path must be set for installing tt-rss automatically.
tt-rss tt-rss/self_url_path         string      https://${TT_RSS_FQDN}/tt-rss
EOF

  sudo apt install -y tt-rss php-mbstring

  # When installing tt-rss automatically with debconf-set-selections,
  # tt-rss's postinst read tt-rss/self_url_path but does not use it value.
  # So this script sets tt-rss/self_url_path and set config.php again.
  cat <<EOF | sudo debconf-set-selections
tt-rss tt-rss/self_url_path         string      https://${TT_RSS_URL}/tt-rss
EOF
  sudo sed -e "s;define('SELF_URL_PATH', '.*');define('SELF_URL_PATH', '${TT_RSS_URL}');g" \
       -i /etc/tt-rss/config.php
  sudo systemctl restart tt-rss

  cd ..
}

apache_install()
{
  sudo cp /etc/tt-rss/apache.conf /etc/tt-rss/apache.conf.orig
  cat <<EOF | sudo tee /etc/tt-rss/apache.conf
<VirtualHost _default_:443>
  SSLEngine on
  SSLCertificateFile    /etc/ssl/certs/ssl-cert-snakeoil.pem
  SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key

$(sed -e 's/^/  /g' /etc/tt-rss/apache.conf.orig)
</VirtualHost>
EOF
  sudo a2enmod php7.0
  sudo a2enmod ssl
  sudo systemctl enable apache2
  sudo systemctl restart apache2
}

ttrss_main()
{
  mysql_install
  ttrss_install
  apache_install
}

ttrss_main

2 Access to Tiny Tiny RSS

Access to the following URL. Accept this page's certification to browser.

https://<server>/tt-rss

Login page of Tiny Tiny RSS is displayed. Login as admin user with setting "admin" to Login and "password" to Password.

0001_tt-rss.png