sasanrose / phpredmin

Yet another web interface for Redis
BSD 3-Clause "New" or "Revised" License
404 stars 96 forks source link

Using socket: no documentation and cannot make it work. #94

Open Yivan opened 6 years ago

Yivan commented 6 years ago

Hello,

First, thanks for this nice GUI for Redis.

We are trying to make it work with redis on unix socket. We have many containers and using TCP is not a solution as docker is limited to around 30 networks and we don't want others containers being able to connect to redmin (if we make 1 network per stack to secure redis, we would be limited to maximum 30 indepedant stacks). So we set it as socket and share the socket folder between redis container and phpredmin container.

In my docker-compose I have:

        environment:
            - "PHPREDMIN_DATABASE_REDIS_0_HOST=unix:///var/run/redis/redis.sock"

But it don't work, i got a blanck page... no errors displayed and nothing in /var/log.

First, where can we find the errors log or force display them ? Second what is the good synthax to make it work with socket, I tried:

I should add using TCP, the exact same docker compose work. Socket is working, i tested it with redis-cli. So the problem seems to make phpredmin use the socket file... I any help could be given it would be nice, and may e add it to the documentation.

Thanks!

sasanrose commented 6 years ago

Hi

You can increase the log threshold to 5 in config file and see if it's helpful or not. PhpRemin does not connect to Redis by itself so you need to consult with the Redis extension that you used. If you are using the official PhpRedmin image the Redis extension that is used in the image is https://github.com/phpredis/phpredis

Yivan commented 6 years ago

Thanks @sasanrose

I manage to make it work by using:

        environment:
            - "PHPREDMIN_DATABASE_REDIS_0_HOST=/var/run/redis/redis.sock"
            - "PHPREDMIN_DATABASE_REDIS_0_PORT=0"

Forcing port to 0 disable attempting to connect in TCP.

The second problem was socket file has 700 permission. To work i need to set it to 777, by using unixsocketperm 777 in the redis.conf.

The issue can be close. Maybe those tips could be added to the documentation.

Best regards.