How to install and run Stringer on a Fedora Linux VPS

how-to-install-and-run-stringer-on-a-fedora-vpsThe following tutorial will guide you through the details on how to install and run Stringer on a Fedora 20 Linux VPS.

What is Stringer?

It is a self-hosted, anti-social RSS reader written in Ruby. It is based on Sinatra, ActiveRecord, PostgreSQL, Backbone.js and DelayedJob.



– A Fedora Linux VPS Hosting

– Ruby version higher than 2.0.0

– PostgreSQL



Before proceeding any further, ssh to your VPS, initiate a screen session and upgrade your system using yum:

## screen -U -S stringer-fedora
## yum update



Next, install some essential dependencies on the virtual server using:

## yum install git libxml2-devel libxslt-devel curl-devel postgresql-devel \
sqlite-devel make automake gcc gcc-c++ postgresql-server readline-devel openssl-devel sudo



Run the following command to initialize Postgresql on your “VPS” href=”” target=”_blank”>VPS and start the Postgresql database server using:

## postgresql-setup initdb
## systemctl start postgresql

check the status of the postgresql database server and add it to system’s startup using systemctl

## systemctl status postgresql
## systemctl enable postgresql



We need to create a new Postgresql database user and set a password for it. This user will be used by Stringer to access its database.

Create the user using:

## sudo -u postgres createuser -D -A -P stringer

Create a new database using:

## sudo -u postgres createdb -O stringer stringer_live



For security reasons it is recommended to run Stringer under a separate user account on the VPS. So let’s create a new user named stringer using the following command:

## useradd stringer -m -s /bin/bash

next, switch to this newly created user account using su:

## su -l stringer



For easier management of Ruby, we will use rbenv to setup specific Ruby version for the newly created account. So, make sure you are logged into your system with the stringer user account and located in your home directory which should be /home/stringer. Once you’re there, clone the rbenv repository using:

## git clone git:// .rbenv

next, add rbenv to your stringer user PATH and run rbenv init in your user’s .bash_profile:

## echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> $HOME/.bash_profile
## echo 'eval "$(rbenv init -)"' >> $HOME/.bash_profile

now clone the ruby-build repository to rbenv plugins directory so we can install Ruby on the system.

## git clone git:// $HOME/.rbenv/plugins/ruby-build

finally, source .bash_profile using the command below:

## source ~/.bash_profile

with all that in place, install ruby using the following commands:

## rbenv install 2.0.0-p598
## rbenv local 2.0.0-p598
## rbenv rehash

check ruby version using ruby --version. For example:

[stringer@linux-vps ~]$ ruby --version
ruby 2.0.0p598 (2014-11-13 revision 48408) [x86_64-linux]

additionally, you need to install bundler which will handle Stringer’s dependencies. So, install this ruby gem using:

## gem install bundler

re-hash your ruby environment using rbenv

rbenv rehash

Install foreman which will run the application:

## gem install foreman



first, change to your stringer’s home directory using:

## cd ~/

next, clone stringer’s repository from github to stringer directory using git:

## git clone
## cd stringer

use bundler to install stringer’s dependecies, for example:

## bundle install
## rbenv rehash

Stringer uses environment variables to determine information about your database, so edit these values to reflect your database and the postgresql user’s password you set earlier in this tutorial:

## echo 'export STRINGER_DATABASE="stringer_live"' >> $HOME/.bash_profile
## echo 'export STRINGER_DATABASE_USERNAME="stringer"' >> $HOME/.bash_profile
## echo 'export STRINGER_DATABASE_PASSWORD="CHANGE_ME"' >> $HOME/.bash_profile
## echo 'export RACK_ENV="production"' >> $HOME/.bash_profile
## echo "export SECRET_TOKEN=`openssl rand -hex 20`" >> $HOME/.bash_profile

source ~/.bash_profile

Tell stringer to run the database in production mode, using the postgresql database you created earlier:

## cd $HOME/stringer
## rake db:migrate RACK_ENV=production

Run the application:

## foreman start

Set up a cron job to parse the rss feeds.

## crontab -e
*/10 * * * *  source $HOME/.bash_profile; cd $HOME/stringer/; bundle exec rake fetch_feeds;

Of course you don’t have to do any of this if you use one of our Linux VPS Hosting services, in which case you can simply ask our expert Linux admins to install Stringer and Ruby for you. They are available 24×7 and will take care of your request immediately.

PS. If you liked this post please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.

Install eZ Publish Community Project on a CentOS 7 VPS with Nginx and PHP-FPM
How to install WikkaWiki on an Ubuntu VPS
Install Joomla on a CentOS 7 Linux VPS