• Get In Touch
December 27, 2016

How to Install Tiny Tiny RSS on CentOS 7

Want your very own server? Get our 1GB memory, Xeon V4, 25GB SSD VPS for £10.00 / month.
Get a Cloud Server

Tity Tiny RSS or ttrss is an open source RSS reader and aggregator. It is a web-based news feed reader written in PHP and uses MySQL or PostgreSQL as a database to store its data.

Requirements

Tiny Tiny RSS does not require any special hardware requirements. You can run it on a virtual server having RAM around 256 MB and 1 CPU. For optimal performance, you can run it on a server with 512 MB or more RAM. Additionally, you will need CentOS 7 installed in your server and root access on it. If you are logged in as non-root user, you can always run sudo -i to switch to root user.

Installing Tiny Tiny RSS

Before installing any package in our system, it is recommended to update the system and available package, run the following command to do so.

yum -y update

Tiny Tiny RSS requires a web server, PHP and a database server to work. In this tutorial, we will be installing nginx as a webserver with PHP and PostgreSQL server as a database server. nginx web server is not available on the default yum repository, hence you will need to add EPEL repository. Run the following command to do so.

yum -y install epel-release
yum -y update

To install nginx web server, run the following command.

yum -y install nginx

Once the web server is installed, you can start it using the following command.

systemctl start nginx

To enable nginx to automatically start at boot time, run the following command.

systemctl enable nginx

If a firewall is running on your server, run the following commands to allow HTTP and HTTPS traffic to be accessible from the internet.

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

Now you will need to install PHP and the required PHP extensions. Tiny Tiny RSS works on PHP 5.4 and the above versions. Although it supports PHP 5.4 but still it’s recommended that you above any higher PHP version as PHP 5.4 has reached the end of life.

To install PHP 5.4 you can run the following command.

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

To install PHP 7.0, you will need to add the webtatic repository in your system also as PHP 7.0 is neither available in default yum repository nor EPEL repository. However, webtatic requires EPEL to work but as we have already installed EPEL repository. We can proceed further to add webtatic. Run the following command to add the webtatic repository.

rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
yum -y update

Now you can install PHP 7.0 along with the required extensions using the following command.

yum -y install php70w php70w-common php70w-gd php70w-mbstring php70w-process php70w-pgsql php70w-xml php70w-cli

Make sure that you are only installing any one of the above PHP versions. Once you install PHP, you will need to restart the nginx web server for PHP to work.

systemctl restart nginx

Tiny Tiny RSS can be installed both on MySQL or PostgreSQL. In this tutorial, we are going to install it on PostgreSQL. Run the following command to install the latest version of PostgreSQL.

yum -y install postgresql postgresql-server

Once the installation finishes, you can initialize PostgreSQL database using the following command.

postgresql-setup initdb

To start PostgreSQL and enable it to start at boot time, run the following command.

systemctl start postgresql
systemctl enable postgresql

You will need to modify the host based authentication file of PostgreSQL as by default PostgreSQL does not allow password based authentication. Edit the /var/lib/pgsql/data/pg_hba.conf file using your favorite editor.

nano /var/lib/pgsql/data/pg_hba.conf

If you do not have nano installed, you can install it using yum -y install nano. Once the file is opened, scroll down to find the following lines.

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

Change idnet to md5 for both IPv4 and IPv6 connections. Once done it should look like as shown below.

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

Save the file and exit from the editor. For changes to take effect, you will need to restart the PostgreSQL server. Run the following command to do so.

systemctl restart postgresql

The PostgreSQL provides a shell in which we can write the queries and commands. It is recommended to set a password for the default PostgreSQL user postgres as there is no default password set for the user. Login to the psql prompt as postgres user using the following command.

sudo -u postgres psql

You should see that the command line prompt has changed into postgres=#. Now run the following command to change the password of postgres user.

\password postgres

Enter your new password twice and you will have the password set for postgres user.
You will now need to create a new database to store Tiny Tiny RSS data as well as a new user who will have full privileges on the database. It is not secure to expose your postgres user password.

To create a new user run the following command in psql command line interface.

CREATE USER "ttrssuser" WITH PASSWORD 'StrongPassword';

In the above command replace ttrssuser with any username you want. Replace StrongPassword with a strong password for the user. Now create a new database using the following command.

CREATE DATABASE ttrssdata WITH OWNER "ttrssuser";

You can provide any desired name for your database in place of ttrssdata. The above command also provides the ownership of the database to the newly created user. By default, the owner has full privileges over the database. You can also run the following command to make sure that the database user has authority over the database.

GRANT ALL PRIVILEGES ON DATABASE ttrssdata TO ttrssuser;

Once done you can exit the psql shell using the \quit or \q command.

As we have everything ready, we can now install Tiny Tiny RSS by cloning the repository using git. Install git using the following command.

yum -y install git

Now move to the nginx document root directory and clone the Tiny Tiny RSS repository into tt-rss directory using the following command.

cd /usr/share/nginx
git clone https://tt-rss.org/git/tt-rss.git tt-rss

Provide the ownership of the files to the web server using the following command.

chown -R nginx:nginx tt-rss

Now configure nginx and create the virtual host file. Create two directories for available and enabled sites.

mkdir /etc/nginx/sites-available
mkdir /etc/nginx/sites-enabled

Now edit the default configuration file of nginx available at /etc/nginx/nginx.conf.

nano /etc/nginx/nginx.conf

Copy and paste the following lines in the http{} block.

include /etc/nginx/sites-enabled/*.conf;
server_names_hash_bucket_size 64;

Create the virtual host file for your site using the following command.

nano /etc/nginx/sites-available/tt-rss.conf

Copy and paste the following lines into the file.

server {
    listen  80;

    root /usr/share/nginx/tt-rss;
    index index.html index.htm index.php;

    access_log /var/log/nginx/tt-rss_access.log;
    error_log /var/log/nginx/tt-rss_error.log info;

    server_name yourdomain.com;

    location / {
        index           index.php;
    }

    location ~ \.php$ {
        try_files $uri = 404; #Prevents autofixing of path which could be used for exploit
        fastcgi_pass unix:/var/run/php5-fpm.sock;
        fastcgi_index index.php;
        include /etc/nginx/fastcgi_params;
    }

}

Replace yourdomain.com with your actual domain if you have DNS setup pointing to your server. You can use your IP address also if you do not have the domain ready yet. Create a soft link of tt-rss.conf in enabled sites directory using the following command.

ln -s /etc/nginx/sites-available/tt-rss.conf /etc/nginx/sites-enabled/tt-rss.conf

Now restart nginx using the following command.

systemctl restart nginx

You will also need to disable SELinux, open the configuration file using the following command.

nano /etc/selinux/config

Find the following line

SELINUX=enforcing

Change it to SELINUX=disabled and restart your server so that it can take effect.

shutdown -r now

Once the server is started again, you can open your Tiny Tiny RSS application through your favorite web browser. Go to the following link.

http://yourdomain.com
or
http://yourIPaddress

You will see an interface to provide the database credentials.

HP_NO_IMG/data/uploads/users/e840080c-7322-4497-85c0-150182bd4c02/613524281.png” alt=”” />

Choose the database type as PostgreSQL. Provide the username you have created during the user and database creation, in our case, it was ttrssuser. Provide the password you have created during the user and database creation. Provide the database and hostname will be localhost. Provide the port 5432 for PostgreSQL.

Finally, set the Tiny Tiny RSS URL for your application URL. Which is http://yourdomain.com or http://YourIPaddress. Click on Test configuration button to check the configuration and database connectivity test. If you get any error in database connectivity, check your PostgreSQL user credentials.

If there is no error then, you can click on Initialize database button to initialize the database for Tiny Tiny RSS and will generate a config.php file. You will need to copy the whole generated file to your config.php file. Run the following command to create a new config.php file.

nano /usr/share/nginx/tt-rss/config.php

Copy and paste the whole configuration generated into the new file and save it. You can also click Save configuration file, it will automatically try to save the file.

You can now log in using the default credentials which are username:admin and password:password.

HP_NO_IMG/data/uploads/users/e840080c-7322-4497-85c0-150182bd4c02/1023358015.png” alt=”” />

Once you are logged in you will see the dashboard.

HP_NO_IMG/data/uploads/users/e840080c-7322-4497-85c0-150182bd4c02/215403041.png” alt=”” />

You will need to create a Systemd service so that your RSS feeds are regularly updated.

nano /usr/lib/systemd/system/ttrss_update.service

Copy and paste the following content into the file.

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

[Service]
User=ngnix
ExecStart=/usr/share/nginx/tt-rss/update_daemon2.php

[Install]
WantedBy=multi-user.target

Save and exit the file and run the service using the following commands.

systemctl start ttrss_update
systemctl enable ttrss_update

Conclusion

In this tutorial, we have learned to install Tiny Tiny RSS in your system. You will have your own RSS reader which is a good alternative to Google Reader.

Want your very own server? Get our 1GB memory, Xeon V4, 25GB SSD VPS for £10.00 / month.
Get a Cloud Server

Share this Article!

Related Posts

Node.js Authentication – A Complete Guide with Passport and JWT

Node.js Authentication – A Complete Guide with Passport and JWT

Truth be told, it’s difficult for a web application that doesn’t have some kind of identification, even if you don’t see it as a security measure in and of itself. The Internet is a kind of lawless land, and even on free services like Google’s, authentication ensures that abuses will be avoided or at least […]

Node.js and MongoDB: How to Connect MongoDB With Node

Node.js and MongoDB: How to Connect MongoDB With Node

MongoDB is a document-oriented NoSQL database, which was born in 2007 in California as a service to be used within a larger project, but which soon became an independent and open-source product. It stores documents in JSON, a format based on JavaScript and simpler than XML, but still with good expressiveness. It is the dominant […]

Using MySQL with Node.js: A Complete Tutorial

Using MySQL with Node.js: A Complete Tutorial

Although data persistence is almost always a fundamental element of applications, Node.js has no native integration with databases. Everything is delegated to third-party libraries to be included manually, in addition to the standard APIs. Although MongoDB and other non-relational databases are the most common choice with Node because if you need to scale an application, […]

Node.Js Vs Django: Which Is the Best for Your Project

Node.Js Vs Django: Which Is the Best for Your Project

Django and NodeJs are two powerful technologies for web development, both have great functionality, versatile applications, and a great user interface. Both are open source and can be used for free. But which one fits your project best? NodeJs is based on JavaScript, while Django is written in Python. These are two equally popular technologies […]

Nodejs Vs PHP:  Which Works Best?

Nodejs Vs PHP: Which Works Best?

Before getting into the “battle” between Node.js and PHP we need to understand why the issue is still ongoing. It all started with the increased demand for smartphone applications, their success forcing developers to adapt to new back-end technologies that could handle a multitude of simultaneous requests. JavaScript has always been identified as a client-side […]