The YUM installed Redis version on Amazon Linux is an older version so we will go through the steps to install Redis 3.2.6.
- sudo -i
- yum update
- yum install -y gcc*
- yum install -y tcl
- mkdir /redis
- sudo chmod 2775 /redis
- cd /redis
- wget http://download.redis.io/releases/redis-3.2.6.tar.gz
- tar xzf redis-3.2.6.tar.gz
- cd redis-3.2.6
- make test
- make install
- cd utils
- chmod +x install_server.sh
install with the following values:
Welcome to the redis service installer This script will help you easily set up a running redis server Please select the redis port for this instance:  Selecting default: 6379 Please select the redis config file name [/etc/redis/6379.conf] Selected default - /etc/redis/6379.conf Please select the redis log file name [/var/log/redis_6379.log] Selected default - /var/log/redis_6379.log Please select the data directory for this instance [/var/lib/redis/6379] Selected default - /var/lib/redis/6379 Please select the redis executable path  /usr/local/bin/redis-server Selected config: Port : 6379 Config file : /etc/redis/6379.conf Log file : /var/log/redis_6379.log Data dir : /var/lib/redis/6379 Executable : /usr/local/bin/redis-server Cli Executable : /usr/local/bin/redis-cli
- chkconfig –level 2345 redis_6379 on
- chmod 2775 /etc/redis
- chmod 664 /etc/redis/6379.conf
- edit the /etc/redis/6379.conf file to set a password
ps. Want to set a password on the Redis store? It’s not recommended because a password doesn’t do much to secure a fast memory based key storage when 1000’s of password auth attempts can be thrown at it PER SECOND! But on the other hand, if you want to add a password to prevent simply prying eyes like inhouse staff that won’t go through the trouble of building a password hacking program. Maybe you think the added password might prevent an inadvertent command to you Redis database like an accidental delete. Regardless the reason, here’s what you need to do:
edit the /etc/redis/6379.conf file
1. add your password to the password line and uncomment it. make it realy long.
2. turn protect mode off in the same file be commenting that line out.
3. (optional) comment the bind statement to allow connections from any interface. If you do this, you better control that port somewhere else, maybe with an AWS security group.
edit the /etc/init.d/redis_6379 file and add the following command in the start and stop case procedures:
echo "Using Auth Password" CLIEXEC="/usr/local/bin/redis-cli -a mywickedLong256character?Password"
Now you can do a sudo service redis_6379 restart command.