Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


What is the strange problem with OpenLiteSpeed and Redis Object Cache?
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

What is the strange problem with OpenLiteSpeed and Redis Object Cache?

Hi everyone

I have three websites on one vps. Use OpenLiteSpeed.
I separated the username of OpenLiteSpeed’s PHP.
PHP user A, PHP user B, PHP user C.
However, the plugin Redis Object Cache for PHP users C appears “Permission denied”
The other two websites are intact. What is the reason for this..
The configurations of the three websites are the same
Join all three user groups

 95831 root       20   0 22456  8336  6552 S  0.0  0.1  0:14.86 ├─ openlitespeed (lshttpd - main)
  95832 root       20   0 12748  2932  2000 S  0.0  0.0  0:02.25 │  ├─ openlitespeed (lscgid)
  95844 aaa     21   1  221M 33664 25952 S  0.0  0.4  0:02.50 │  │  ├─ lsphp
  97771 aaa     21   1  226M 60156 47532 S  0.0  0.7  0:00.12 │  │  │  └─ lsphp
  96501 bbb    21   1  221M 33576 25860 S  0.0  0.4  0:01.80 │  │  ├─ lsphp
  97584 bbb    21   1  343M  110M 82504 S  0.0  1.4  0:08.69 │  │  │  ├─ lsphp
  97659 bbb    21   1  341M  108M 84332 S  0.0  1.4  0:10.44 │  │  │  ├─ lsphp
  97692 bbb    21   1  341M  107M 81932 S  0.0  1.4  0:05.13 │  │  │  ├─ lsphp
  97695 bbb    21   1  342M  106M 81924 S  0.0  1.3  0:04.57 │  │  │  └─ lsphp
  97167 ccc    20   0  238M 67560 43100 S  0.0  0.8  0:01.13 │  │  ├─ lsphp
  97717 ccc    20   0  308M 83976 61252 S  0.0  1.0  0:00.75 │  │  │  ├─ lsphp
  97833 ccc    20   0  310M 85936 61040 S  0.0  1.1  0:00.28 │  │  │  └─ lsphp
  95833 nobody     20   0 25812 10048  6668 S  0.0  0.1  0:32.71 │  ├─ openlitespeed (lshttpd - #01)
  95834 nobody     20   0 25844 10004  6668 S  0.0  0.1  0:32.49 │  ├─ openlitespeed (lshttpd - #02)
  95835 nobody     20   0 25916 10028  6668 S  0.0  0.1  0:32.54 │  ├─ openlitespeed (lshttpd - #03)
  95836 nobody     20   0 25744  9840  6604 S  0.0  0.1  0:31.95 │  ├─ openlitespeed (lshttpd - #04)
  95838 nobody     20   0 25768 10320  7068 S  0.0  0.1  0:32.58 │  ├─ openlitespeed (lshttpd - #05)
  95839 nobody     20   0 26292 10332  6604 S  0.0  0.1  0:33.73 │  ├─ openlitespeed (lshttpd - #06)
  95840 nobody     20   0 26020 10328  6668 S  0.0  0.1  0:32.84 │  ├─ openlitespeed (lshttpd - #07)
  95841 nobody     20   0 25656  9880  6668 S  0.0  0.1  0:33.06 │  ├─ openlitespeed (lshttpd - #08)
  95842 nobody     20   0 25840 10060  6668 S  0.0  0.1  0:32.43 │  ├─ openlitespeed (lshttpd - #09)
  95843 nobody     20   0 25740  9832  6604 S  0.0  0.1  0:33.58 │  └─ openlitespeed (lshttpd - #10)
Status: Not connected
Client: PhpRedis (v5.1.1)
Drop-in: Valid
Disabled: No
Ping:
Connection Exception: Permission denied (RedisException)
Errors: [
    "Permission denied"
]
PhpRedis: 5.1.1
Predis: Not loaded
Credis: Not loaded
PHP Version: 7.4.23
Plugin Version: 2.0.21
Redis Version: Unknown
Multisite: No
Metrics: Disabled
Metrics recorded: null
Filesystem: Working
Global Prefix: "e_"
Blog Prefix: "e_"
WP_REDIS_CLIENT: "phpredis"
WP_REDIS_SCHEME: "unix"
WP_REDIS_PATH: "/var/run/redis/redis.sock"
WP_REDIS_DATABASE: "1"
WP_REDIS_TIMEOUT: 1
WP_REDIS_READ_TIMEOUT: 1
WP_REDIS_PREFIX: "%nBb<,<nEs-31!O-8GF6qv"
WP_CACHE_KEY_SALT: "%nBb<,<nEs-31!O-8GF6qv"
WP_REDIS_PASSWORD: ••••••••
Global Groups: [
    "blog-details",
    "blog-id-cache",
    "blog-lookup",
    "global-posts",
    "networks",
    "rss",
    "sites",
    "site-details",
    "site-lookup",
    "site-options",
    "site-transient",
    "users",
    "useremail",
    "userlogins",
    "usermeta",
    "user_meta",
    "userslugs",
    "redis-cache"
]
Ignored Groups: [
    "counts",
    "plugins",
    "themes",
    "blog-details",
    "blog-id-cache",
    "blog-lookup",
    "global-posts",
    "networks",
    "rss",
    "sites",
    "site-details",
    "site-lookup",
    "site-options",
    "site-transient",
    "users",
    "useremail",
    "userlogins",
    "usermeta",
    "user_meta",
    "userslugs",
    "redis-cache",
    "blog_meta"
]
Unflushable Groups: []
Drop-ins: [
    "Redis Object Cache Drop-In v2.0.21 by Till Krüss"
]

Comments

  • What do you get when you run systemctl status redis?

  • @AndrewL64 said:
    What do you get when you run systemctl status redis?

    ● redis-server.service - Advanced key-value store
         Loaded: loaded (/lib/systemd/system/redis-server.service; enabled; vendor preset: enabled)
         Active: active (running) since Wed 2021-09-22 11:41:39 EDT; 15h ago
           Docs: http://redis.io/documentation,
                 man:redis-server(1)
       Main PID: 96079 (redis-server)
         Status: "Ready to accept connections"
          Tasks: 5 (limit: 9510)
         Memory: 22.3M
            CPU: 3min 2.243s
         CGroup: /system.slice/redis-server.service
                 └─96079 /usr/bin/redis-server 127.0.0.1:9999
    
    Sep 22 11:41:39 hh systemd[1]: Starting Advanced key-value store...
    Sep 22 11:41:39 hh systemd[1]: Started Advanced key-value store.
    
    
  • AndrewL64AndrewL64 Member
    edited September 2021

    @coolgoole said:

    Active: active (running) since Wed 2021-09-22 11:41:39 EDT; 15h ago
    Status: "Ready to accept connections"
    

    The above two lines seem to indicate that everything is fine with redis and the following lines indicate that it's not a password issue either:

    Connection Exception: Permission denied (RedisException)
    Errors: [
        "Permission denied"
    ]
    

    Can you paste relevant sections of your redis log here. In Ubuntu, you can most probably find the log here: /var/log/redis/redis-server.log. If you're using some other OS or can't find the log in that location, you can just check the path in your config file /etc/redis/redis.conf.

  • @AndrewL64 said:

    @coolgoole said:

    Sorry just came
    I know it is a permission issue, I tried it with a new website.
    It is the permission problem of PHP and redis.
    It's just that I added everything to the redis group, but there is still no way.

    2515:M 23 Sep 2021 07:34:57.643 * Ready to accept connections
    2515:M 23 Sep 2021 07:34:57.643 * The server is now ready to accept connections at /var/run/redis/redis.sock
    2515:signal-handler (1632397235) Received SIGTERM scheduling shutdown...
    2515:M 23 Sep 2021 07:40:35.325 # User requested shutdown...
    2515:M 23 Sep 2021 07:40:35.325 * Removing the pid file.
    2515:M 23 Sep 2021 07:40:35.325 * Removing the unix socket file.
    2515:M 23 Sep 2021 07:40:35.325 # Redis is now ready to exit, bye bye...
    2905:C 23 Sep 2021 07:40:35.371 # WARNING supervised by systemd - you MUST set appropriate values for TimeoutStartSec and TimeoutStopSec in your service unit.
    2905:C 23 Sep 2021 07:40:35.371 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
    2905:C 23 Sep 2021 07:40:35.371 # Redis version=6.0.15, bits=64, commit=00000000, modified=0, pid=2905, just started
    2905:C 23 Sep 2021 07:40:35.371 # Configuration loaded
    2905:M 23 Sep 2021 07:40:35.373 * Running mode=standalone, port=9769.
    2905:M 23 Sep 2021 07:40:35.373 # Server initialized
    2905:M 23 Sep 2021 07:40:35.373 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo madvise > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled (set to 'madvise' or 'never').
    2905:M 23 Sep 2021 07:40:35.374 * Loading RDB produced by version 5.0.3
    2905:M 23 Sep 2021 07:40:35.374 * RDB age 24801460 seconds
    2905:M 23 Sep 2021 07:40:35.374 * RDB memory usage when created 0.76 Mb
    2905:M 23 Sep 2021 07:40:35.374 * DB loaded from disk: 0.000 seconds
    2905:M 23 Sep 2021 07:40:35.374 * Ready to accept connections
    2905:M 23 Sep 2021 07:40:35.374 * The server is now ready to accept connections at /var/run/redis/redis.sock
    
    
  • Why don't you try connecting to Redis via TCP port 9999 on 127.0.0.1? That shouldn't need any socket permissions to worry about.

    Use (example only, please refine based on the rest of your settings):

    WP_REDIS_HOST: “127.0.0.1”
    WP_REDIS_PORT: 9999
    

    The 9999 is from your systemctl status redis

    Also, you should check the settings for the users ( A and B ) where PHP seems to connect fine to Redis and see if/why it is using a different way to connect to Redis.

Sign In or Register to comment.