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

Quickly solve the Chinese input method problem under Linux

Background: I'm working on asset reporting re...

WeChat applet to save albums and pictures to albums

I am currently developing a video and tool app, s...

How to configure multiple projects with the same domain name in Nginx

There are two ways to configure multiple projects...

How to limit the number of records in a table in MySQL

Table of contents 1. Trigger Solution 2. Partitio...

Detailed explanation of Bind mounts for Docker data storage

Before reading this article, I hope you have a pr...

Solution to nginx not jumping to the upstream address

Preface Today I encountered a very strange proble...

CSS3 mobile vw+rem method to achieve responsive layout without relying on JS

1. Introduction (1) Introduction to vw/vh Before ...

10 very good CSS skills collection and sharing

Here, clever use of CSS techniques allows you to g...

The actual process of implementing the guessing number game in WeChat applet

Table of contents Function Introduction Rendering...

VSCode Development UNI-APP Configuration Tutorial and Plugin

Table of contents Written in front Precautions De...

Vue recursively implements three-level menu

This article example shares the specific code of ...

JavaScript Document Object Model DOM

Table of contents 1. JavaScript can change all HT...

JavaScript canvas realizes dynamic point and line effect

This article shares the specific code for JavaScr...

Web Design Tutorial (7): Improving Web Design Efficiency

<br />Previous article: Web Design Tutorial ...