How To Install Selfoss On A CentOS 7 Linux VPS

How To Install Selfoss On A CentOS 7 Linux VPS

Introduction

Selfoss is a powerful, open-source web-based RSS reader, mashup, aggregation, and live stream application written in PHP. It is a lightweight solution with an open plugin system that allows users to create custom data connectors to extend its functionality. The application also enables users to collect tweets, posts, podcast and even feeds in a unified location where they can be accessed with ease via mobile or desktop devices. This tutorial will show you how to install Selfoss on your CentOS 7 VPS or dedicated server using the LAMP stack (Apache, MariaDB, and PHP). Ready? Let’s get started!

Before You Begin

For this tutorial to flow seamlessly your require the following:

  • A fully configured CentOS server
  • LAMP Stack installed in your CentOS server
  • Mod_Headers and Mod_Rewrite  enabled

Step 1 – Creating Selfoss Database

If you have met all the pre-installation requirements, you can now create a database for the applications: First, run the command below to access the MariaDB command line:

$ sudo mysql -u root -p

Provide your password and press ENTER to log in. Once you are logged in, run the command below to create a database called ‘selfoss’: MariaDB [(none)]>

createdatabase selfoss;

Next, issue the command below to grant the required privileges: MariaDB [(none)]>

grant all on selfoss.* to selfoss@localhost identifiedby'SECURE_PASSWORD';

Flush the privileges to implement the changes: MariaDB [(none)]>

Flushprivileges;

Then exit the MariaDB shell: MariaDB [(none)]>

exit

Step 2  – Installing Selfoss

To install Selfoss, first, create a directory called ‘selfoss’ in  /var/www.

$ sudo mkdir /var/www/selfoss

Then run the command below to download Selfoss installation files:

$ cd /var/www/html/
$ sudo wget --content-disposition https://github.com/SSilence/selfoss/releases/download/2.18/selfoss-2.18.zip

Now, execute the command below to check if the files were successfully downloaded:

$  ls -la

This will give you an output similar to the one below:

drwxr-xr-x. 3 root             root       43   Oct 31 04:15 . 
drwxr-xr-x. 4 root             root       33   Oct 29 04:15 .. 
drwxr-xr-x. 8 apache           apache     204  Feb  3 2015 lists
-rw-r--r--. 1 root              root   2881068 Mar  5 2018 selfoss-2.18.zip

Next, run the command below to unzip the file:

$ sudo unzip selfoss-2.18.zip

Then move the installation files to the document root:

$ sudo mv -v selfoss-2.18/* selfoss-2.18/.* /var/www/html 2>/dev/null

Next, change the ownership of these files to prevent permission issues:

$ sudo chown -R apache:apache * ./

Restart Apache:

$ sudo systemctl restart httpd

Step 3 – Installing Composer

Selfoss requires the Composer to download plugins. Run the command below to install composer:

$ sudo yum -y install composer

Now, change to the web root directory:

 $cd /var/www/html

Then run composer via apache user:

$ sudo -u apache composer install

You may see a few warning messages but they are nothing to worry about. Everything will be implemented correctly. Once the installer is installed, you can proceed with the last step.

Step 4 – Final Configuration

Configuring Selfoss

This is the final step and you need to configure Selfoss to complete the installation. First, ensure you are in the web root directory, then copy the defaults.ini file to the config.ini file:

$ sudo cp -iv defaults.ini config.ini

Next, run the command below to open the config.ini file:

$ sudo nano config.ini

Once the file opens add the database values below to this file:

[globals]
db_type=mysql
db_host=localhost
db_database=selfoss_db
db_username=selfoss_user
db_password=SECURE_PASSWORD
db_port=3306

Web Server Configuration

Next,  you need to configure the virtual server block to help access Selfoss directly from mywebmail.tld or RSS.domain.tld. To configure the virtual host,  run the command below to open the file /etc/apache2/sites-enabled/selfoss:

$ sudo nano /etc/apache2/sites-enabled/selfoss

Once the file opens, copy and paste the content below:

<VirtualHost *:80>
        ServerAdmin webmaster@domain.tld
        ServerName rss.domain.tld
        Redirect / https://rss.domain.tld

</VirtualHost>

<IfModule mod_ssl.c>
<VirtualHost *:443>
        SSLEngineon
        SSLCertificateFile /etc/ssl/certs/myblog.pem
        SSLCertificateKeyFile /etc/ssl/private/myblog.key

        ServerAdmin webmaster@domain.tld
        ServerName rss.domain.tld

        DocumentRoot /var/www/selfoss
        <Directory />
                Options FollowSymLinks
                AllowOverrideAll
        </Directory>
        <Directory /var/www/selfoss>
                Options Indexes FollowSymLinks MultiViews
                AllowOverrideAll
                Order allow,deny
                allow from all
        </Directory>
</VirtualHost>
</IfModule>

Save and exit the nano editor, then restart Apache.

$ sudo systemctl restart httpd

Setting Up Automatic Updates

Here you need to set up automatic feeds updates using the Cron job utility. To refresh the feeds every 10 minutes, run the command below:

$ sudo crontab -e

Add the following directive

echo "*/10 * * * * root wget -o /dev/null http://yourwebsite.com/update">> /etc/cron.d/selfoss

That all, everything should be okay.

Conclusion

You have installed Selfoss in your CentOS 7 server. This is a free and open-source application, feel free to customize it to suit your needs.

Check out these top 3 Linux hosting services

Webdock
AU$1.57 /mo
Starting price
Visit Webdock
Rating based on expert review
  • User Friendly
    3.8
  • Support
    4.5
  • Features
    4.5
  • Reliability
    4.3
  • Pricing
    4.3
Kamatera
AU$5.94 /mo
Starting price
Visit Kamatera
Rating based on expert review
  • User Friendly
    3.5
  • Support
    3.0
  • Features
    3.9
  • Reliability
    4.0
  • Pricing
    4.3
Ultahost
AU$3.71 /mo
Starting price
Visit Ultahost
Rating based on expert review
  • User Friendly
    4.3
  • Support
    4.8
  • Features
    4.5
  • Reliability
    4.0
  • Pricing
    4.8
  • Do you need the best VPS? Read about our different offers.

How to install Zabbix on CentOS 7

This tutorial will help you install Zabbix; a high-performance network monitorin
less than a minute
David Malcom
David Malcom
Author

How To Install CachetHQ On a CentOS 7 VPS or Dedicated Server

This tutorial will help you install CacheHQ on your CentOS 7 server. CacheHQ is
less than a minute
David Malcom
David Malcom
Author

How to Install the LEMP (Linux, Nginx, MySQL, PHP) Stack on CentOS 7 VPS or Dedicated Server

LEMP is an acronym for Linux, Nginx, MySQL and PHP. LEMP stack just like LAMP st
less than a minute
Max Ostryzhko
Max Ostryzhko
Senior Web Developer, HostAdvice CTO

How To Install The LEMP (Nginx, MariaDB, and PHP) Stack On Ubuntu 18.04 LTS?

This tutorial will help you install the LEMP (Nginx, MariaDB, and PHP) stack on
less than a minute
David Malcom
David Malcom
Author
HostAdvice.com provides professional web hosting reviews fully independent of any other entity. Our reviews are unbiased, honest, and apply the same evaluation standards to all those reviewed. While monetary compensation is received from a few of the companies listed on this site, compensation of services and products have no influence on the direction or conclusions of our reviews. Nor does the compensation influence our rankings for certain host companies. This compensation covers account purchasing costs, testing costs and royalties paid to reviewers.
Click to go to the top of the page
Go To Top