Install Selfoss on Debian Wheezy

logo

 

In this article we will show you how to install Selfoss on a Debian Wheezy VPS with PHP-FPM, Nginx and MySQL. Selfoss is a new multipurpose rss reader, live stream, mashup and aggregation web application. It is written in PHP and uses either SQLite, MySQL or PostgreSQL as a database. Selfoss is a project of Tobias Zeising and is licensed under GPL v3.

Install MySQL and create a database.

apt-get update
apt-get upgrade
apt-get install mysql-server mysql-client
mysql -uroot -p
CREATE DATABASE selfoss
GRANT ALL PRIVILEGES ON selfoss.* TO 'selfoss'@'localhost' IDENTIFIED BY '_PASSWORD_';
FLUSH PRIVILEGES;
/q

Install Nginx and PHP-FPM

apt-get install nginx php5-fpm php-cli php5-mysql php5-gd php5-mcrypt

Create a root directory for your web site

mkdir -p /var/www/yourwebsite.com/{public_html,logs}

Download and configure selfoss

wget http://selfoss.aditu.de/selfoss-2.9.zip -O /tmp/selfoss.zip
unzip -d /var/www/yourwebsite.com/public_html /tmp/selfoss.zip

Copy defaults.ini to config.ini

cp /var/www/yourwebsite.com/public_html/defaults.ini /var/www/yourwebsite.com/public_html/config.ini

Open the config.ini file and change the following

vim /var/www/yourwebsite.com/public_html/config.ini
db_type=mysql
db_database=selfoss
db_username=selfoss
db_password=_PASSWORD_
db_port=3306

Change permissions.

chown -R www-data: /var/www/yourwebsite.com/public_html/

Nginx configuration.

Create a new Nginx server block with the following content

# /etc/nginx/sites-available/yourwebsite.com
# https://github.com/SSilence/selfoss/wiki/nginx-configuration
upstream backend {
   server unix:/var/run/php5-fpm.sock;
}
server {
    listen 80;
    server_name yourwebsite.com;
    root /var/www/yourwebsite.com/public_html/;
    access_log /var/www/yourwebsite.com/logs/access.log;
    error_log /var/www/yourwebsite.com/logs/error.log;
    location ~* \ (gif|jpg|png) {
      expires 30d;
    }
    location ~ ^/favicons/.*$ {
        try_files $uri /data/$uri;
    }
    location ~ ^/thumbnails/.*$ {
        try_files $uri /data/$uri;
    }
    location ~* ^/(data\/logs|data\/sqlite|config\.ini|\.ht) {
        deny all;
    }
    location / {
      index index.php index.html index.htm;
      try_files $uri /public/$uri /index.php$is_args$args;
    }
    location ~ \.php$ {
      fastcgi_pass backend;
      fastcgi_index index.php;
      fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
      include fastcgi_params;
    }
}

Symlink it and restart the server

ln -s /etc/nginx/sites-available/yourwebsite.com /etc/nginx/sites-enabled/yourwebsite.com
/etc/init.d/nginx restart

The feeds can be updated manually or via a cron job. To set a cron job run the following command:

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

You can find more info about Selfoss on their official website — http://selfoss.aditu.de/

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 this 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.

Leave a Comment