samab安装准备
https://www.samba.org/samba/download/
https://www.cnblogs.com/mrcoolfuyu/p/11846349.html
subscription-manager repos --enable rhel-*-optional-rpms \
--enable rhel-*-extras-rpms \
--enable rhel-ha-for-rhel-*-server-rpms
yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
yum install attr bind-utils docbook-style-xsl gcc gdb krb5-workstation \
libsemanage-python libxslt perl perl-ExtUtils-MakeMaker \
perl-Parse-Yapp perl-Test-Base pkgconfig policycoreutils-python \
python2-crypto libattr-devel keyutils-libs-devel \
libacl-devel libaio-devel libblkid-devel libxml2-devel openldap-devel \
pam-devel popt-devel python-devel readline-devel zlib-devel systemd-devel \
lmdb-devel jansson-devel gpgme-devel pygpgme libarchive-devel
不要安装 gnutls-devel
Samba Domain Member
yum install autoconf automake gcc gdb krb5-devel krb5-workstation \
openldap-devel make pam-devel python-devel docbook-style-xsl \
libacl-devel libattr-devel libxslt
安装samba
samba_soft]# tar zxf samba-4.17.2.tar.gz
samba-4.17.2]# ./configure
/usr/bin/env: python3: No such file or directory
samba-4.17.2]# yum install python3
Installing:
python3 x86_64 3.6.8-18.el7 rhel-7-server-rpms 70 k
Installing for dependencies:
python3-libs x86_64 3.6.8-18.el7 rhel-7-server-rpms 6.9 M
python3-pip noarch 9.0.3-8.el7 rhel-7-server-rpms 1.6 M
python3-setuptools noarch 39.2.0-10.el7 rhel-7-server-rpms 629 k
samba-4.17.2]# ./configure
Distutils not installed? Broken python installation? Get python-config now!
samba-4.17.2]# yum install python3-devel python36-devel python3-dev
Installing:
python3-devel x86_64 3.6.8-18.el7 rhel-7-server-optional-rpms 217 k
Installing for dependencies:
dwz x86_64 0.11-3.el7 rhel-7-server-rpms 99 k
perl-srpm-macros noarch 1-8.el7 rhel-7-server-rpms 4.7 k
python3-rpm-generators noarch 6-2.el7 rhel-7-server-rpms 20 k
python3-rpm-macros noarch 3-34.el7 rhel-7-server-rpms 8.1 k
redhat-rpm-config noarch 9.1.0-88.el7 rhel-7-server-rpms 81 k
samba-4.17.2]# ./configure
Checking for getrandom : not found
Checking for GnuTLS >= 3.7.2 : not found
samba_soft]# tar xf gnutls-3.6.16.tar.xz
gnutls-3.6.16]# ./configure
configure: error:
***
*** Libnettle 3.4.1 was not found.
安装gmp
samba_soft]# yum install lzip
samba_soft]# lzip -d gmp-6.2.1.tar.lz
samba_soft]# tar xf gmp-6.2.1.tar
gmp-6.2.1]# ./configure
gmp-6.2.1]# make
gmp-6.2.1]# make check
gmp-6.2.1]# make install
Libraries have been installed in:
/usr/local/lib
配置环境变量
gmp-6.2.1]# vim ~/.bashrc
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
source ~/.bashrc
安装pkg-config
samba_soft]# tar xf pkg-config-0.29.2.tar.gz
pkg-config-0.29.2]# ./configure
configure: error: Either a previously installed pkg-config or "glib-2.0 >= 2.16" could not be found.
Please set GLIB_CFLAGS and GLIB_LIBS to the correct values or
pass --with-internal-glib to configure to use the bundled copy.
pkg-config-0.29.2]# ./configure --with-internal-glib
pkg-config-0.29.2]# make
pkg-config-0.29.2]# make check
pkg-config-0.29.2]# make install
pkg-config-0.29.2]# pkg-config --version
0.29.2
samba_soft]# tar zxf nettle-3.4.1.tar.gz
编译nettle时一定要确保已经安装了libgmp-dev,不然没有libhogweed,编译gnutls一样会报错
gnutls编译的时候使用了pkg-config,没有安装安装就会导致调用出错。安装完pkg-config再编译。
还有就是gnutls编译的时候没有正确的找到nettle的库。
使用如下命令指定正确的nettle库即可:
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH
nettle-3.4.1]# ./configure
nettle-3.4.1]#make
note: use option -std=c99 or -std=gnu99 to compile your code
make[1]: *** [rsa-sign-tr.o] Error 1
make[1]: Leaving directory `/samba_soft/nettle-3.4.1'
make: *** [all] Error 2
使用3.5.1
nettle-3.5.1]# ./configure
nettle-3.5.1]# make
没有报错
nettle-3.5.1]# make check
nettle-3.5.1]# make install
安装gnutls
gnutls-3.6.16]# ./configure
configure: error:
***
*** Libnettle 3.4.1 was not found.
gnutls-3.6.16]# export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH
不好使
方法1
nettle这货安装的时候,自己安装到了/usr/local/lib目录下了。gnutls安装时默认会到系统目录下/usr/lib下寻找依赖关系。
软件路径瞎按,系统依赖瞎找是问题的形成原因。
安装nettle时,通过--prefix参数指定安装路径为/usr
nettle-3.5.1]# ./configure --prefix=/usr/
nettle-5.4.1]# make
nettle-3.5.1]# make check
nettle-3.5.1]# make install
PKG_CONFIG_PATH=/usr/local/lib64/pkgconfig:/usr/lib64/pkgconfig:/usr/local/lib/pkgconfig:/usr/lib/pkgconfig
gnutls-3.6.16]# ./configure
configure: error:
***
*** Libtasn1 4.9 was not found. To use the included one, use --with-included-libtasn1
gnutls-3.6.16]# ./configure --with-included-libtasn1
configure: error:
***
*** Libunistring was not found. To use the included one, use --with-included-unistring
gnutls-3.6.16]# ./configure --with-included-libtasn1 --with-included-unistring
checking for P11_KIT... no
configure: error:
***
*** p11-kit >= 0.23.1 was not found. To disable PKCS #11 support
*** use --without-p11-kit, otherwise you may get p11-kit from
*** https://p11-glue.freedesktop.org/p11-kit.html
gnutls-3.6.16]# ./configure --with-included-libtasn1 --with-included-unistring --without-p11-kit
过了
gnutls-3.6.16]# make
gnutls-3.6.16]# make check
gnutls-3.6.16]# make install
samba-4.17.2]# ./configure
gnutls-3.7.3]# ./configure
configure: error:
***
*** Libnettle 3.6 was not found.
nettle-3.8]# ./configure
nettle-3.8]# make
nettle-3.8]# make check
nettle-3.8]# make install
#export PKG_CONFIG_PATH=/usr/local/lib64/pkgconfig:/usr/lib64/pkgconfig:/usr/local/lib/pkgconfig:/usr/lib/pkgconfig
# PKG_CONFIG_PATH=/usr/local/lib64/pkgconfig/
gnutls-3.7.3]# ./configure --with-included-libtasn1 --with-included-unistring --without-p11-kit
gnutls-3.7.3]# make
gnutls-3.7.3]# make check
很慢
gnutls-3.7.3]# make install
samba-4.17.2]# ./configure
Checking for getrandom : not found
Checking for GnuTLS >= 3.7.2 : yes
Checking for gnutls_pkcs7_get_embedded_data_oid in gnutls : ok
Checking for gnutls_set_default_priority_append in gnutls : ok
Checking for gnutls_pbkdf2 in gnutls : ok
Checking for gnutls_aead_cipher_encryptv2 in gnutls : ok
Checking for gnutls fips mode support : not found
Checking for header gnutls/gnutls.h : yes
Checking value of GNUTLS_CIPHER_AES_128_CFB8 : 29
Checking value of GNUTLS_MAC_AES_CMAC_128 : 203
Checking for 'zlib' : not found
yum install zlib
zlib x86_64 1.2.7-20.el7_9 rhel-7-server-rpms 90 k
yum install zlib-devel
samba-4.17.2]# ./configure
Checking for bison
Checking for program 'bison' : not found
The MIT Kerberos build of Samba as an AD DC is experimental. Therefore --with-system-mitkrb5 requires either --with-experimental-mit-ad-dc or --without-ad-dc
samba-4.17.2]# yum install bison
samba-4.17.2]# yum install flex
flex x86_64 2.5.37-6.el7 rhel-7-server-rpms 293 k
Checking for dbus : not found
vfs_snapper is enabled but prerequisite dbus-1 package not found. Use --with-shared-modules='!vfs_snapper' to disable vfs_snapper support.
(complete log in /samba_soft/samba-4.17.2/bin/config.log)
samba-4.17.2]# ./configure --with-shared-modules='!vfs_snapper'
Checking for system installation of Python module markdown : not found
Unable to find Python module 'markdown'. Please install the system package: python3-markdown'.
samba-4.17.2]# yum install python3-markdown
No package python3-markdown available.
samba-4.17.2]# ./configure --without-ad-dc --with-shared-modules='!vfs_snapper'
可以
samba-4.17.2]# make
Can't locate JSON.pm in @INC (
Waf: Leaving directory `/samba_soft/samba-4.17.2/bin/default'
Build failed
-> task in '../heimdal/lib/asn1/der-protos.h' failed with exit status 2 (run with -v to display more information)
make: *** [all] Error 1
samba-4.17.2]# yum install json
不好使
JSON-2.90]# perl Makefile.PL
JSON-2.90]# make && make install
好使
samba-4.17.2]# make && make install