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