Skip to content

Instantly share code, notes, and snippets.

@jewishmoses
Last active June 4, 2021 13:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jewishmoses/75854576a448cd36c39f1a3a5d9d997d to your computer and use it in GitHub Desktop.
Save jewishmoses/75854576a448cd36c39f1a3a5d9d997d to your computer and use it in GitHub Desktop.
Install redis for production
#!/usr/bin/env bash
set -e
sudo apt install build-essential -y
sudo apt install tcl -y # for make test
wget http://download.redis.io/redis-stable.tar.gz
tar xvzf redis-stable.tar.gz
cd redis-stable
make
make test
sudo make install
sudo mkdir /etc/redis
sudo mkdir /var/redis
sudo cp utils/redis_init_script /etc/init.d/redis_6379
sudo cp redis.conf /etc/redis/6379.conf
sudo mkdir /var/redis/6379
sudo nano /etc/redis/6379.conf
# Set daemonize to yes (by default it is set to no).
# Set the pidfile to /var/run/redis_6379.pid
# Set the logfile to /var/log/redis_6379.log
# Set the dir to /var/redis/6379 (very important step!)
# Set the requirepass to your desired password
sudo update-rc.d redis_6379 defaults
sudo /etc/init.d/redis_6379 start
rm install-redis.sh redis-stable redis-stable.tar.gz -r
@jewishmoses
Copy link
Author

wget https://gist.github.com/jewishmoses/75854576a448cd36c39f1a3a5d9d997d/raw/install-redis.sh
chmod +x install-redis.sh
./install-redis.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment