How to Install Tiny Tiny RSS on CentOS 7

Published on: Thu, Sep 1, 2016 at 4:49 pm EST
CentOS Linux Guides Server Apps System Admin Web Servers

Tiny Tiny RSS is a free and open source news feed (RSS/Atom) reader which is a great alternative to discontinued Google Reader. With Tiny Tiny RSS, you can setup an independent RSS service on your own server instead of counting on unreliable cloud services.

This article will show you how to deploy Tiny Tiny RSS on a CentOS 7 server.

Prerequisites

  • A fresh Vultr CentOS 7 server instance.
  • A sudo user.

Step 1: Update CentOS 7 to the latest stable status using YUM

Run the following commands as a sudo user:

sudo yum install epel-release -y
sudo yum update -y
sudo shutdown -r now

After the reboot, still log into your server instance as the same sudo user.

Step 2: Install Apache

Apache is the recommended web server for Tiny Tiny RSS. You can install Apache using YUM:

sudo yum install httpd -y

Remove the Apache welcome page:

sudo sed -i 's/^/#&/g' /etc/httpd/conf.d/welcome.conf

For security purposes, you should prohibit Apache from displaying files and directories in the web root directory /var/www/html when visitors are browsing the site:

sudo sed -i "s/Options Indexes FollowSymLinks/Options FollowSymLinks/" /etc/httpd/conf/httpd.conf

Start the Apache service and set it as starting on boot:

sudo systemctl start httpd.service
sudo systemctl enable httpd.service

Step 3: Install PHP and necessary PHP extensions

Tiny Tiny RSS requires PHP 5.4 or newer. Here, you can install PHP 5.4 and some PHP extensions using the built-in YUM repositories of the Vultr CentOS 7 server instance:

sudo yum install php php-common php-gd php-mbstring php-process php-pgsql php-xml php-cli -y

Restart the Apache service to load newly installed modules:

sudo systemctl restart httpd.service

Step 4: Install and configure PostgreSQL

Tiny Tiny RSS can work with either PostgreSQL or MySQL. Choosing PostgreSQL over MySQL will provide better performance.

1) Install and initialize PostgreSQL:

sudo yum install postgresql postgresql-server -y
sudo postgresql-setup initdb

2) Start PostgreSQL and make it start on boot:

sudo systemctl start postgresql.service
sudo systemctl enable postgresql.service

3) For security purposes, you need to set a password for the default PostgreSQL user "postgres".

First, log into the PostgreSQL shell as the "postgres" user:

sudo -u postgres psql

After the prompt turns into "postgres=#", use the following command to set a password for "postgres":

\password postgres

Enter a password twice, say it is postgres.

Finally, use the following command to quit the PostgreSQL shell.

\q

4) Change PostgreSQL database user authentication methods:

sudo vi /var/lib/pgsql/data/pg_hba.conf

Find the following sections:

# IPv4 local connections:
host    all             all             127.0.0.1/32            ident
# IPv6 local connections:
host    all             all             ::1/128                ident

Modify the authentication methods of IPv4 and IPv6 local connections to md5:

# IPv4 local connections:
host    all             all             127.0.0.1/32            md5
# IPv6 local connections:
host    all             all             ::1/128                 md5

Save and quit:

:wq!

5) Put your changes into effect:

sudo systemctl restart postgresql.service

6) Create another user and a database for Tiny Tiny RSS.

For security purposes, you can create a dedicated database user and a database for Tiny Tiny RSS:

Log in as the "postgres" user:

cd /
sudo -u postgres psql

In the PostgreSQL shell, create a user "ttrssuser" with the password "ttrssuserpassword" and a database "ttrss", and then grant all privileges on the database to the user:

Note: When excuting these commands on your server, be sure to replace the username, the password, and the database name mentioned above with your own ones.

CREATE USER ttrssuser CREATEDB CREATEUSER ENCRYPTED PASSWORD 'ttrssuserpassword';
CREATE DATABASE ttrss OWNER ttrssuser;
GRANT ALL PRIVILEGES ON DATABASE ttrss TO ttrssuser;
\q

Step 5: Install Tiny Tiny RSS

1) Download Tiny Tiny RSS using the git command:

sudo yum install git -y
cd
git clone https://tt-rss.org/git/tt-rss.git tt-rss

2) Move Tiny Tiny RSS files to the web root directory, and then change the ownership of web root directory to the "apache" user:

sudo mv ~/tt-rss /var/www/html && sudo chown -R apache:apache /var/www/html

3) Modify firewall rules in order to allow web access:

sudo firewall-cmd --zone=public --permanent --add-service=http
sudo firewall-cmd --reload

4) Point your browser to the URL of Tiny Tiny RSS web installation wizard, say your server IP is 203.0.113.1:

http://203.0.113.1/tt-rss/install/

Input all necessary info as below:

Database settings:

Database type: PostgreSQL
Username: ttrssuser
Password: ttrssuserpassword
Database name: ttrss
Host name: locahost
Port: 5432

Other settings:

Tiny Tiny RSS URL: http://203.0.113.1/tt-rss/

Click the "Test configuration" button to give it a test.

If everything goes well, click the "initialize database" button to proceed.

Then the wizard will generate a copy of configuration which is specific to your conditions. Click the "Save configuration" button to save the configuration into a file /var/www/html/tt-rss/config.php.

If the file cannot be automatically saved using the "Save configuration" button, you need to manually create it and populate the file with the contents in the wizard textbox. Remember to change its ownership to apache:apache.

Finally, click the "loading tt-rss now" link to start Tiny Tiny RSS.

5) Log in with default credentials (username: admin, password: password), and then go to preferences and change your password immediately.

Having changed the admin user's password, the system will force you to log out immediately. You need to use the new password to log in from now on. Then you can setup a non-admin user for daily use.

6) Update RSS/Atom feeds

Before you can use Tiny Tiny RSS properly, the last thing you need to do is to run the update daemon, otherwise your feeds won’t be updated.

Create a systemd service unit:

sudo vi /usr/lib/systemd/system/ttrss_backend.service

Populate the file with:

[Unit]
Description=ttrss_backend
After=network.target mysql.service postgresql.service

[Service]
User=apache
ExecStart=/var/www/html/tt-rss/update_daemon2.php

[Install]
WantedBy=multi-user.target

Save and quit:

:wq!

Enable and start the ttrss_backend service:

sudo systemctl enable ttrss_backend.service
sudo systemctl start ttrss_backend.service

That's all. You can subscribe to and read your favorite RSS/Atom feeds now. Enjoy it.

Want to contribute ?

You could earn up to $300 by adding new articles