Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

setup systemd redis

1. Install pre-requisities

  `sudo apt-get install build-essential tcl`

2. Install Redis

  ```
  cd /tmp
  curl -O http://download.redis.io/redis-stable.tar.gz
  tar xzvf redis-stable.tar.gz
  cd redis-stable
  make
  make test
  sudo make install
  ```
  
3. Configure Redis

  ```
  sudo mkdir /etc/redis
  sudo cp /tmp/redis-stable/redis.conf /etc/redis
  sudo nano /etc/redis/redis.conf
  ```
  
  In the file, change the `supervised` directive`s value to `systemd`.
  
  ```
  ...
  supervised systemd
  ...
  ```
  
  Next, specify the working directory for Redis. This  is the directory that Redis will use to dump persistent data. We can use `/var/lib/redis`
  
  ```
  ...
  dir /var/lib/redis
  ...
  ```
  
  Save and close the file.
  
4. Configure systemd to start Redis on boot

  `sudo nano /etc/systemd/system/redis.service`
  
  Copy the contents of [this gist](https://gist.github.com/hackedunit/14690b6174708d3e83593ce1cdfb4ed8) to the file, save and close.

5. Create Redis user, group and directories

  ```
  sudo adduser --system --group --no-create-home redis
  sudo mkdir /var/lib/redis
  sudo chown redis:redis /var/lib/redis
  sudo chmod 770 /var/lib/redis
  ```

6. Start the Redis service and set Redis to start on boot

  ```
  sudo systemctl start redis
  sudo systemctl enable redis
  ```
 
Comment

PREVIOUS NEXT
Code Example
Shell :: powershell get arguments 
Shell :: how to copy one local machine to server through ssh 
Shell :: how to erase folder that match characters in linux 
Shell :: Finding path to some ruby versions 
Shell :: batch escape character 
Shell :: how do you merge two git repositories 
Shell :: how to check pyqt version 
Shell :: ssh powershell 
Shell :: linux command to go to the previous directory 
Shell :: install sketch for ubuntu 
Shell :: grep in windows 
Shell :: list files of type txt from cmd 
Shell :: linux bash connect to postgres 
Shell :: Contact the upstream for the repository and get them to fix the problem. 
Shell :: regolith linux 
Shell :: how to add images in readme github 
Shell :: change directory, files and sub-directories owner in linux 
Shell :: git remove tag from remote 
Shell :: how to update pg_dump version linux 
Shell :: CMake Error at src/CMakeLists.txt:10 (find_package): By not providing "FindOpenCV.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "OpenCV", but CMake did not find one. 
Shell :: how to execute a bash script in terminal 
Shell :: how to install specific package version npm 
Shell :: ubuntu 20.04 install nginx 
Shell :: scp file download 
Shell :: current git id 
Shell :: putty for ubuntu 
Shell :: add ignored file to git 
Shell :: grep a string in txt file 
Shell :: git cherry pick commit 
Shell :: git remote add 
ADD CONTENT
Topic
Content
Source link
Name
3+2 =