For Ubuntu server. All commands assume a root shell.

Installing Redis and dependencies

apt install redis-server
To ensure everything installed and started up properly:

PEAR and phpredis

Install PEAR if it isn't already installed:
apt install php5-dev php-pear
Install phpredis:
pecl install redis
Add a config file for redis for PHP
echo "" > /etc/php5/apache2/conf.d/50-redis.ini
Optionally, add the same file (or symlink it) in /etc/php5/cli/conf.d/
Restart Apache to load the new configuration:
service apache2 restart


PHP and node code for the demo can be found here.
Install node.js, npm and dependencies
apt install npm
Install dependencies
cd /var/www/node/
npm install
Run the app
nodejs app.js