Redis Server

From ThinkServer
Revision as of 12:49, 25 June 2024 by Sam (talk | contribs) (Created page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

The redis server is used by Nextcloud to lock files much faster than using the database.

Installation

  • Open YaST
  • Open Software Management
  • Search for redis
  • Select package redis for installation

NOTE: You may see 2 packages - redis and redis7. redis7 is an out of date version of redis - install the redis package.

  • Ensure the php8-redis package is also installed.
  • Accept the installation and allow the package to install.

Configuration

  • Open /etc/redis/default.conf.example file with nano
  • We will be using Unix sockets so amend the following:
    • port 6379 -> port 0
    • # unixsocket /run/redis.sock -> unixsocket /var/run/redis/redis.sock
    • # unixsocketperm 700 -> unixsocketperm 770

NOTE: Be sure to # uncomment the last two lines.

  • Save the file as redis.conf

Starting and testing the server

  • Run sudo service redis@redis start
  • Run redis-cli -s /var/run/redis/redis.sock
  • Check by typing ping. You should receive the response PONG
  • Exit by typing exit

NOTE: The service name changes depending on the .conf file name - e.g. if you save d the configuration as default.conf, you would run service redis@default start.

Allow web server access

  • Start YaST
  • Go to 'Security and Users'
  • Open 'User and Group Management'
  • Go to the 'Groups' tab
  • Select 'Set Filter' then select 'System Groups'
  • From the list, find the redis group
  • Select 'Edit'
  • In the 'Group Members' box, find wwwrun and select it.
  • Once done, accept and close YaST.