[BEGIN] 2023/6/8 8:52:45
[root@localhost ~]# wget http://download.oracle.com/berkeley-db/db-5.1.29.tar.gz
--2023-06-07 20:53:03-- http://download.oracle.com/berkeley-db/db-5.1.29.tar.gz
Resolving download.oracle.com (download.oracle.com)... 104.91.72.85
Connecting to download.oracle.com (download.oracle.com)|104.91.72.85|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://download.oracle.com/berkeley-db/db-5.1.29.tar.gz [following]
--2023-06-07 20:53:05-- https://download.oracle.com/berkeley-db/db-5.1.29.tar.gz
Connecting to download.oracle.com (download.oracle.com)|104.91.72.85|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 32188074 (31M) [application/x-gzip]
Saving to: ‘db-5.1.29.tar.gz’
db-5.1.29.tar.gz 100%[=================================================================================================================================================================>] 30.70M 4.22MB/s in 9.2s
2023-06-07 20:53:15 (3.35 MB/s) - ‘db-5.1.29.tar.gz’ saved [32188074/32188074]
[root@localhost ~]# ls
anaconda-ks.cfg db-5.1.29.tar.gz initial-setup-ks.cfg
[root@localhost ~]# wget https://www.openldap.org/software/download/OpenLDAP/openldap-release/openldap-2.4.44.tgz
--2023-06-07 20:54:25-- https://www.openldap.org/software/download/OpenLDAP/openldap-release/openldap-2.4.44.tgz
Resolving www.openldap.org (www.openldap.org)... 45.79.47.170, 2600:3c00:e000:2d3::1
Connecting to www.openldap.org (www.openldap.org)|45.79.47.170|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 5658830 (5.4M) [application/octet-stream]
Saving to: ‘openldap-2.4.44.tgz’
openldap-2.4.44.tgz 100%[=================================================================================================================================================================>] 5.40M 1.42MB/s in 3.8s
2023-06-07 20:54:30 (1.42 MB/s) - ‘openldap-2.4.44.tgz’ saved [5658830/5658830]
[root@localhost ~]# ls
anaconda-ks.cfg db-5.1.29.tar.gz initial-setup-ks.cfg openldap-2.4.44.tgz
[root@localhost ~]# yum install *ltdl* -y
CentOS Linux 8 - AppStream 54 B/s | 38 B 00:00
Error: Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: No URLs in mirrorlist
[root@localhost ~]# ls
anaconda-ks.cfg db-5.1.29.tar.gz initial-setup-ks.cfg openldap-2.4.44.tgz
[root@localhost ~]# vim /etc/yum.repos.d/CentOS-Linux-AppStream.repo
[root@localhost ~]# vim /etc/yum.repos.d/CentOS-Linux-BaseOS.repo
[root@localhost ~]# vim /etc/yum.repos.d/CentOS-Linux-Extras.repo
[root@localhost ~]# vim /etc/yum.repos.d/CentOS-Linux-
CentOS-Linux-AppStream.repo CentOS-Linux-ContinuousRelease.repo CentOS-Linux-Devel.repo CentOS-Linux-FastTrack.repo CentOS-Linux-Media.repo CentOS-Linux-PowerTools.repo
CentOS-Linux-BaseOS.repo CentOS-Linux-Debuginfo.repo CentOS-Linux-Extras.repo CentOS-Linux-HighAvailability.repo CentOS-Linux-Plus.repo CentOS-Linux-Sources.repo
[root@localhost ~]# vim /etc/yum.repos.d/CentOS-Linux-ContinuousRelease.repo
[root@localhost ~]# vim /etc/yum.repos.d/CentOS-Linux-Debuginfo.repo
[root@localhost ~]# vim /etc/yum.repos.d/CentOS-Linux-Devel.repo
[root@localhost ~]# vim /etc/yum.repos.d/CentOS-Linux-FastTrack.repo
[root@localhost ~]# vim /etc/yum.repos.d/CentOS-Linux-HighAvailability.repo
[root@localhost ~]# vim /etc/yum.repos.d/CentOS-Linux-Media.repo
[root@localhost ~]# vim /etc/yum.repos.d/CentOS-Linux-Plus.repo
[root@localhost ~]# vim /etc/yum.repos.d/CentOS-Linux-PowerTools.repo
[root@localhost ~]# vim /etc/yum.repos.d/CentOS-Linux-Sources.repo
[root@localhost ~]# yum update
Is this ok [y/N]: y
Is this ok [y/N]: y
Is this ok [y/N]: y
[root@localhost ~]# yum install -y cyrus-sasl-*
[root@localhost ~]# tar -zxvf db-5.1.29.tar.gz
[root@localhost ~]# ls
anaconda-ks.cfg db-5.1.29 db-5.1.29.tar.gz initial-setup-ks.cfg openldap-2.4.44.tgz
[root@localhost ~]# cd db-5.1.29/
[root@localhost db-5.1.29]# ls
build_android build_unix build_vxworks build_wince build_windows dist docs examples lang LICENSE README src test util
[root@localhost db-5.1.29]# cd build_unix/
[root@localhost build_unix]# ls
[root@localhost build_unix]# ../dist/configure --prefix=/usr/local/berkeleydb-5.1.29
[root@localhost build_unix]# yum list | grep gcc
[root@localhost build_unix]# yum -y install gcc
[root@localhost build_unix]# ../dist/configure --prefix=/usr/local/berkeleydb-5.1.29
[root@localhost db-5.1.29]# ls
build_android build_unix build_vxworks build_wince build_windows dist docs examples lang LICENSE README src test util
[root@localhost db-5.1.29]# cd ../
[root@localhost ~]# ls
anaconda-ks.cfg db-5.1.29 db-5.1.29.tar.gz initial-setup-ks.cfg openldap-2.4.44.tgz
[root@localhost ~]# tar op
opA opc opd opr opt opu opx
[root@localhost ~]# tar -zxvf openldap-2.4.44.tgz
[root@localhost ~]# ls
anaconda-ks.cfg db-5.1.29 db-5.1.29.tar.gz initial-setup-ks.cfg openldap-2.4.44 openldap-2.4.44.tgz
[root@localhost ~]# cd openldap-2.4.44/
[root@localhost openldap-2.4.44]# ;ls
-bash: syntax error near unexpected token `;'
[root@localhost openldap-2.4.44]# ls
aclocal.m4 ANNOUNCEMENT build CHANGES clients configure configure.in contrib COPYRIGHT doc include INSTALL libraries LICENSE Makefile.in README servers tests
[root@localhost openldap-2.4.44]# ./configure --prefix=/usr/local/openldap-2.4.44 --enable-syslog --enable-modules --enable-debug --with-tls CPPFLAGS=-I/usr/local/berkeleydb-5.1.29/include/ LDFLAGS=-L/usr/local/berkeleydb-5.1.29/lib/
'
[root@localhost openldap-2.4.44]# cd cd /usr/local/openldap-2.4.44
-bash: cd: too many arguments
[root@localhost openldap-2.4.44]# cd /usr/local/openldap-2.4.44
[root@localhost openldap-2.4.44]# ln -s /usr/local/openldap-2.4.44/bin/* /usr/local/bin/
[root@localhost openldap-2.4.44]# ln -s /usr/local/openldap-2.4.44/sbin/* /usr/local/sbin/
[root@localhost openldap-2.4.44]# slappasswd
New password:
Re-enter new password:
{SSHA}Ys1AWOJ5TiUJWv32TPn7qkQxMbiP+8KA
[root@localhost openldap-2.4.44]# cd /usr/local/openldap-2.4.44/etc/openldap/
[root@localhost openldap]# ls
DB_CONFIG.example ldap.conf ldap.conf.default schema slapd.conf slapd.conf.default slapd.ldif slapd.ldif.default
[root@localhost openldap]# cp slapd.conf slapd.conf.20230608
[root@localhost openldap]# vim slapd.conf
[root@localhost openldap]# /usr/local/openldap-2.4.44/libexec/slapd
Segmentation fault (core dumped)
[root@localhost openldap]# /usr/local/openldap-2.4.44/libexec/slapd
Segmentation fault (core dumped)
[root@localhost openldap]# ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 30830
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files (-n) 1024
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimited
max user processes (-u) 30830
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
[root@localhost openldap]# ulimit -c 1024
[root@localhost openldap]# ulimit -a
core file size (blocks, -c) 1024
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 30830
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files (-n) 1024
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimited
max user processes (-u) 30830
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
[root@localhost openldap]# /usr/local/openldap-2.4.44/libexec/slapd
Segmentation fault (core dumped)
[root@localhost openldap]# ulimit -c unlimited
[root@localhost openldap]# ulimit -a
core file size (blocks, -c) unlimited
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 30830
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files (-n) 1024
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimited
max user processes (-u) 30830
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
[root@localhost openldap]# /usr/local/openldap-2.4.44/libexec/slapd
Segmentation fault (core dumped)
[root@localhost openldap]# ls
DB_CONFIG.example ldap.conf ldap.conf.default schema slapd.conf slapd.conf.20230608 slapd.conf.default slapd.ldif slapd.ldif.default
[root@localhost openldap]# usr/local/openldap-2.4.44/libexec/slapd -d 256
-bash: usr/local/openldap-2.4.44/libexec/slapd: No such file or directory
[root@localhost openldap]# /usr/local/openldap-2.4.44/libexec/slapd -d 256
64814ce5 @(#) $OpenLDAP: slapd 2.4.44 (Jun 7 2023 22:50:07) $
root@localhost.localdomain:/root/openldap-2.4.44/servers/slapd
64814ce5 could not stat config file "/usr/local/openldap-2.5.14/etc/openldap/schema/collective.schema": No such file or directory (2)
Segmentation fault (core dumped)
[root@localhost openldap]# ls
DB_CONFIG.example ldap.conf ldap.conf.default schema slapd.conf slapd.conf.20230608 slapd.conf.default slapd.ldif slapd.ldif.default
[root@localhost openldap]# cd schema/
[root@localhost schema]# ls
collective.ldif corba.ldif core.ldif cosine.ldif duaconf.ldif dyngroup.ldif inetorgperson.ldif java.ldif misc.ldif nis.ldif openldap.ldif pmi.ldif ppolicy.ldif README
collective.schema corba.schema core.schema cosine.schema duaconf.schema dyngroup.schema inetorgperson.schema java.schema misc.schema nis.schema openldap.schema pmi.schema ppolicy.schema
[root@localhost schema]# cd ..
[root@localhost openldap]# ls
DB_CONFIG.example ldap.conf ldap.conf.default schema slapd.conf slapd.conf.20230608 slapd.conf.default slapd.ldif slapd.ldif.default
[root@localhost openldap]# vim slapd.
[root@localhost openldap]# vim slapd.conf
[root@localhost openldap]# /usr/local/openldap-2.4.44/libexec/slapd -d 256
64814d8f @(#) $OpenLDAP: slapd 2.4.44 (Jun 7 2023 22:50:07) $
root@localhost.localdomain:/root/openldap-2.4.44/servers/slapd
64814d8f could not stat config file "/usr/local/openldap-2.5.14/etc/openldap/schema/collective.schema": No such file or directory (2)
Segmentation fault (core dumped)
[root@localhost openldap]# /usr/local/openldap-2.4.44/libexec/slapd
Segmentation fault (core dumped)
[root@localhost openldap]# ulimit -a
core file size (blocks, -c) unlimited
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 30830
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files (-n) 1024
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimited
max user processes (-u) 30830
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
[root@localhost openldap]# ll
total 36
-rw-------. 1 root root 845 Jun 7 22:56 DB_CONFIG.example
-rw-r--r--. 1 root root 245 Jun 7 22:56 ldap.conf
-rw-r--r--. 1 root root 245 Jun 7 22:56 ldap.conf.default
drwxr-xr-x. 2 root root 4096 Jun 7 22:56 schema
-rw-------. 1 root root 3223 Jun 7 23:30 slapd.conf
-rw-------. 1 root root 2204 Jun 7 23:28 slapd.conf.20230608
-rw-------. 1 root root 2204 Jun 7 22:56 slapd.conf.default
-rw-------. 1 root root 2731 Jun 7 22:56 slapd.ldif
-rw-------. 1 root root 2731 Jun 7 22:56 slapd.ldif.default
[root@localhost openldap]# ldapsearch -x -b '' -s base'(objectclass=*)'
ldap_sasl_bind(SIMPLE): Can't contact LDAP server (-1)
[root@localhost openldap]# ./configure --prefix=/usr/local/openldap-2.4.44 --enable-syslog --enable-modules --enable-debug --with-tls CPPFLAGS=-I/usr/local/berkeleydb-5.1.29/include/ LDFLAGS=-L/usr/local/berkeleydb-5.1.29/lib/
-bash: ./configure: No such file or directory
[root@localhost openldap]#
[root@localhost openldap]# cd /root/
[root@localhost ~]# ls
anaconda-ks.cfg db-5.1.29 db-5.1.29.tar.gz initial-setup-ks.cfg openldap-2.4.44 openldap-2.4.44.tgz
[root@localhost ~]# cd openldap-2.4.44/
[root@localhost openldap-2.4.44]# ls
aclocal.m4 ANNOUNCEMENT build CHANGES clients config.log config.status configure configure.in contrib COPYRIGHT doc include INSTALL libraries libtool LICENSE Makefile Makefile.in README servers stamp-h tests
[root@localhost openldap-2.4.44]# ./configure --prefix=/usr/local/openldap-2.4.44 --enable-syslog --enable-modules --enable-debug --with-tls CPPFLAGS=-I/usr/local/berkeleydb-5.1.29/include/ LDFLAGS=-L/usr/local/berkeleydb-5.1.29/lib/
[root@localhost openldap-2.4.44]# netstat -tunlp | grep 389
[root@localhost openldap-2.4.44]# netstat -lntp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 1/systemd
tcp 0 0 192.168.122.1:53 0.0.0.0:* LISTEN 2352/dnsmasq
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1595/sshd
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 1601/cupsd
tcp6 0 0 :::111 :::* LISTEN 1/systemd
tcp6 0 0 :::22 :::* LISTEN 1595/sshd
tcp6 0 0 ::1:631 :::* LISTEN 1601/cupsd
[root@localhost openldap-2.4.44]# yum install *ltdl* -y
Last metadata expiration check: 2:38:36 ago on Wed 07 Jun 2023 09:13:39 PM EDT.
Package libtool-ltdl-2.4.6-25.el8.x86_64 is already installed.
Package libtool-ltdl-devel-2.4.6-25.el8.x86_64 is already installed.
Dependencies resolved.
Nothing to do.
Complete!
[root@localhost openldap-2.4.44]# ls
aclocal.m4 ANNOUNCEMENT build CHANGES clients config.log config.status configure configure.in contrib COPYRIGHT doc include INSTALL libraries libtool LICENSE Makefile Makefile.in README servers stamp-h tests
[root@localhost openldap-2.4.44]# cd ..
[root@localhost ~]# ;s
-bash: syntax error near unexpected token `;'
[root@localhost ~]# ls
anaconda-ks.cfg db-5.1.29 db-5.1.29.tar.gz initial-setup-ks.cfg openldap-2.4.44 openldap-2.4.44.tgz
[root@localhost ~]# cd db-5.1.29/
[root@localhost db-5.1.29]# ls
build_android build_unix build_vxworks build_wince build_windows dist docs examples lang LICENSE README src test util
[root@localhost db-5.1.29]# cd build_unix/
[root@localhost build_unix]# ls
utop.o db_upg.o env_sig.o hash_reclaim.o log_archive.o mp_fopen.lo mut_tas.lo os_method.lo qam_autop.lo repmgr_method.lo sha1.lo
[root@localhost build_unix]# ../dist/configure --prefix=/usr/local/berkeleydb-5.1.29
[root@localhost build_unix]# ls
[root@localhost build_unix]# ../dist/configure --prefix=/usr/local/berkeleydb-5.1.29
[root@localhost build_unix]# make & make install
[root@localhost build_unix]# make test
make: *** No rule to make target 'test'. Stop.
[root@localhost build_unix]# ldconfig -v
[root@localhost build_unix]# cd ../
[root@localhost db-5.1.29]# ls
build_android build_unix build_vxworks build_wince build_windows dist docs examples lang LICENSE README src test util
[root@localhost db-5.1.29]# cd ..
[root@localhost ~]# ls
anaconda-ks.cfg db-5.1.29 db-5.1.29.tar.gz initial-setup-ks.cfg openldap-2.4.44 openldap-2.4.44.tgz
[root@localhost ~]# cd openldap-2.4.44/
[root@localhost openldap-2.4.44]# ls
aclocal.m4 ANNOUNCEMENT build CHANGES clients config.log config.status configure configure.in contrib COPYRIGHT doc include INSTALL libraries libtool LICENSE Makefile Makefile.in README servers stamp-h tests
[root@localhost openldap-2.4.44]# ./configure --prefix=/usr/local/openldap-2.4.44 --enable-syslog --enable-modules --enable-debug --enable-monitor --with-tls CPPFLAGS=-I/usr/local/berkeleydb-5.1.29/include/ LDFLAGS=-L/usr/local/berkeleydb-5.1.29/lib/
[root@localhost openldap-2.4.44]# make depend
[root@localhost openldap-2.4.44]# make
[root@localhost openldap-2.4.44]# cd /usr/local/openldap-2.4.44/etc/openldap/
[root@localhost openldap]# vim slapd.conf
[root@localhost openldap]# /usr/local/openldap-2.4.44/libexec/slapd
Segmentation fault (core dumped)
[root@localhost openldap]# /usr/local/openldap-2.4.44/libexec/slapd -d 256
64815388 @(#) $OpenLDAP: slapd 2.4.44 (Jun 7 2023 23:59:08) $
root@localhost.localdomain:/root/openldap-2.4.44/servers/slapd
64815388 could not stat config file "/usr/local/openldap-2.5.14/etc/openldap/schema/collective.schema": No such file or directory (2)
Segmentation fault (core dumped)
[root@localhost openldap]# vim slapd.conf
[root@localhost openldap]# /usr/local/openldap-2.4.44/libexec/slapd
Segmentation fault (core dumped)
[root@localhost openldap]# /usr/local/openldap-2.4.44/libexec/slapd -d 256
648153a7 @(#) $OpenLDAP: slapd 2.4.44 (Jun 7 2023 23:59:08) $
root@localhost.localdomain:/root/openldap-2.4.44/servers/slapd
648153a7 could not stat config file "/usr/local/openldap-2.5.14/etc/openldap/schema/corba.schema": No such file or directory (2)
Segmentation fault (core dumped)
[root@localhost openldap]# vim slapd.conf
[root@localhost openldap]# /usr/local/openldap-2.4.44/libexec/slapd
Segmentation fault (core dumped)
[root@localhost openldap]# /usr/local/openldap-2.4.44/libexec/slapd -d 256
648153bd @(#) $OpenLDAP: slapd 2.4.44 (Jun 7 2023 23:59:08) $
root@localhost.localdomain:/root/openldap-2.4.44/servers/slapd
648153bd could not stat config file "/usr/local/openldap-2.5.14/etc/openldap/schema/cosine.schema": No such file or directory (2)
Segmentation fault (core dumped)
[root@localhost openldap]# cd /usr/local/openldap-2.5.14/etc/openldap/schema/
-bash: cd: /usr/local/openldap-2.5.14/etc/openldap/schema/: No such file or directory
[root@localhost openldap]# cd schema
[root@localhost schema]# ls
collective.ldif corba.ldif core.ldif cosine.ldif duaconf.ldif dyngroup.ldif inetorgperson.ldif java.ldif misc.ldif nis.ldif openldap.ldif pmi.ldif ppolicy.ldif README
collective.schema corba.schema core.schema cosine.schema duaconf.schema dyngroup.schema inetorgperson.schema java.schema misc.schema nis.schema openldap.schema pmi.schema ppolicy.schema
[root@localhost schema]# cd ..
[root@localhost openldap]# ls
DB_CONFIG.example ldap.conf ldap.conf.default schema schema.234457 slapd.conf slapd.conf.20230608 slapd.conf.default slapd.ldif slapd.ldif.default
[root@localhost openldap]# pwd
/usr/local/openldap-2.4.44/etc/openldap
[root@localhost openldap]# ls
DB_CONFIG.example ldap.conf ldap.conf.default schema schema.234457 slapd.conf slapd.conf.20230608 slapd.conf.default slapd.ldif slapd.ldif.default
[root@localhost openldap]# vim slapd.conf
[root@localhost openldap]# /usr/local/openldap-2.4.44/libexec/slapd
[root@localhost openldap]# /usr/local/openldap-2.4.44/libexec/slapd -d 256
64815450 @(#) $OpenLDAP: slapd 2.4.44 (Jun 7 2023 23:59:08) $
root@localhost.localdomain:/root/openldap-2.4.44/servers/slapd
64815450 daemon: bind(7) failed errno=98 (Address already in use)
64815450 daemon: bind(7) failed errno=98 (Address already in use)
64815450 slapd stopped.
64815450 connections_destroy: nothing to destroy.
[root@localhost openldap]# netstat -lntp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 1/systemd
tcp 0 0 192.168.122.1:53 0.0.0.0:* LISTEN 2352/dnsmasq
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1595/sshd
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 1601/cupsd
tcp 0 0 0.0.0.0:389 0.0.0.0:* LISTEN 256433/slapd
tcp6 0 0 :::111 :::* LISTEN 1/systemd
tcp6 0 0 :::22 :::* LISTEN 1595/sshd
tcp6 0 0 ::1:631 :::* LISTEN 1601/cupsd
tcp6 0 0 :::389 :::* LISTEN 256433/slapd
[root@localhost openldap]#
Centos下安装OpenLdap
最新推荐文章于 2024-07-22 15:55:47 发布