Most recently, the "Corporation of Good" closed Google Reader. Thousands of users stood before the choice of RSS feed reader. Someone immediately found what he liked, and someone is still in search. But all online readers have one major drawback - they, like Google Reader, can close at any time. The way out of this situation is to install one of the most popular self-hosted readers - Tiny Tiny RSS (hereinafter tt-rss). It can be installed on a VDS server or home computer. But you have to pay for the server, albeit small, but money, and keeping the always-on PC (in order to have access to the reader from everywhere) is problematic. However, if you have a Zyxel Keenetic router working, then tt-rss can install a reader on it!
To install you need:
- Any Zyxel Keenetic router with firmware V1
- USB flash drive, or USB hard disk (preferred)
Read more about the firmware. Keenetic routers have two series of V1 and V2 firmware, respectively. The firmware of the first series is notable in that they allow you to install packages on an external usb drive / flash drive. And this is implemented without the firmware of the router itself! However, for the second generation of Keenetic routers (Keenetic II / Keenetic Giga II / Keenetic Ultra), firmware V1 is unofficial (no technical support is provided for them). In my case, there was a Keenetic Giga II router, which was flashed with firmware V1. Firmware V1 for the second generation of routers can be found
here (to be guided by the latest date). The firmware process is quite simple, for this in the system settings of the router you need to go to "manage system files" and replace the
firmware
file with the downloaded
firmware
file.
We proceed to the next step - installing the necessary packages. Initially, you need to install the opkg package manager. I will not consider this process, because it is described in some detail on the
website of the author, who is building these packages, for which he thanks a lot.
So, after opkg is installed, proceed directly to installing the necessary packages. Connect to the router via ssh and execute the following command:
')
opkg install libiconv-full libmysqlclient libncurses libncursesw libopenssl libpcre libreadline libxml2 lighttpd lighttpd-mod-fastcgi mysql-server php5 php5-cgi php5-mod-ctype php5-mod-dom php5-mod-hash php5-mod-iconv php5-mod-json php5-mod-mbstring php5-mod-mysql php5-mod-session uclibcxx mysql-server php5-mod-json php5-mod-mysql php5-mod-mbstring php5-mod-hash php5-mod-ctype php5-mod-iconv php5-mod-dom
Now we set them up. To configure, you must edit the configuration files on a USB flash drive / disk. This is conveniently done using the
WinSCP program (in the connection settings, select the SCP protocol).
Configure lighttpd server. In the
/media/DISK_A1/system/etc/lighttpd/lighttpd.conf
file
/media/DISK_A1/system/etc/lighttpd/lighttpd.conf
activate the fastcgi module, for this we uncomment the lines:
server.modules = ( "mod_fastcgi" )
Add index.php to the list of index file names:
index-file.names = ( "index.html", "default.html", "index.htm", "default.htm", "index.php" )
And we add mime type svg for correct display of icons in the tt-rss interface:
mimetype.assign = ( ... ".xml" => "text/xml", ".svg" => "image/svg+xml" )
Uncomment the following lines:
fastcgi.server = ( ".php" => ( "localhost" => ( "min-procs" => 1, "max-procs" => 1, "max-load-per-proc" => 4, "socket" => "/media/DISK_A1/system/tmp/php-fastcgi.socket", "bin-path" => "/media/DISK_A1/system/usr/bin/php-fcgi" ) ) )
Remove the limit on the execution time of php scripts, for this we edit
/media/DISK_A1/system/etc/php.ini
Change the
max_execution_time
parameter, setting the value to
0
.
Configure autorun http, mysql servers, and cron, which will be needed to automatically update feeds. This is
/media/disk_a1/system/etc/init.d/
renaming the scripts in the
/media/disk_a1/system/etc/init.d/
folder. To do this, run the following commands:
mv /media/DISK_A1/system/etc/init.d/K02cron /media/DISK_A1/system/etc/init.d/S02cron mv /media/DISK_A1/system/etc/init.d/K27mysqld /media/DISK_A1/system/etc/init.d/S27mysqld mv /media/DISK_A1/system/etc/init.d/K50lighttpd /media/DISK_A1/system/etc/init.d/S50lighttpd
Download the tarball from the official
site . Download it to the folder
/media/DISK_A1/system/www/
. This can be done for example using the same WinSCP. For unpacking we perform:
cd /media/DISK_A1/system/www/ tar -xvzf ./Tiny-Tiny-RSS-1.8.tar.gz rm ./Tiny-Tiny-RSS-1.8.tar.gz mv /media/DISK_A1/system/www/Tiny-Tiny-RSS-1.8/ /media/DISK_A1/system/www/tt-rss
Reboot the router to start all services. Connect to ssh router again. Create a database called
mysql
(for the user named
root
). Execute commands:
mysql_install_db --datadir=/media/DISK_A1/system/var/mysql --basedir=/media/DISK_A1/system/usr --force /media/DISK_A1/system/etc/init.d/S27mysqld restart
Change the database access password:
/media/DISK_A1/system/usr/bin/mysqladmin -u root password "new-password"
Next, enter:
mysql -u root -p
Upon request, enter the password, which is set and enter the following commands:
create database ttrss; use ttrss; source /media/DISK_A1/system/www/tt-rss/schema/ttrss_schema_mysql.sql; quit;
To access the mysql database, you need to add an iptables rule to allow the lo interface:
iptables -I INPUT -i lo -j ACCEPT
. To automatically execute this command upon reboot, you can add this command to the mysql server
/media/DISK_A1/system/etc/init.d/S27mysqld
autorun script:
case "" in start) start iptables -I INPUT -i lo -j ACCEPT ;;
Restart the mysql server:
/media/DISK_A1/system/etc/init.d/S27mysqld restart
We open in the browser the address
192.168.1.1:81/tt-rss/
192.168.1.1:81/tt-rss/
where the tt-rss installer opens:

Fill in the fields as in the screenshot. Click test confiduration. If everything is in order, the following messages will appear:

Feel free to click Initialize database. And then Save configuration.
Try opening the address
192.168.1.1:81/tt-rss/
192.168.1.1:81/tt-rss/
. Swears that you can not run from the root. There are no other users in the router, so we will disable this check and allow it to run as root. To do this, edit
/media/DISK_A1/system/www/tt-rss/include/sanity_check.php
. In the line
if (function_exists('posix_getuid') && posix_getuid() == 0) {
set
posix_getuid() == -1
.
We update the page in the browser, enter the username admin, password password. Everything, it is possible to use!
To update the feeds, add the task to the cron, open the file
/media/DISK_A1/system/etc/crontabs/root
and add
*/30 * * * * /media/DISK_A1/system/usr/bin/php-cgi /media/DISK_A1/system/www/tt-rss/update.php --feeds --quiet
This command updates feeds every 30 minutes.
To access the reader from the outside, you must uncomment the iptables rule in the http autorun script of the server
/media/DISK_A1/system/etc/init.d/S50lighttpd
:
iptables -A INPUT -p tcp --dport $PORT_F -j ACCEPT
The tt-rss on the router showed an annoying bug, which is that the feeds in the win-1251 encoding do not want to be processed. To solve this problem, you can use the following crutches. In the
/media/DISK_A1/system/www/tt-rss/include/rssfuncs.php
file before
if (!$rss) { $rss = new FeedParser($feed_data); $rss->init(); }
add (thanks for the Star Per advice from the
forum ):
if (stripos($feed_data, 'encoding="windows-1251"')) { $feed_data = str_ireplace( 'encoding="windows-1251"', 'encoding="utf-8"', iconv( 'CP1251', 'UTF-8', $feed_data ) ); }
So we got an rss reader, which at one point will not be closed for one reason or another. In addition, this reader works in multiplayer mode, it can be shared with your friends.
Do not forget to change the default password in the reader! Enjoy reading.