跳转至

自建RSS阅读器Tiny Tiny RSS安装和配置

Tiny Tiny RSS使用的是PHP,因此建议使用LNMP环境来运行。

搭建LNMP环境

参考ubuntu手动安装LNMP环境

nginx配置

新建nginx的配置文件-/etc/nginx/sites-enabled/reader.zimoapps.com.conf:

vi /etc/nginx/sites-enabled/reader.zimoapps.com.conf
粘贴入以下内容:
server {
    server_name reader.zimoapps.com;
    root /home/sites/tt-rss;
    index index.php index.html index.htm index.nginx-debian.html;
    listen 443 ssl;
    ssl_certificate /etc/letsencrypt/live/zimoapps.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/zimoapps.com/privkey.pem;
    location ~ [^/]\.php(/|$) {
        fastcgi_split_path_info ^(.+?\.php)(/.*)$;
        if (!-f $document_root$fastcgi_script_name) {
            return 404;
        }

        # Mitigate https://httpoxy.org/ vulnerabilities
        fastcgi_param  SCRIPT_FILENAME $request_filename;

        #fastcgi_pass 127.0.0.1:9000;
        fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
        fastcgi_index index.php;

        # include the fastcgi_param setting
        include fastcgi_params;

        # SCRIPT_FILENAME parameter is used for PHP FPM determining
        #  the script name. If it is not set in fastcgi_params file,
        # i.e. /etc/nginx/fastcgi_params or in the parent contexts,
        # please comment off following line:
        # fastcgi_param  SCRIPT_FILENAME   $document_root$fastcgi_script_name;
    }
}
server {
    if ($host = reader.zimoapps.com) {
        return 301 https://$host$request_uri;
    }
    listen 80;
    server_name reader.zimoapps.com;
    return 404;
}
保存并退出。同时,新建配置文件中提到的/var/www/reader.zimoapps.com目录。nginx -s reload让配置立即生效。

安装Tiny Tiny RSS

切换到上述配置的root路径,,并克隆源码:

cd /home/sites
git clone 
上述操作完成后,会在/home/sites下面生成tt-rss目录。该目录的权限就是所有者需要修改:

chmod -R 777 tt-rss
chown -R www-data:www-data tt-rss

访问设置的域名(reader.zimoapps.com)就能看到开始页面了

配置Tiny Tiny RSS

安装页面中需要填入数据库相关信息,点击按钮会报错,常见的是数据库没有,此时需要在服务器上手动新建数据库(使用mysql)。

登录mysql

mysql -uroot -p

新建数据库,并退出mysql:

create database readerzimoappscom;
quit;

再回到浏览器页面,点击Test configuration不再报错后,继续下一步。点击Initialize database开始初始化数据库。稍作等待后,点击Save configuration将生成的配置文件保存在服务器上。

点击loading tt-rss now,回到Tiny Tiny RSS登录界面,登录后就可以正常使用了。

Tips

默认的账号是admin,密码是password,记得登录后修改。

更新订阅源

默认情况下,Tiny Tiny RSS不会自动更新订阅。更新方式有两大类:浏览器前台更新和服务器后台自动更新。

浏览器前台更新

只有在打开浏览器情况下,才会更新,一旦关闭了浏览器,就不再更新。开启方式是修改根目录下的config.php文件:

define('SIMPLE_UPDATE_MODE', true);

服务器后台更新

crontab -u www-data -e
在末尾插入:
*/10 * * * * /usr/bin/php /home/sites/tt-rss/update.php --feeds --quiet

Note

/home/sites/tt-rss/update.php视Tiny Tiny RSS的安装路径而定
/usr/bin/php是php的路径,一般就是这个

自定义Tiny Tiny RSS

未读条码加粗

实现一个类似于曾经的Google Reader的效果:未读的条目加粗,已读后去掉加粗效果。
进入以下路径:偏好设置>偏好设置>通用>主题,点击自定义,粘贴入以下代码:

.cdm{
    font-weight: normal;
}
.Unread{
    font-weight: bold;
}