お知らせ

現在サイトのリニューアル作業中のため、全体的にページの表示が乱れています。

タイトルの通りさくらのレンタルサーバーにTiny Tiny RSSを構築する話。いつの間にかDockerコンテナにされてたが本体は単純なPHPのままなのできちんと設定してやるとDocker環境がなくとも動く。

確認環境

Env Ver
Tiny Tiny RSS dc25a9cf6816b756cb38490eab93f02589c44a10

手順

以降Tiny Tiny RSSをTTRSS表記とする。

  1. さくらのコンパネからTTRSSで利用するDBを作る
  2. 以下のセットアップスクリプトを適宜書き換えて実行する
git clone https://git.tt-rss.org/fox/tt-rss.git

cd tt-rss/

cat <<'EOF' | > config.php
<?php
# This file can be used to customize global defaults if environment method is not available (i.e. no Docker).
#
# Use the following syntax to override defaults (options are declared in classes/config.php, prefixed by TTRSS_):
#
# putenv('TTRSS_SELF_URL_PATH=http://example.com/tt-rss');
#
# Plugin-required constants also go here, using define():
#
# define('LEGACY_CONSTANT', 'value');
#
# See this page for more information: https://tt-rss.org/wiki/GlobalConfig

putenv('TTRSS_PHP_EXECUTABLE=/usr/local/bin/php');

# Sets admin user access level to this value.
# Valid values:
# -2 - forbidden to login
# -1 - readonly
#  0 - default user
# 10 - admin
putenv('ADMIN_USER_ACCESS_LEVEL=10');

# Database
putenv('TTRSS_DB_TYPE=mysql');
putenv('TTRSS_DB_HOST=database.example.com');
putenv('TTRSS_DB_PORT=3306');
putenv('TTRSS_DB_USER=hoge');
putenv('TTRSS_DB_NAME=piyo');
putenv('TTRSS_DB_PASS=fuga');

# You will likely need to set this to the correct value, see README.md
# for more information.
putenv('TTRSS_SELF_URL_PATH=https://example.com/');
EOF

php update.php --update-schema
  1. TTRSSを設置したURLにアクセスする
  2. ID: admin, PW: password でログインする
  3. ログインパスワードを変更する
  4. 適当にフィードを登録する
  5. php update.php --feeds を流す
  6. TTRSSの画面でフィードが取得できることを確認する
  7. cronに以下のコマンドを適当に登録する
    • /usr/local/bin/php /home/<USER>/www/tt-rss/update.php --feeds --quiet 1> /dev/null

トラブルシューティング

TTRSS画面を開くとエラーが出る:Exception while creating PDO object:could not find driver

.envに設定を書いても読み込まれないのでconfig.phpに書く

TTRSS画面上にRSSの取得失敗エラーが出る:Update process failed with exit code: 127 ()

以下のコマンドを実行したときにエラーが出る筈なので、それを見て対処する

php update.php --force-update
php update.php --feeds

phpのパスが見つからないと言われた場合はconfig.phpputenv('TTRSS_PHP_EXECUTABLE=<PHP_PATH>');を追加して、phpのパスを設定すれば直る

フィードを追加しても更新されない

勝手に更新されることはないのでCRONが走るのを待つか以下のコマンドを流す

php update.php --feeds

Androidアプリが欲しい

Google Playにはなく、公式サイトからapkを落としてくる必要がある。
昔は有料だったが今は地味に無料化されている。

https://gitlab.tt-rss.org/tt-rss/tt-rss-android/-/releases

参考情報