Category Archives: amazon-elasticache

Connecting from apache of XAMPP to a Redis of Elasticache

I'm trying to test my web application on an apache of XAMPP. because There is the web application in AWS.

but I have an issue connecting from a local server to a Redis of ElasticCache. so I can't check errors about coding.

I think that If I can use a VPN service from AWS then a local server can access to the Redis of ElasticCache.

I want to know how I connect from local server to a Redis of ElasticCache.

Can you please give me an advice?

Accessing Redis from Apache Module

I have developed an Apache module in C. I access a Redis server (AWS Elasticache) from the module in the following way-

redisContext *c = redisConnect(REDIS_SERVER, REDIS_PORT);
if (c != NULL && c->err) {
  sprintf(logg, "Redis Error: %s\n", c->errstr);    logString(r, logg);
}
redisReply *reply = redisCommand(c, "SETEX %s.adflag 1800 %d", dotfilename, 1); // 30 min expiry

freeReplyObject(reply);
redisFree(c);

This works with a single connection. However, when I load test the system, I stop getting response from the Redis. I dont see anything useful in the Apache error log. What could be the problem?

Environment

  1. It is hosted on AWS on EC2.
  2. Apache version no is 2.4. - preforked mode
  3. Redis version 2.8.6 - AWS Elasticache
  4. Redis driver - https://github.com/redis/hiredis