OpenLDAP installation

本文提供了一套详细的步骤指南,指导如何通过rpm和源码安装OpenLDAP,包括依赖软件安装、配置及验证过程。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

最简单的安装方法rpm安装
 
  

# rpm -qa|grep openldap
openldap-debuginfo-2.4.23-32.el6_4.1.x86_64
openldap-2.4.23-32.el6_4.1.x86_64
compat-openldap-2.3.43-2.el6.x86_64
openldap-clients-2.4.23-32.el6_4.1.x86_64
openldap-servers-sql-2.4.23-32.el6_4.1.x86_64
openldap-servers-2.4.23-32.el6_4.1.x86_64
openldap-devel-2.4.23-32.el6_4.1.x86_64


以下是源码安装.
下载OpenLDAP的稳定版
 
  

# wget ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/openldap-2.4.39.tgz


安装依赖软件
为了全面兼容LDAPv3, 需要安装依赖软件, 这些软件的版本建议
1. TLS(Transport Layer Security) service 依赖包, OpenLDAP客户端和服务端都需要安装.
 
  

OpenSSL, GnuTLS, or MozNSS(三选一)
OpenSSL is available from http://www.openssl.org/
GnuTLS is available from http://www.gnu.org/software/gnutls/
Mozilla NSS is available from http://developer.mozilla.org/en/NSS.
安装openssl
# tar -zxvf openssl-1.0.1g.tar.gz
# cd openssl-1.0.1g
阅读INSTALL和README
# ./config --prefix=/usr/local --openssldir=/usr/local/ssl
# make
# make install


2. SASL(Simple Authentication and Security Layer) service  依赖包, OpenLDAP客户端和服务端都需要安装.
 
  

Cyrus SASL
安装sasl
# wget ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/cyrus-sasl-2.1.25.tar.gz
# tar -zxvf cyrus-sasl-2.1.25.tar.gz
# cd cyrus-sasl-2.1.25
阅读INSTALL和README
# ./configure
# make
# make install
********************************************************
* WARNING:
* Plugins are being installed into /usr/local/lib/sasl2,
* but the library will look for them in /usr/lib/sasl2.
* You need to make sure that the plugins will eventually
* be in /usr/lib/sasl2 -- the easiest way is to make a
* symbolic link from /usr/lib/sasl2 to /usr/local/lib/sasl2,
* but this may not be appropriate for your site, so this
* installation procedure won't do it for you.
*
* If you don't want to do this for some reason, you can
* set the location where the library will look for plugins
* by setting the environment variable SASL_PATH to the path
* the library should use.
********************************************************
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/opt/soft_bak/cyrus-sasl-2.1.25'
make[1]: Leaving directory `/opt/soft_bak/cyrus-sasl-2.1.25'
[root@db-172-16-3-150 cyrus-sasl-2.1.25]# ln -s /usr/local/lib/sasl2 /usr/lib/sasl2

sasl版本不对可能导致slapd启动失败, 见/var/log/messages
 
   

slapd[15107]: auxpropfunc error version mismatch with plug-in


3. Kerberos Authentication Service
 
  

Heimdal or MIT Kerberos V libraries(二选一)
Heimdal Kerberos is available from http://www.pdc.kth.se/heimdal/
MIT Kerberos is available from http://web.mit.edu/kerberos/www/.
安装MIT Kerberos V Libraries
# tar -xvf krb5-1.12.1-signed.tar 
# tar -zxvf krb5-1.12.1.tar.gz
# cd krb5-1.12.1
# cd src
# ./configure
# make
# make install


4. Database Software
 
  

OpenLDAP's slapd BDB and HDB primary database backends require Oracle Corporation Berkeley DB
下载
安装
# tar -zxvf db-6.0.30.tar.gz
# cd db-6.0.30
# cd dist/buildpkg
# cd build_unix
# ../dist/configure --prefix=/opt/bdb6 --enable-sql
# make
# make install


5. Threads
OpenLDAP supports POSIX pthreads, Mach CThreads, and a number of other varieties.

6. TCP Wrappers
slapd supports TCP Wrappers (IP level access control filters) if preinstalled.

7. 配置ld.so.conf
 
  

# vi /etc/ld.so.conf
include ld.so.conf.d/*.conf
/usr/local/lib
/usr/lib/sasl2
/opt/bdb6/lib
# ldconfig 


安装openldap
 
  

# tar -zxvf openldap-2.4.39.tgz
# cd openldap-2.4.39
# ./configure --help
# ./configure --prefix=/opt/openldap-2.4.39 --with-threads --with-tls --with-cyrus-sasl
# make depend
# make
# make install
# export MANPATH=/opt/openldap-2.4.39/share/man:$MANPATH
# export MANPATH=/opt/openldap-2.4.39/bin:/opt/openldap-2.4.39/sbin:$PATH


[参考]
1.  http://www.openldap.org/doc/admin24/index.html
14. 配置源码时支持的环境变量
VariableDescription
CCSpecify alternative C Compiler
CFLAGSSpecify additional compiler flags
CPPFLAGSSpecify C Preprocessor flags
LDFLAGSSpecify linker flags
LIBSSpecify additional libraries

cd /mnt mkdir -p iso cdrom mount -o loop /mnt/iso/*.iso /mnt/cdrom cd /etc/yum.repos.d/ mv openEuler.repo openEuler.repo.bak vi local.repo [openEuler] name=openEuler baseurl=file:///mnt/cdrom enabled=1 gpgcheck=1 gpgkey=file:///mnt/cdrom/RPM-GPG-KEY-openEuler yum clean all yum makecache yum install -y java-1.8.0* yum install -y python3 hostnamectl set-hostname ogserver echo "192.168.1.15 ogserver" >>/etc/hosts systemctl stop firewalld.service systemctl disable firewalld.service sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config setenforce 0 echo "transparent_hugepage=never" >> /etc/default/grub grub2-mkconfig -o /boot/grub2/grub.cfg echo "RemoveIPC=no" >> /etc/systemd/logind.conf echo "RemoveIPC=no" >> /usr/lib/systemd/system/systemd-logind.service systemctl daemon-reload systemctl stop systemd-logind systemctl start systemd-logind vi /etc/sysctl.conf net.ipv4.tcp_max_tw_buckets=10000 net.ipv4.tcp_tw_reuse = 1 #net.ipv4.tcp_tw_recycle = 1 net.ipv4.tcp_keepalive_probes=9 net.ipv4.tcp_keepalive_intvl=30 net.ipv4.tcp_retries1 = 5 net.ipv4.tcp_syn_retries = 5 net.ipv4.tcp_synack_retries = 5 net.ipv4.tcp_retries2 = 12 net.ipv4.tcp_rmem = 8192 250000 16777216 vm.overcommit_memory = 0 net.ipv4.tcp_wmem = 8192 250000 16777216 net.core.wmem_max = 21299200 net.core.rmem_max = 21299200 net.core.wmem_default = 21299200 net.core.rmem_default = 21299200 net.ipv4.tcp_syncookies = 1 net.ipv4.tcp_sack = 1 net.ipv4.tcp_timestamps = 1 fs.aio-max-nr=1048576 fs.file-max= 76724600 kernel.sem = 4096 2048000 32 32768 kernel.shmall = 1048576 kernel.shmmax = 4294967296 kernel.shmmni = 8192 net.core.netdev_max_backlog = 65535 net.core.somaxconn = 65535 net.ipv4.tcp_fin_timeout = 60 vm.swappiness = 0 net.ipv4.ip_local_port_range = 26000 65535 fs.nr_open = 20480000 sysctl -p groupadd -g 1000 dbgrp useradd -u 1000 omm -g dbgrp echo "Omm@1000" | passwd omm --stdin mkdir -p /data/{openGauss,backup,archive_wals,core_pattern} chmod 700 /data/{openGauss,backup,archive_wals,core_pattern} chown -R omm:dbgrp /data/{openGauss,backup,archive_wals,core_pattern} mkdir -p /opt/openGauss chown omm:dbgrp -R /opt/openGauss/ chmod 755 /opt/openGauss/ vi /etc/security/limits.conf omm soft nproc unlimited omm hard nproc unlimited omm soft nofile 102400 omm hard nofile 102400 omm soft stack unlimited omm hard stack unlimited omm soft core unlimited omm hard core unlimited omm soft memlock unlimited echo "/data/core_pattern/core-%e-%p-%t" > /proc/sys/kernel/core_pattern yum install -y zlib-devel libaio libuuid readline-devel krb5-libs yum install -y libicu libxslt tcl perl openldap pam openssl-devel libxml2 python3 将以上代码生成linux可以执行的shell文件
最新发布
06-13
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值