Install Redis 2.6 on Amazon EC2 Linux AMI or CentOS

1. Install Linux updates, set time zones, followed by GCC and Make

sudo yum -y update
sudo ln -sf /usr/share/zoneinfo/America/Indianapolis \
sudo yum -y install gcc make

2. Download, Untar and Make Redis 2.6

tar xzf redis-2.6.0-rc3.tar.gz
cd redis-2.6.0-rc3

3. Create Directories and Copy Redis Files

sudo mkdir /etc/redis /var/lib/redis
sudo cp src/redis-server src/redis-cli /usr/local/bin
sudo cp redis.conf /etc/redis

4. Configure Redis.Conf

sudo nano /etc/redis/redis.conf
daemonize yes
dir /var/lib/redis

5. Download init Script


6. Move and Configure Redis-Server

Note: The redis-server to be moved below is the one downloaded in 5 above.

sudo mv redis-server /etc/init.d
sudo chmod 755 /etc/init.d/redis-server
sudo nano /etc/init.d/redis-server

7. Auto-Enable Redis-Server

sudo chkconfig --add redis-server
sudo chkconfig --level 345 redis-server on

8. Start Redis Server

sudo service redis-server start

Source url :

push notifications

Node js:

This is an easy basic implementation  about apple push notification by using node-js .

please get the apple certificate as well as the password from ios developer.

please create the following files


var join = require(‘path’).join, pfx = join(__dirname, ‘Certificates.p12‘);

* Create a new gateway agent

var apnagent = require(‘apnagent’), agent = module.exports = new apnagent.Agent();

* Configure agent

agent.set(‘pfx file’, pfx).set(“passphrase”,’password‘).enable(‘sandbox’);

* Error Mitigation

agent.on(‘message:error’, function (err, msg) {
switch ( {
// This error occurs when Apple reports an issue parsing the message.
case ‘GatewayNotificationError’:
console.log(‘[message:error] GatewayNotificationError: %s’, err.message);

// The err.code is the number that Apple reports.
// Example: 8 means the token supplied is invalid or not subscribed
// to notifications for your application.
if (err.code === 8) {
console.log(‘ > %s’, msg.device().toString());
// In production you should flag this token as invalid and not
// send any futher messages to it until you confirm validity


// This happens when apnagent has a problem encoding the message for transfer
case ‘SerializationError’:
console.log(‘[message:error] SerializationError: %s’, err.message);

// unlikely, but could occur if trying to send over a dead socket
console.log(‘[message:error] other error: %s’, err.message);

* Make the connection

agent.connect(function (err) {
// gracefully handle auth problems
if (err && === ‘GatewayAuthorizationError’) {
console.log(‘Authentication Error: %s’, err.message);

// handle any other err (not likely)
else if (err) {
throw err;

// it worked!
var env = agent.enabled(‘sandbox’)
? ‘sandbox’
: ‘production’;

console.log(‘apnagent [%s] gateway connected’, env);



var agent = require(‘./push_lib’);
* Send message
module.exports = “yourdevice token”;
var x=module.exports;
.alert(‘Custom variables’)
.set(‘id_1’, 12345)
.set(‘id_2’, ‘abcdef’)


Source url :




Laravel 5:

This is an easy basic implementation  about apple push notification by laravel 5 .

please get the apple certificate as well as the password from ios developer.

Run the follwoing command in order to geenrate pem file:

openssl pkcs12 -in Certificates.p12 -out my_private_key.pem -nodes

create a function :

function testPushNotification(){
->send(‘Hello World, i`m a push message from Audiochimp’);



Route::get(‘/push’, ‘ClientController@testPushNotification’);

when we run baseurl/push we can get the notifcation


source url :