How can I change Redis configuration directory?

Solved Technical Support
  • Hi, I want change Redis configuration directory to /home/redis.
    So I make a fresh reinstall a Debian 11 and used this commands:

    add-apt-repository ppa:chris-lea/redis-server -y
    apt-get update
    apt-get install -y redis-server
    mkdir -p /home/redis /home/redis/sock/ /home/redis/log/ /home/redis/db/ /home/redis/lib/
    cp /etc/redis/redis.conf /home/redis/lib
    chown -hR redis:redis /home/redis
    chmod 2770 /home/redis
    chmod 2770 /home/redis/*
    chmod 640 /home/redis/lib/redis.conf
    # ---------------------------------------------------#
    vim /etc/init.d/redis-server
    # Change: DAEMON_ARGS=/etc/redis/redis.conf
    # To: DAEMON_ARGS=/home/redis/lib/redis.conf
    CTRL+C :wq
    vim /etc/systemd/system/redis.service
    # Change: ExecStart=/usr/bin/redis-server /etc/redis/redis.conf --supervised systemd --daemonize no
    # To: ExecStart=/usr/bin/redis-server /home/redis/lib/redis.conf --supervised systemd --daemonize no
    # Change: ReadWriteDirectories=-/etc/redis
    # To: ReadWriteDirectories=-/home/redis
    CTRL+C :wq
    # ---------------------------------------------------#
    sudo systemctl daemon-reload
    sudo service redis-server restart

    Why 2270 permission? This is default permission for Redis user in /etc/redis directory so I thinked this maybe help but same (Permission Denied)

    User permissions from WinSCP group:user:

    output from syslog:
    redis-server[639]: 639:C 07 Sep 2021 11:33:19.214 # Fatal error, can't open config file '/home/redis/lib/redis.conf': Permission denied

    Only working this command from root:
    /usr/bin/redis-server /home/redis/lib/redis.conf

    I searched solutions in google in websites like stackoverflow but no one helped me 😕
    I know this is not a forum but I think someone maybe can help. 😜
    Thanks for help in advance.

  • Solved just marked out ProtectHome:yes to #ProtectHome:yes

Suggested Topics

  • 0 Votes
    4 Posts

    @sinisterspatula Probably, yes.

    The thing is, we don't interface with MongoDB directly. We use an abstraction layer, and so if your database of choice supports all of the commands we throw at it (you can see the abstraction layer methods in src/database/*), then NodeBB can theoretically support it.

  • Manually change digest settings

    Unsolved Technical Support
    0 Votes
    2 Posts

    I think a script like this could work:

    'use strict'; var nconf = require('nconf'); var async = require('async'); nconf.file({ file: 'config.json', }); nconf.defaults({ base_dir: __dirname, views_dir: './build/public/templates', }); var db = require('./src/database'); async.series([ db.init, process, ], (err) => { if (err) { console.error(err); process.exit(1); } process.exit(); }); const freq = 'off'; // or daily, weekly, monthly function process(callback) { var batch = require('./src/batch'); var User = require('./src/user'); batch.processSortedSet('users:joindate', function (uids, next) { async.parallel([ cb => async.each(uids, (uid, next) => { User.setSetting(uid, 'dailyDigestFreq', freq, next); }, cb), cb => async.each(uids, (uid, next) => { User.updateDigestSetting(uid, freq, next); }, cb), ], next); }, callback); }

    I think this should work to set all users to a specific frequency. Please backup your database before trying this. You might also need to fix a couple JS errors, I haven't tried this myself.

    Create a new file called process-users.js in your main nodebb directory (the one with config.json etc), paste that script into it, set the frequency you desire, and run node process-users from within that directory to set all of your users to the selected frequency.

  • How can i fix my user?

    Technical Support
    0 Votes
    1 Posts

    Hello... My user is one of the first to register on my forum (we have 2.6k now) and mine is to only one that the profile last posts and chat doesn't work.

    Does anyone have the same issue in the past? How you solve it?

    Its getting annoying... (i remember i tried to delete the user and create a new one logging in with facebook.... but it got the details of the old one.. so... everthing is fucked 🙂 )

  • 0 Votes
    1 Posts

    One of your community members tried to open an old thread with the following title: "Relay actuator sketch - auto off function"

    But NodeBB refuses to serve this to the client.

    I suspect the url-rewrite gets mocked up but nothing is reported in error/output log.

    We're still running v0.7.0-dev something

    commit 9165da3b26a044c288d5db73c4933ca2b29e6a78

    EDIT: Upgrading to 0.8.2 seems to fix this.

  • 0 Votes
    14 Posts

    Glad I could help 🙂