Redis Server: Difference between revisions
Created page |
m →Starting and testing the server: Added command to enable service on boot |
||
Line 27: | Line 27: | ||
* Check by typing <code>ping</code>. You should receive the response <code>PONG</code> | * Check by typing <code>ping</code>. You should receive the response <code>PONG</code> | ||
* Exit by typing <code>exit</code> | * Exit by typing <code>exit</code> | ||
* If all is working well, enable the service so that it starts on boot: <code>sudo systemctl enable redis@redis</code> | |||
NOTE: The service name changes depending on the <code>.conf</code> file name - e.g. if you save d the configuration as <code>default.conf</code>, you would run <code>service redis@default start</code>. | NOTE: The service name changes depending on the <code>.conf</code> file name - e.g. if you save d the configuration as <code>default.conf</code>, you would run <code>service redis@default start</code>. | ||
Latest revision as of 15:42, 25 June 2024
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 withnano
- 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 responsePONG
- Exit by typing
exit
- If all is working well, enable the service so that it starts on boot:
sudo systemctl enable redis@redis
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.