ApacheDS 是一款由 Java 開發的 LDAP 伺服器,官方網站中有提供編譯完成的 .deb
或 .rpm
檔。
這邊我是直接使用獨立安裝的方式處理,以下是我自己的作法。
ApacheDS version: apacheds-2.0.0.AM26
OS: Debian 11
Java: JDK8
wget -O "/tmp/OpenJDK8U-jdk_x64_linux_hotspot_8u352b08.tar.gz" http://www.cs.tohoku-gakuin.ac.jp/pub/Tools/OpenJDK/JDK8-HotSpot/OpenJDK8U-jdk_x64_linux_hotspot_8u352b08.tar.gz
mkdir -p /usr/local/lib/jvm
tar -C /usr/local/lib/jvm -zxf /tmp/OpenJDK8U-jdk_x64_linux_hotspot_8u352b08.tar.gz
groupadd -g 800 apacheds
useradd -u 800 -g apacheds apacheds
chown -R apacheds:apacheds /opt/apacheds-2.0.0.AM26
wget -O "/tmp/apacheds.tar.gz" https://dlcdn.apache.org/directory/apacheds/dist/2.0.0.AM26/apacheds-2.0.0.AM26.tar.gz
sudo tar -C /opt/ -zxf /tmp/apacheds.tar.gz
sudo ln -s /opt/apacheds-2.0.0.AM26 /etc/apacheds
sudo tee /lib/systemd/system/apacheds.service<<EOF
[Unit]
Description=Apache Directory Server
After=network.target
[Service]
Type=forking
Environment=JAVA_HOME="/usr/local/lib/jvm/jdk8u352-b08"
Environment=JAVA_OPTS="-Djava.awt.headless=true -Xmx256m"
ExecStart=/bin/bash /etc/apacheds/bin/apacheds.sh start
User=apacheds
Group=apacheds
UMask=0007
RestartSec=10
Restart=always
[Install]
WantedBy=multi-user.target
EOF
systemctl daemon-reload
systemctl start apacheds
systemctl status apacheds
sudo /opt/apached/bin/apacheds.sh
netstat -tulpn | grep :10389
DS默認的dn(uid=admin,ou=system),密碼默認為 secret
ApacheDS、ApacheDirectoryStudio详解
2.2.5 - Generic Instance Layout