osixia / docker-phpLDAPadmin

phpLDAPadmin container image 🐳🌴
MIT License
844 stars 197 forks source link

can't login with admin #41

Closed zWingz closed 6 years ago

zWingz commented 6 years ago
      docker run -p 6443:443 \

       --env PHPLDAPADMIN_LDAP_HOSTS=ldap.example.com \

       osixia/phpldapadmin:latest

Login DN: cn=admin,dc=example,dc=org (cn=admin,dc=ldap,dc=example,dc=org) password: admin

Response: Unable to connect to LDAP server ldap.example.com

Error: Can't contact LDAP server (-1) for user Failed to Authenticate to server Invalid Username or Password.

image

will-hu-0 commented 6 years ago

@zWingz , wondering how you fix it? I got the same issue..............

I ran it by:

docker run -p 6443:443 \
       --env PHPLDAPADMIN_LDAP_HOSTS=localhost \
       --detach osixia/phpldapadmin:0.7.1

Appreciate it in advance :)

zWingz commented 6 years ago

@keenkit confirm PHPLDAPADMIN_LDAP_HOSTS is right

will-hu-0 commented 6 years ago

Thanks @zWingz .. It works by By running the script:

#!/bin/bash -e
docker run --name ldap-service --hostname ldap-service --detach osixia/openldap:1.2.1
docker run --name phpldapadmin-service --hostname phpldapadmin-service --link ldap-service:ldap-host --env PHPLDAPADMIN_LDAP_HOSTS=ldap-host --detach osixia/phpldapadmin:0.7.1

PHPLDAP_IP=$(docker inspect -f "{{ .NetworkSettings.IPAddress }}" phpldapadmin-service)

echo "Go to: https://$PHPLDAP_IP"
echo "Login DN: cn=admin,dc=example,dc=org"
echo "Password: admin"

I got

Go to: https://172.17.0.4
Login DN: cn=admin,dc=example,dc=org
Password: admin

which is good!

will-hu-0 commented 6 years ago

Not sure how you fixed it?

zWingz commented 6 years ago
docker run -p 6443:443 \
       --env PHPLDAPADMIN_LDAP_HOSTS=localhost \
       --detach osixia/phpldapadmin:0.7.1

the script only start the phpAdminServer, but the ldap server is not running. you need to start the LDAP SERVER at first and use PHPLDAPADMIN_LDAP_HOSTS connect to LDAP SERVER

will-hu-0 commented 6 years ago

yes.. True, need to start LDAP SERVER first. Did you start up ldap server simply by:

docker run --name my-openldap-container --detach osixia/openldap:1.2.1

which is indicated in the https://github.com/osixia/docker-openldap#quick-start ?

zWingz commented 6 years ago

@keenkit https://github.com/materliu/ldap-docker-compose

sullamago commented 5 years ago

I had some problem,but I changed the script that the introduce give . and it works well

!/bin/bash -e

docker run -p 389:389 -p 636:636 --name ldap-service --hostname ldap-service -v '/Users/su/tmp/openldap/database:/var/lib/ldap' -v '/Users/su/tmp/openldap/config:/etc/ldap/slapd.d' --detach osixia/openldap:1.2.4 docker run -p 6443:443 --name phpldapadmin-service --hostname phpldapadmin-service --link ldap-service:ldap-host --env PHPLDAPADMIN_LDAP_HOSTS=ldap-host --detach osixia/phpldapadmin:0.8.0

echo "Go to: https://localhost:6443/" echo "Login DN: cn=admin,dc=example,dc=org" echo "Password: admin"

msca79 commented 4 years ago

In my case it was the host computer firewall. The two docker container (openldap and phpldapadmin) can ping each other, but can not see any other port. Turning off firewall solved this problem. (Better is you configure firewall)

xu20160924 commented 3 years ago

I face the same problem,and I solve it with your solutions. "--link ldap-service:ldap-host and PHPLDAPADMIN_LDAP_HOSTS = ldap-host. If your problem is not caused by firewall or ldap didn't start at first etc. I guess your problem is the same as mine. And by the way I didn't create a new network for this, I use the existing network.

leocook commented 1 month ago

I face the same problem,and I solve it with your solutions. "--link ldap-service:ldap-host and PHPLDAPADMIN_LDAP_HOSTS = ldap-host. If your problem is not caused by firewall or ldap didn't start at first etc. I guess your problem is the same as mine. And by the way I didn't create a new network for this, I use the existing network.

Thanks every much~This resolve my problem @xu20160924