Author:xiaoxiaosanlang
Centos7 集成安装SVN并集成windows AD
yum -y install autoconf automake libtool bzip2
1.系统版本
Centos Linux release7.5.1804(Core)
2.安装
2.1安装ldap:
wget ftp://gd.tuwien.ac.at/infosys/network/OpenLDAP/openldap-release/openldap-2.4.44.tgz
tar -zxv -f openldap-2.4.44.tgz
cd openldap-2.4.44/
./configure --prefix=/usr/local/ldap --disable-slapd
#--disable-slapd === 不需要ldap服务器 只需要lib include
make
make install
2.2安装apr:
wget http://apache.fayea.com//apr/apr-1.5.2.tar.bz2 tar -jxv -f apr-1.5.2.tar.bz2 cd apr-1.5.2/ ./configure --prefix=/usr/local/apr
make
make install
2.3安装apr-utils
wget http://apache.fayea.com//apr/apr-util-1.5.4.tar.bz2
tar -jxv -f apr-util-1.5.4.tar.bz2
cd apr-util-1.5.4/
./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr/bin/apr-1-config --with-ldap=ldap --with-ldap-include=/usr/local/ldap/include --with-ldap-lib=/usr/local/ldap/lib
#apr-util需要带上ldap功能
make
make install
2.4 安装pcre
wget https://ftp.pcre.org/pub/pcre/pcre-8.40.tar.bz2
tar -jxv -f pcre-8.40.tar.bz2
cd pcre-8.40/
./configure --prefix=/usr/local/pcre
make
make install
2.5 安装apache
wget http://mirrors.tuna.tsinghua.edu.cn/apache//httpd/httpd-2.4.25.tar.bz2
tar -jxv -f httpd-2.4.25.tar.bz2
cd httpd-2.4.25/
./configure --prefix=/usr/local/httpd --with-apr=/usr/local/apr/bin/apr-1-config --with-apr-util=/usr/local/apr-util/bin/apu-1-config --with-pcre=/usr/local/pcre/bin/pcre-config --enable-module=mod_auth_basic --enable-module=mod_authnz_ldap --enable-module=mod_dav --enable-module=mod_dav_fs --enable-module=mod_dav_lock --enable-module=mod_authn_file --enable-module=mod_authz_user --enable-ldap --enable-authnz-ldap --enable-module=mod_ldap
make
make install
2.6将httpd加入服务
cp /usr/local/httpd/bin/apachectl /etc/init.d/httpd
2.7安装sqlite
wget http://www.sqlite.org/2017/sqlite-autoconf-3160200.tar.gz
tar -zxv -f sqlite-autoconf-3160200.tar.gz
cd sqlite-autoconf-3160200/
./configure --prefix=/usr/local/sqlite
make
make install
2.8安装zlib
wget http://www.zlib.net/zlib-1.2.11.tar.gz
tar -zxv -f zlib-1.2.11.tar.gz
cd zlib-1.2.11/
./configure --prefix=/usr/local/zlib
make
make install
2.9安装scons
wget http://prdownloads.sourceforge.net/scons/scons-2.5.1-1.noarch.rpm
rpm -ivh scons-2.5.1-1.noarch.rpm
安装 openssl-devel ==> serf:
如果在serf安装时 如果报错:
compilation terminated.
scons: *** [buckets/ssl_buckets.o] Error 1
scons: building terminated because of errors.
yum install openssl-devel
2.10安装serf
wget https://www.apache.org/dist/serf/serf-1.3.9.tar.bz2
tar -jxv -f serf-1.3.9.tar.bz2
cd serf-1.3.9/
scons PREFIX=/usr/local/serf APR=/usr/local/apr/bin/apr-1-config APU=/usr/local/apr-util/bin/apu-1-config (此为一行)
scons install
2.11安装svn
wget http://mirrors.cnnic.cn/apache/subversion/subversion-1.9.5.tar.bz2
tar -jxv -f subversion-1.9.5.tar.bz2
cd subversion-1.9.5/
./configure --prefix=/usr/local/subversion --with-apr=/usr/local/apr/bin/apr-1-config --with-apr-util=/usr/local/apr-util/bin/apu-1-config --with-apxs=/usr/local/httpd/bin/apxs --with-sqlite=/usr/local/sqlite --with-zlib=/usr/local/zlib --with-serf=/usr/local/serf
make
make install
2.12如果使用./svn命令出现错误
svn: error while loading shared libraries: libserf-1.so.1: cannot open shared object file: No such file or directory 解决:把serf安装后的 libserf-1.so.1.3.0 复制到svn的安装目录下的lib目录(直接复制libserf-1.so 会出现 链接已断的错误属性 没有用)
/usr/local/subversion/bin/svn --version
cp /usr/local/serf/lib/libserf-1.so.1.3.0 /usr/local/subversion/lib/libserf-1.so.1
2.13将svn目录下的几个模块复制到apache下,支持ladp功能
cp /usr/local/subversion/libexec/mod_authz_svn.so /usr/local/httpd/modules/mod_authz_svn.so
cp /usr/local/subversion/libexec/mod_dav_svn.so /usr/local/httpd/modules/mod_dav_svn.so
2.14 httpd.conf配置
cd /usr/local/httpd/conf
vim httpd.conf #放在httpd.conf 追加进去就行
LoadModule dav_module modules/mod_dav.so
LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so
LoadModule ldap_module modules/mod_ldap.so
LoadModule authnz_ldap_module modules/mod_authnz_ldap.so
LoadModule auth_basic_module modules/mod_auth_basic.so
LoadModule authn_file_module modules/mod_authn_file.so
LoadModule authz_user_module moduels/mod_authz_user.so
<Location /svnroot>
DAV svn
SVNParentPath /opt/svnroot
Require valid-user
AuthType Basic
AuthName "SVN-ad"
AuthBasicProvider ldap
AuthLDAPURL "ldap://10.10.2.88 /dc=tt,dc=abc,dc=com?samaccountName?sub?(objectClass=*)"
AuthLDAPBindDN "administrator"
AuthLDAPBindPassword "abcd"
AuthzSVNAccessFile /etc/subversion/authz.conf
</Location>
2.15启动httpd服务
/etc/init.d/httpd start
2.16.赋予相应目录用户权限
2.17 备注
浏览器访问路径
http://10.10.1.183/svnroot/security/
TortoiseSVN访问
svn checkout
http://10.10.1.183/svnroot/security/
原文地址:http://blog.51cto.com/wsxxsl/2133016