×
Community Blog How to Install and Configure Selfoss RSS Reader on ECS

How to Install and Configure Selfoss RSS Reader on ECS

In this tutorial, we will be installing and setting up Selfoss RSS Reader on an Alibaba Cloud Elastic Compute Service (ECS) with Ubuntu 16.

By Arslan Ud Din Shafiq, Alibaba Cloud Tech Share Author. Tech Share is Alibaba Cloud's incentive program to encourage the sharing of technical knowledge and best practices within the cloud community.

Selfoss RSS Reader is an open source RSS reader available for free use. It is web-based and is multipurpose; it supports live streaming as well as the collection of feeds, posts, and tweets Selfoss is a very light weight application, less than 3MB, and it provides restful JSON API for making requests. Because Selfoss RSS Reader is not a hosted service, you will need to get your own server and set it up for Selfoss RSS Reader.

In this tutorial, we will be installing and setting up Selfoss RSS Reader on an Alibaba Cloud Elastic Compute Service (ECS) with Ubuntu 16.04 installed.

Prerequisites

  • You must have Alibaba Cloud Elastic Compute Service (ECS) activated and verified your valid payment method. If you are a new user, you can get $300 – $1200 worth in Alibaba Cloud credits for your new account. If you don't know about how to setup your ECS instance, you can refer to this tutorial or quick-start guide. Your ECS instance must have at least 1GB RAM and 1 Core processor.
  • A domain name registered from Alibaba Cloud. If you have already registered a domain from Alibaba Cloud or any other host, you can update its domain nameserver records.
  • Domain name must be pointed to your Alibaba Cloud ECS's IP address
  • Access to VNC console in your Alibaba Cloud or SSH client installed in your PC
  • Set up your server's hostname and create user with root privileges.

Setting Up Your Server

Before proceeding with installation of any kind of package, use the following command to update your Ubuntu system. To execute this command, remember to login from non-root user with sudo privileges.

# sudo apt update && sudo apt upgrade

You will need to install unzip which will be used to unzip the compressed zip folder.

# sudo apt-get install unzip -y

Install PHP

Selfoss RSS Reader requires PHP 5.6 or newer. In this tutorial, we will install PHP 7.2. To install PHP 7.2, execute the following steps.

You will need to install python software properties and software properties common.

# sudo apt-get install software-properties-common python-software-properties 

Add repository for newer versions of PHP.

# sudo add-apt-repository ppa:ondrej/php

Update the system to refresh the available repositories. To do so, execute the following command.

# sudo apt update

Install PHP 7.2.

# sudo apt install -y php7.2

Install Required PHP Extensions

Selfoss RSS Reader requires the following PHP extensions:

  1. php7.2-imagick
  2. php7.2-zip
  3. php7.2-common
  4. php7.2-curl
  5. php7.2-mbstring
  6. php7.2-gd
  7. php7.2-mysql
  8. php7.2-xml
  9. php7.2-tidy
  10. libapache2-mod-php

To install the above extensions of PHP, execute the following command.

# sudo apt-get -y install php-gd php-mbstring php-common php-mysql php-imagick php-xml libapache2-mod-php php-curl php-tidy php-zip

When you have completed the installation, apache2 will be installed automatically. Hence, you don't need to install apache explicitly. You can execute the following command to check installed PHP version.

# php --version

Install MariaDB

Selfoss RSS Reader supports MySQL and PostgreSQL. Only InnoDB database is supported on MySQL. In this tutorial, you will use MariaDB server for MySQL. By default, Ubuntu repository uses an older version of MariaDB server. To use new version of MariaDB, you will need to add MariaDB repository to your Ubuntu system. To do so, follow the steps below.

Verify the keys by executing the following command.

# sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8

Add the repository.

# sudo add-apt-repository 'deb [arch=amd64,i386,ppc64el] http://mirror.nodesdirect.com/mariadb/repo/10.2/ubuntu xenial main'

Update the system.

# sudo apt update

Install MariaDB.

# sudo apt install -y mariadb-server

Start and enable the MariaDB server to start automatically.

# sudo systemctl start mariadb
# sudo systemctl enable mariadb

Run the following command to enhance security of MariaDB server and set password for the root user.

# sudo mysql_secure_installation

Connect to the MySQL shell as root user using the command below and enter your password.

# sudo mysql -u root -p

Execute the following MySQL queries in your MariaDB server.

CREATE DATABASE selfossdb CHARACTER SET utf8 COLLATE utf8_general_ci;
CREATE USER 'aareez'@'localhost' IDENTIFIED BY '654321Ab';
GRANT ALL PRIVILEGES ON selfossdb.* TO 'aareez'@'localhost';
FLUSH PRIVILEGES;
EXIT; 

Install Composer

Selfoss RSS Reader needs some plugins to work, so it requires installation of composer. To install and setup composer, execute the following commands.

# php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
# php -r "if (hash_file('SHA384', 'composer-setup.php') === '544e09ee996cdf60ece3804abc52599c22b1f40f4323403c44d44fdfdd586475ca9813a858088ffbc1f233e9b180f061') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
# php composer-setup.php
# php -r "unlink('composer-setup.php');"
# sudo mv composer.phar /usr/local/bin/composer

You can check if composer installed successfully by executing the command to check the version of composer.

# composer -v

Install Selfoss RSS Reader

To install Selfoss RSS Reader, you will need to follow these steps.

Navigate to /var/www/html using the command.

# cd /var/www/html

Download the latest stable release of Selfoss RSS Reader.

# sudo wget --content-disposition https://github.com/SSilence/selfoss/releases/download/2.18/selfoss-2.18.zip 

Remove the index.html file.

# sudo rm index.html

Unzip the downloaded compressed zip folder selfoss-2.18.zip

# sudo unzip selfoss-2.18.zip

Remove selfoss-2.18.zip using the command below.

# sudo rm selfoss-2.18.zip

Now provide ownership of /var/www/ to www-data so that apache server can access the required files.

# sudo chown -R www-data:www-data /var/www/html

Configure Apache Server

Let's create a virtual host configuration file for Selfoss RSS Reader. Execute the following command, to open the nano text editor.

# sudo nano /etc/apache2/sites-available/selfoss.conf

Copy and Selfoss RSS Reader the following code and save the file.

<VirtualHost *:80> 
    ServerAdmin admin@xyz.com
    ServerName www.softpedia.xyz
    DocumentRoot /var/www/html
    DirectoryIndex index.php index.htm index.html
   <Directory /var/www/html>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
        allow from all
    </Directory>
 ErrorLog ${APACHE_LOG_DIR}/selfoss_error.log
    LogLevel warn
    CustomLog ${APACHE_LOG_DIR}/selfoss_access.log combined
</VirtualHost>

Execute the command below to disable default site.

# sudo a2dissite 000-default.conf

You will need to enable the newly created virtual host. To do so, execute the command below.

# sudo a2ensite selfoss

Now you will need to enable rewrite mod. You can do so by editing the configuration file in apache2 directory or by executing the command below.

# sudo a2enmod rewrite

Now you will need to enable SSL engine. You can do so by editing the configuration file in apache2 directory or by executing the command below.

# sudo a2enmod ssl

Restart apache server to apply the changes and load the settings by executing command below.

# sudo service apache2 restart

Now you can access Selfoss RSS Reader via your domain name or ECS IP address. In my case, I have accessed via http://www.softpedia.xyz . Remember to prefix www in URL. You will see the following screen.

1

Configure Database

Now access the link http://www.your_domain_name.tld/password.

2

Type any password to generate a hash and copy it.

To setup database, execute the following command. It will copy default.ini to config.ini file.

# sudo cp -iv defaults.ini config.ini 

Now open config.ini file using nano editor and make settings for your database.

# sudo nano config.ini

Now change the values for database parameters and copy and paste the generated hash code in place of password as shown below.

3

When you access Selfoss via IP address or domain, you will be redirected to login screen as shown below.

4

Install SSL Certificate

To install SSL certificate using Let's Encrypt, you will use Certbot. To do so, execute the following steps.

Update the package.

# sudo apt-get update

To install software-properties-common, execute the command below.

# sudo apt-get install software-properties-common

Add the certbot repository.

# sudo add-apt-repository ppa:certbot/certbot

Update the package to load the added certbot repository.

# sudo apt-get update

Stop apache before issuance of SSL certificate.

# sudo systemctl stop apache2

Install python-certbot-apache.

# sudo apt-get install python-certbot-apache

Execute the following command to get Let's Encrypt SSL issued.

# sudo certbot --apache -d www.softpedia.xyz

Select option 2 to redirect the link to https and update virtual host settings for SSL.

Now restart apache server.

# sudo systemctl start apache2

You can access your website by visiting https://www.your_domain_name.tld

5

Set Up Firewalls and Ports

If you have activated firewalls, you will have to define a rule in Alibaba Cloud security group for your cloud server to add exception for port 80/tcp and 443/tcp. You can enable these ports while creating ECS instance, but in case if you have forgotten to unblock these ports, you can follow the procedure in this guide: https://www.alibabacloud.com/help/doc-detail/25471.htm

Congratulations! You go, you have successfully installed and configured Selfoss RSS Reader on your Alibaba Cloud Elastic Compute Service (ECS) server.

0 0 0
Share on

Alibaba Clouder

2,599 posts | 762 followers

You may also like

Comments