<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="es">
	<id>https://wiki.castanedo.es/index.php?action=history&amp;feed=atom&amp;title=OpenLDAP</id>
	<title>OpenLDAP - Historial de revisiones</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.castanedo.es/index.php?action=history&amp;feed=atom&amp;title=OpenLDAP"/>
	<link rel="alternate" type="text/html" href="https://wiki.castanedo.es/index.php?title=OpenLDAP&amp;action=history"/>
	<updated>2026-05-10T14:18:26Z</updated>
	<subtitle>Historial de revisiones de esta página en la wiki</subtitle>
	<generator>MediaWiki 1.39.8</generator>
	<entry>
		<id>https://wiki.castanedo.es/index.php?title=OpenLDAP&amp;diff=201&amp;oldid=prev</id>
		<title>Guzman en 21:40 18 abr 2026</title>
		<link rel="alternate" type="text/html" href="https://wiki.castanedo.es/index.php?title=OpenLDAP&amp;diff=201&amp;oldid=prev"/>
		<updated>2026-04-18T21:40:09Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Página nueva&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Instalación OpenLDAP en Docker ==&lt;br /&gt;
Instalación de [https://hub.docker.com/r/vegardit/openldap vegardit/openldap] en Docker.&lt;br /&gt;
Se va a usar los siguientes protocolos:&lt;br /&gt;
* LDAP (puerto 389/tcp): sólo en localhost&lt;br /&gt;
* LDAPS (puerto 636/tcp): publicado con Nginx como reserve proxy (en PRO)&lt;br /&gt;
&lt;br /&gt;
== Requisitos ==&lt;br /&gt;
Para poder realizar esta configuración se necesita:&lt;br /&gt;
* Servidor GNU Linux (ver [[Securizar Ubuntu Server]])&lt;br /&gt;
** Cortafuegos FirewallD (UFW tiene problemas con Docker)&lt;br /&gt;
* Docker Engine (ver [[Docker Engine]])&lt;br /&gt;
** Módulo: Docker Compose (para PRO)&lt;br /&gt;
* Nginx (ver [[LEMP]])&lt;br /&gt;
** Módulo: Nginx Stream (incluido en Ubuntu)&lt;br /&gt;
&lt;br /&gt;
== Entorno de DEV ==&lt;br /&gt;
Como entorno de DEV se va a usar Docker Desktop.&lt;br /&gt;
&lt;br /&gt;
=== Descargar imagen ===&lt;br /&gt;
Vamos a usar la imagen que es la latest a día de hoy (2.6.10).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Bash&amp;quot;&amp;gt;docker pull vegardit/openldap:2.6.10&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Ejecutar contenedor en Docker Desktop (DEV) ===&lt;br /&gt;
Vamos a usar la imagen sólo con LDAP (389/tcp) solo para localhost.&lt;br /&gt;
IMPORTANTE: para añadir SSL/TLS usaremos Nginx.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Bash&amp;quot;&amp;gt;&lt;br /&gt;
docker run -d --name openldap \&lt;br /&gt;
 --hostname ldapdev.culturetas.net \&lt;br /&gt;
 --env LDAP_INIT_ORG_DN=&amp;quot;dc=culturetas,dc=net&amp;quot; \&lt;br /&gt;
 --env LDAP_INIT_ORG_NAME=&amp;quot;Culturetas SPQR&amp;quot; \&lt;br /&gt;
 --env LDAP_INIT_ROOT_USER_DN='uid=admin,dc=culturetas,dc=net' \&lt;br /&gt;
 --env LDAP_INIT_ROOT_USER_PW=&amp;quot;CONTRASEÑA&amp;quot; \&lt;br /&gt;
 --env LDAP_INIT_PPOLICY_PW_MIN_LENGTH='12' \&lt;br /&gt;
 --env LDAP_INIT_ADMIN_GROUP_DN='cn=ldap-admins,ou=Groups,dc=culturetas,dc=net' \&lt;br /&gt;
 --env LDAP_INIT_PASSWORD_RESET_GROUP_DN='cn=ldap-password-reset,ou=Groups,dc=culturetas,dc=net' \&lt;br /&gt;
 --env LDAP_INIT_RFC2307BIS_SCHEMA=0 \&lt;br /&gt;
 --env LDAP_INIT_ALLOW_CONFIG_ACCESS='true' \&lt;br /&gt;
 --env LDAP_TLS_ENABLED=false \&lt;br /&gt;
 --env LDAP_LDAPS_ENABLED=false \&lt;br /&gt;
 -p 127.0.0.1:389:389 \&lt;br /&gt;
 -v ldap-data:/var/lib/ldap -v ldap-config:/etc/ldap/slapd.d \&lt;br /&gt;
 vegardit/openldap:2.6.10&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
'''Nota''': OpenSSL soporta SSL/TLS, pero con vegardit/openldap no funciona correctamente y tras un handshake correcot, no completa siempre la autenticación (usaremos un reverse proxy como alternativa y es más seguro).&lt;br /&gt;
&lt;br /&gt;
=== Pruebas ===&lt;br /&gt;
Vamos a probar a conectar usando [https://directory.apache.org/studio/downloads.html Apache Directory Studio].&lt;br /&gt;
* Hostname: 127.0.0.1&lt;br /&gt;
* Port: 389&lt;br /&gt;
* Encryption: LDAP&lt;br /&gt;
* Bind DN: uid=admin,dc=culturetas,dc=net&lt;br /&gt;
* Bind password: CONTRASEÑA&lt;br /&gt;
&lt;br /&gt;
== Entorno de PRO ==&lt;br /&gt;
En el entorno de PRO se va a desplegar transformando la configuración de Docker Desktop en fichero YAML de Docker Composer.&lt;br /&gt;
&lt;br /&gt;
=== Instalar módulo Stream de Nginx ===&lt;br /&gt;
Nginx con módulo Stream permite balancear a puertos TCP o UDP (que no sean HTTP).&lt;br /&gt;
No viene con el paquete estándar de Nginx, se instala aparte:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Bash&amp;quot;&amp;gt;apt install libnginx-mod-stream&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Bash&amp;quot;&amp;gt;systemctl restart nginx&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Configuración módulo Stream ===&lt;br /&gt;
* Backup nginx.conf&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Bash&amp;quot;&amp;gt;cp -a /etc/nginx/nginx.conf /etc/nginx/nginx.conf.20260322&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Crear carpeta para Stream&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Bash&amp;quot;&amp;gt;mkdir /etc/nginx/stream-available&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Bash&amp;quot;&amp;gt;mkdir /etc/nginx/stream-enabled&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Añadir configuración para Stream&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Bash&amp;quot;&amp;gt;vi /etc/nginx/nginx.conf&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
[...]&lt;br /&gt;
stream {&lt;br /&gt;
	# Log format&lt;br /&gt;
	log_format stream_format '$remote_addr [$time_local] '&lt;br /&gt;
							 '$protocol $status $bytes_sent $bytes_received '&lt;br /&gt;
							 '$session_time &amp;quot;$upstream_addr&amp;quot;';&lt;br /&gt;
	include /etc/nginx/stream-enabled/*;&lt;br /&gt;
}&lt;br /&gt;
[...]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Bash&amp;quot;&amp;gt;systemctl restart nginx&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Configurar Virtual Host para LDAP (para HTTP) ===&lt;br /&gt;
* Añadir Virtual Host:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Bash&amp;quot;&amp;gt;sudo -i&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Bash&amp;quot;&amp;gt;vi /etc/nginx/sites-available/ldap.culturetas.net&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
##&lt;br /&gt;
# You should look at the following URL's in order to grasp a solid understanding&lt;br /&gt;
# of Nginx configuration files in order to fully unleash the power of Nginx.&lt;br /&gt;
# http://wiki.nginx.org/Pitfalls&lt;br /&gt;
# http://wiki.nginx.org/QuickStart&lt;br /&gt;
# http://wiki.nginx.org/Configuration&lt;br /&gt;
#&lt;br /&gt;
# Generally, you will want to move this file somewhere, and start with a clean&lt;br /&gt;
# file but keep this around for reference. Or just disable in sites-enabled.&lt;br /&gt;
#&lt;br /&gt;
# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.&lt;br /&gt;
##&lt;br /&gt;
&lt;br /&gt;
# Default server configuration&lt;br /&gt;
#&lt;br /&gt;
server {&lt;br /&gt;
        # Redirect HTTP to HTTPS&lt;br /&gt;
        listen 80;&lt;br /&gt;
        listen [::]:80;&lt;br /&gt;
        server_name ldap.culturetas.net;&lt;br /&gt;
        # Redirect HTTP to HTTPS&lt;br /&gt;
        return 301 https://$host$request_uri;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
server {&lt;br /&gt;
        # SSL configuration&lt;br /&gt;
        #&lt;br /&gt;
        listen 443 ssl http2;&lt;br /&gt;
        listen [::]:443 ssl http2;&lt;br /&gt;
        ssl_certificate /etc/letsencrypt/live/culturetas.net/fullchain.pem;&lt;br /&gt;
        ssl_certificate_key /etc/letsencrypt/live/culturetas.net/privkey.pem;&lt;br /&gt;
        #&lt;br /&gt;
        # Note: You should disable gzip for SSL traffic.&lt;br /&gt;
        # See: https://bugs.debian.org/773332&lt;br /&gt;
        #&lt;br /&gt;
        # Read up on ssl_ciphers to ensure a secure configuration.&lt;br /&gt;
        # See: https://bugs.debian.org/765782&lt;br /&gt;
        #&lt;br /&gt;
        # Self signed certs generated by the ssl-cert package&lt;br /&gt;
        # Don't use them in a production server!&lt;br /&gt;
        #&lt;br /&gt;
        # include snippets/snakeoil.conf;&lt;br /&gt;
&lt;br /&gt;
        root /var/www/ldap.culturetas.net;&lt;br /&gt;
&lt;br /&gt;
        # Add index.php to the list if you are using PHP&lt;br /&gt;
        index index.php index.html index.htm;&lt;br /&gt;
&lt;br /&gt;
        server_name ldap.culturetas.net;&lt;br /&gt;
&lt;br /&gt;
        access_log /var/log/nginx/ldap.culturetas.net-access.log;&lt;br /&gt;
        error_log /var/log/nginx/ldap.culturetas.net-error.log;&lt;br /&gt;
&lt;br /&gt;
#       # Auth Basic (for developing)&lt;br /&gt;
#       auth_basic &amp;quot;Pagina Restringida&amp;quot;;&lt;br /&gt;
#       auth_basic_user_file /etc/nginx/passwd/passwd-culturetas.net;&lt;br /&gt;
&lt;br /&gt;
        # Activate HSTS (HTTP Strict Transport Security)&lt;br /&gt;
        # Note: reinclude if in a location a header is set&lt;br /&gt;
        include snippets/hsts.conf;&lt;br /&gt;
&lt;br /&gt;
        # Allow favicon.ico, robots.txt, .well-known/&lt;br /&gt;
        # Deny *.txt, *.log, .*/*.php, .*, *.json, .lock, *.ht&lt;br /&gt;
        include snippets/allowed.conf;&lt;br /&gt;
        include snippets/denied.conf;&lt;br /&gt;
&lt;br /&gt;
        # Redirect all to Keycloak&lt;br /&gt;
        return 301 https://entrar.culturetas.net;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Crear carpeta para VirtualHost:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Bash&amp;quot;&amp;gt;mkdir /var/www/ldap.culturetas.net&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Activar Virtual Host:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Bash&amp;quot;&amp;gt;ln -s /etc/nginx/sites-available/ldap.culturetas.net /etc/nginx/sites-enabled/ldap.culturetas.net&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Bash&amp;quot;&amp;gt;systemctl reload nginx&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Generar certificados Let's Encrypt ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Bash&amp;quot;&amp;gt;certbot --nginx&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Saving debug log to /var/log/letsencrypt/letsencrypt.log&lt;br /&gt;
&lt;br /&gt;
Which names would you like to activate HTTPS for?&lt;br /&gt;
We recommend selecting either all domains, or all domains in a VirtualHost/server block.&lt;br /&gt;
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -&lt;br /&gt;
1: ldap.culturetas.net&lt;br /&gt;
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -&lt;br /&gt;
Select the appropriate numbers separated by commas and/or spaces, or leave input&lt;br /&gt;
blank to select all options shown (Enter 'c' to cancel): 1&lt;br /&gt;
Requesting a certificate for ldap.culturetas.net&lt;br /&gt;
&lt;br /&gt;
Successfully received certificate.&lt;br /&gt;
Certificate is saved at: /etc/letsencrypt/live/ldap.culturetas.net/fullchain.pem&lt;br /&gt;
Key is saved at:         /etc/letsencrypt/live/ldap.culturetas.net/privkey.pem&lt;br /&gt;
This certificate expires on 2026-06-19.&lt;br /&gt;
These files will be updated when the certificate renews.&lt;br /&gt;
Certbot has set up a scheduled task to automatically renew this certificate in the background.&lt;br /&gt;
&lt;br /&gt;
Deploying certificate&lt;br /&gt;
Successfully deployed certificate for ldap.culturetas.net to /etc/nginx/sites-enabled/ldap.culturetas.net&lt;br /&gt;
Congratulations! You have successfully enabled HTTPS on https://ldap.culturetas.net&lt;br /&gt;
&lt;br /&gt;
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -&lt;br /&gt;
If you like Certbot, please consider supporting our work by:&lt;br /&gt;
 * Donating to ISRG / Let's Encrypt:   https://letsencrypt.org/donate&lt;br /&gt;
 * Donating to EFF:                    https://eff.org/donate-le&lt;br /&gt;
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Configurar Virtual Host para LDAP (para Stream) ===&lt;br /&gt;
* Añadir Virtual Host:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Bash&amp;quot;&amp;gt;sudo -i&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Bash&amp;quot;&amp;gt;vi /etc/nginx/stream-available/ldap.culturetas.net&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
########################&lt;br /&gt;
# STREAM REVERSE PROXY #&lt;br /&gt;
########################&lt;br /&gt;
&lt;br /&gt;
# Nginx Stream allow load balancer to TCP or UDP ports (no HTTP).&lt;br /&gt;
upstream ldap_backend {&lt;br /&gt;
	server 127.0.0.1:389 max_fails=3 fail_timeout=30s;&lt;br /&gt;
	# Opcional: High Availability&lt;br /&gt;
	# server 192.168.10.45:389 backup;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
server {&lt;br /&gt;
	# LDAPS port (636/tcp)&lt;br /&gt;
	listen 636 ssl;&lt;br /&gt;
&lt;br /&gt;
	# SSL/TLS Certificates&lt;br /&gt;
	ssl_certificate /etc/letsencrypt/live/ldap.culturetas.net/fullchain.pem;&lt;br /&gt;
	ssl_certificate_key /etc/letsencrypt/live/ldap.culturetas.net/privkey.pem;&lt;br /&gt;
&lt;br /&gt;
	# TLS Settings&lt;br /&gt;
	ssl_protocols TLSv1.2 TLSv1.3;&lt;br /&gt;
	ssl_ciphers ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256;&lt;br /&gt;
	ssl_prefer_server_ciphers on;&lt;br /&gt;
	ssl_session_cache shared:SSL:10m;&lt;br /&gt;
	ssl_session_timeout 10m;&lt;br /&gt;
	ssl_session_tickets off;&lt;br /&gt;
	&lt;br /&gt;
	# Forwarding to plain LDAP (LDAPS -&amp;gt; LDAP)&lt;br /&gt;
	proxy_pass ldap_backend;&lt;br /&gt;
&lt;br /&gt;
	# LDAP timeouts&lt;br /&gt;
	proxy_connect_timeout 5s;&lt;br /&gt;
	proxy_timeout 3m;&lt;br /&gt;
&lt;br /&gt;
	# Logging (stream format)&lt;br /&gt;
	access_log /var/log/nginx/ldaps.culturetas.net-access.log stream_format;&lt;br /&gt;
	error_log /var/log/nginx/ldaps.culturetas.net-error.log warn;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Activar Virtual Host:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Bash&amp;quot;&amp;gt;ln -s /etc/nginx/stream-available/ldap.culturetas.net /etc/nginx/stream-enabled/ldap.culturetas.net&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Bash&amp;quot;&amp;gt;systemctl reload nginx&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Habilitar LDAPS en FirewallD ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Bash&amp;quot;&amp;gt;firewall-cmd --permanent --zone=public --add-port=636/tcp&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Bash&amp;quot;&amp;gt;firewall-cmd --reload&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Crear carpetas para OpenLDAP ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Bash&amp;quot;&amp;gt;mkdir -p /opt/openldap/data&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Generar fichero Compose YAML  ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Bash&amp;quot;&amp;gt;vi /opt/openldap/compose.yaml&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
name: openldap&lt;br /&gt;
services:&lt;br /&gt;
    openldap:&lt;br /&gt;
        container_name: openldap&lt;br /&gt;
        hostname: ldap.culturetas.net&lt;br /&gt;
        restart: unless-stopped&lt;br /&gt;
        environment:&lt;br /&gt;
            - LDAP_INIT_ORG_DN=dc=culturetas,dc=net&lt;br /&gt;
            - LDAP_INIT_ORG_NAME=Culturetas SPQR&lt;br /&gt;
            - LDAP_INIT_ROOT_USER_DN=uid=admin,dc=culturetas,dc=net&lt;br /&gt;
            - LDAP_INIT_ROOT_USER_PW=CONTRASEÑA&lt;br /&gt;
            - LDAP_INIT_PPOLICY_PW_MIN_LENGTH=12&lt;br /&gt;
            - LDAP_INIT_ADMIN_GROUP_DN=cn=ldap-admins,ou=Groups,dc=culturetas,dc=net&lt;br /&gt;
            - LDAP_INIT_PASSWORD_RESET_GROUP_DN=cn=ldap-password-reset,ou=Groups,dc=culturetas,dc=net&lt;br /&gt;
            - LDAP_INIT_RFC2307BIS_SCHEMA=0&lt;br /&gt;
            - LDAP_INIT_ALLOW_CONFIG_ACCESS=true&lt;br /&gt;
            - LDAP_TLS_ENABLED=false&lt;br /&gt;
            - LDAP_LDAPS_ENABLED=false&lt;br /&gt;
        ports:&lt;br /&gt;
            - 127.0.0.1:389:389&lt;br /&gt;
        volumes:&lt;br /&gt;
            - /opt/openldap/data/var:/var/lib/ldap&lt;br /&gt;
            - /opt/openldap/data/etc:/etc/ldap/slapd.d&lt;br /&gt;
        image: vegardit/openldap:2.6.10&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Bash&amp;quot;&amp;gt;chmod 640 /opt/openldap/compose.yaml&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Arrancar OpenLDAP (manual)  ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Bash&amp;quot;&amp;gt;cd /opt/openldap&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Bash&amp;quot;&amp;gt;docker compose up -d&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Parar OpenLDAP (manual)  ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Bash&amp;quot;&amp;gt;cd /opt/openldap&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Bash&amp;quot;&amp;gt;docker compose down&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Arrancar OpenLDAP (con SystemD) ===&lt;br /&gt;
* Crear fichero SystemD&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Bash&amp;quot;&amp;gt;vi /etc/systemd/system/openldap.service&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Bash&amp;quot;&amp;gt;&lt;br /&gt;
[Unit]&lt;br /&gt;
Description=OpenLDAP (Docker Compose)&lt;br /&gt;
After=docker.service network-online.target&lt;br /&gt;
Requires=docker.service&lt;br /&gt;
Wants=network-online.target&lt;br /&gt;
&lt;br /&gt;
[Service]&lt;br /&gt;
Type=oneshot&lt;br /&gt;
RemainAfterExit=yes&lt;br /&gt;
WorkingDirectory=/opt/openldap&lt;br /&gt;
ExecStart=/usr/bin/docker compose up --detach --remove-orphans --quiet-pull&lt;br /&gt;
ExecStop=/usr/bin/docker compose down --remove-orphans --volumes --timeout 30&lt;br /&gt;
TimeoutStartSec=180&lt;br /&gt;
TimeoutStopSec=120&lt;br /&gt;
Restart=on-failure&lt;br /&gt;
RestartSec=7&lt;br /&gt;
&lt;br /&gt;
[Install]&lt;br /&gt;
WantedBy=multi-user.target&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Arrancar y habilitar&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Bash&amp;quot;&amp;gt;systemctl daemon-reload&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Bash&amp;quot;&amp;gt;systemctl start openldap&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Bash&amp;quot;&amp;gt;systemctl enabled openldap&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Referencias ==&lt;br /&gt;
* [https://hub.docker.com/r/vegardit/openldap https://hub.docker.com/r/vegardit/openldap]&lt;br /&gt;
* [https://github.com/vegardit/docker-openldap https://github.com/vegardit/docker-openldap]&lt;br /&gt;
* [https://directory.apache.org/studio/downloads.html https://directory.apache.org/studio/downloads.html]&lt;br /&gt;
&lt;br /&gt;
[[Categoría:Notas]]&lt;/div&gt;</summary>
		<author><name>Guzman</name></author>
	</entry>
</feed>