Install Wallabag on Ubuntu 12.04 LTS VPS

Leave reply

logo-icon-black-no-bg-smWallabag (formerly poche) is a self hostable open source application for saving web pages. It is written in PHP and supports MySQL, SQLite and PostgreSQL database servers. In today’s article, we will show you how to install Wallabag with Nginx, PHP-FPM and MySQL on an Ubuntu VPS.

 

Install MySQL and create a database.

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

Install Nginx and PHP-FPM

apt-get install nginx php5-fpm php-cli php5-mysql php5-mcrypt php5-curl php5-tidy php5-sqlite

Install Composer and Git

apt-get install git
curl -sS https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer

Create a root directory for your web site and clone the git repository from github

mkdir -p /var/www/yourwebsite.com/{public_html,logs}
git clone https://github.com/wallabag/wallabag.git /var/www/yourwebsite.com/public_html

Install the dependencies and set the correct permissions

cd var/www/yourwebsite.com/public_html
composer install
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
server {
    server_name yourwebsite.com;
    listen 80;

    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;
    index index.html index.php;

    location / {
        try_files $uri $uri/ /index.php;
    }

    location ~ /(db) {
        deny all;
        return 404;
    }

    location ~ \.php$ {
        fastcgi_pass unix:/var/run/php5-fpm.sock;
        try_files $uri = 404;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        include /etc/nginx/fastcgi_params;
        fastcgi_index index.php;
    }

}

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

Wallabag installation

Open a browser pointing to your Wallabag installation, and follow the on-screen instructions to complete the process.  After successful installation remove install directory.

For more information about Wallabag, please consult the Wallabag site.

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.

One Response to “Install Wallabag on Ubuntu 12.04 LTS VPS”

  1. M

    Thank you a lot for this.
    I just had to remove the /etc/nginx/sites-available/default file which was provoking an (98: Address already in use) error, since I already had an apache service running on the default 80 port.

    Reply

Leave a Reply