UNPKG

966 Bapplication/x-shView Raw
1#!/usr/bin/env bash
2
3# Prepare
4
5echo 'Preparing environment'
6
7sudo apt-get update
8sudo apt-get install -y build-essential wget redis-tools
9
10echo "-----------------------------------------------------------------------"
11echo " Installing Redis..."
12echo "-----------------------------------------------------------------------"
13
14cd ~
15wget http://download.redis.io/redis-stable.tar.gz
16tar xvzf redis-stable.tar.gz
17
18# rename the created redis directory to just redis
19
20mv redis-stable redis
21cd redis
22
23# build Redis
24
25echo "Building Redis - be patient, this will take a few minutes"
26
27make
28sudo make install
29cd utils
30
31PORT=6379
32CONFIG_FILE=/etc/redis/6379.conf
33LOG_FILE=/var/log/redis_6379.log
34DATA_DIR=/var/lib/redis/6379
35EXECUTABLE=/usr/local/bin/redis-server
36
37echo -e "${PORT}\n${CONFIG_FILE}\n${LOG_FILE}\n${DATA_DIR}\n${EXECUTABLE}\n" | sudo ./install_server.sh
38sudo update-rc.d redis_6379 defaults
39
40echo "Redis is now installed and running, listening on port 6379"
41
42
43