How to use Docker to build OpenLDAP+phpLDAPadmin unified user authentication

How to use Docker to build OpenLDAP+phpLDAPadmin unified user authentication

1. Background

Use LDAP to centrally manage operation and maintenance related usernames and passwords. One account can be used to log in to multiple different systems.
Manual deployment has all kinds of problems. Later, Docker deployment was adopted. After referring to many tutorial documents, the following summary is available for personal testing.

2. Deploy Docker to build LDAP

# Pull the image docker pull osixia/openldap:1.3.0
 
# Create and enter the mapping directory mkdir -p /usr/local/ldap && cd /usr/local/ldap
 
# Start the container docker run \
  -d \
  -p 389:389 \
  -p 636:636 \
  -v /usr/local/ldap:/usr/local/ldap \
  --name ldap \
  osixia/openldap:1.3.0
 
#Default configuration dn dc=example,dc=org
admin admin,dc=example,dc=org
password admin

Enter the container and verify whether it is available

# Enter the container docker exec -it ldap /bin/bash
 
# Execute the query ldapsearch -x -H ldap://localhost:389 -b dc=example,dc=org -D "cn=admin,dc=example,dc=org" -w admin
 
# Or execute the query directly outside the container docker exec -it ldap ldapsearch -x -H ldap://localhost:389 -b dc=example,dc=org -D "cn=admin,dc=example,dc=org" -w admin

Docker builds phpLDAPadmin

# Pull the image docker pull osixia/phpldapadmin
 
# Start the container docker run -dit \
> -p 8081:80 \
> --link ldap \
> --name suiyue_pla \
> --env PHPLDAPADMIN_HTTPS=false \
> --env PHPLDAPADMIN_LDAP_HOSTS=ldap \
> --restart always \
> --detach osixia/phpldapadmin

Finish

Enter http://localhost:8081/ Username: admin,dc=example,dc=org Password: admin

insert image description here

insert image description here

Reference tutorial:

https://blog.csdn.net/weixin_42257195/article/details/102769495
http://blog.chinaunix.net/uid-21926461-id-5676013.html
https://wiki.shileizcc.com/confluence/display/openldap/OpenLDAP
https://www.cnblogs.com/eoalfj/p/11837415.html

This is the end of this article about how to build OpenLDAP+phpLDAPadmin unified user authentication with Docker. For more relevant Docker user authentication content, please search 123WORDPRESS.COM's previous articles or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • How to configure PHP development environment through docker on Mac
  • Docker installation of PHP and deployment example with Nginx
  • Explanation of the steps to install PHP extension in Docker
  • Docker build PHP environment tutorial detailed explanation
  • Detailed tutorial on installing php-fpm service/extension/configuration in docker
  • Docker's flexible implementation of building a PHP environment
  • How to deploy LNMP & phpMyAdmin in docker
  • PHP uses docker to run workerman case explanation

<<:  XHTML Getting Started Tutorial: Simple Web Page Creation

>>:  It's the end of the year, is your MySQL password safe?

Recommend

Experience in designing a layered interface in web design

Many netizens often ask why their websites always ...

Detailed examples of replace and replace into in MySQL into_Mysql

MySQL replace and replace into are both frequentl...

Example code for implementing a simple search engine with MySQL

Table of contents Preface Introduction ngram full...

Example code of implementing starry sky animation with CSS3 advanced LESS

This article introduces the sample code of advanc...

JS array deduplication details

Table of contents 1 Test Cases 2 JS array dedupli...

Detailed explanation of the difference between uniapp and vue

Table of contents 1. Simple page example 2.uni-ap...

js implements axios limit request queue

Table of contents The background is: What will ha...

JS implements simple addition and subtraction of shopping cart effects

This article example shares the specific code of ...

Detailed explanation of using MySQL where

Table of contents 1. Introduction 2. Main text 2....

How to hide the version number and web page cache time in Nginx

Nginx optimization---hiding version number and we...

Detailed explanation of component development of Vue drop-down menu

This article example shares the specific code for...

Solution to the problem that MySQL commands cannot be entered in Chinese

Find the problem Recently, when I connected to th...

Solution to the welcome to emergency mode message when booting CentOS7.4

Today I used a virtual machine to do an experimen...

How to customize at and cron scheduled tasks in Linux

There are two types of scheduled tasks in Linux s...