タイトルの通りさくらのレンタルサーバーにTiny Tiny RSSを構築する話。いつの間にかDockerコンテナにされてたが本体は単純なPHPのままなのできちんと設定してやるとDocker環境がなくとも動く。
確認環境
| Env | Ver |
|---|---|
| Tiny Tiny RSS | dc25a9cf6816b756cb38490eab93f02589c44a10 |
手順
以降Tiny Tiny RSSをTTRSS表記とする。
- さくらのコンパネからTTRSSで利用するDBを作る
以下のセットアップスクリプトを適宜書き換えて実行する
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-schemaTTRSSを設置したURLにアクセスする
- ID:
admin, PW:passwordでログインする - ログインパスワードを変更する
- 適当にフィードを登録する
php update.php --feedsを流す- TTRSSの画面でフィードが取得できることを確認する
- 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.phpにputenv('TTRSS_PHP_EXECUTABLE=<PHP_PATH>');を追加して、phpのパスを設定すれば直る
フィードを追加しても更新されない
勝手に更新されることはないのでCRONが走るのを待つか以下のコマンドを流す
php update.php --feeds
Androidアプリが欲しい
Google Playにはなく、公式サイトからapkを落としてくる必要がある。
昔は有料だったが今は地味に無料化されている。
参考情報
- Tiny Tiny RSS
- 公式サイト
- Installing on a host machine
- ホストマシンへのインストール方法に関する公式資料