svn本地添加用户太麻烦了,如果公司有一百个开发人员要访问,要创建账号密码太麻烦了;所以让他们用AD域账号去登录就很方便,但是权限的管控还是在svn的本地添加(这个暂时还没办法很好的解决)
一、安装依赖包和模块包
1、域环境已经配置好的,域名example.com
2、安装本地依赖包和第三方包:
- #yum -y install openssl perl perl* pcre zlib tree gcc gcc-c++ make libtool pcre-devel lrzsz zlib-devel openssl-devel neon openldap-devel
- 安装apr
# tar zvxf apr-1.5.2.tar.gz
#cd apr-1.5.2
#./configure --prefix=/usr/local/apr
#make && make install
- 安装apr-util
#tar zxvf apr-util-1.5.4.tar.gz
#cd apr-util-1.5.4
#./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
#make && make install
#/usr/local/apr-util/bin/apu-1-config --version 检测apr-util是否安装成功
- 安装pcre
#tar zxvf pcre-8.35.tar.gz
#cd pcre-8.35
#./configure --prefix=/usr/local/pcre
#make && make install
- 安装openssl
#tar zvxf openssl-1.0.2c.tar.gz
#cd openssl-1.0.2c
#./config --prefix=/usr/local/openssl
#make && make install
- 安装sqlite
#tar zvxf sqlite-autoconf-3080500.tar.gz
#cd sqlite-autoconf-3080500
#./config
#make && make install
- 安装dap
#tar zvxf dap-3.9.tar.gz
#cd dap-3.9.tar.gz
#./configure
#make && make install
- 安装libtool
#tar zvxf libtool libtool-2.4.6.tar.gz
#cd libtool-2.4.6
#./configure
#make && make install
二、安装http
#tar zvxf httpd-2.4.6.tar.gz
#cp -rf ./apr-1.5.2 ./httpd-2.4.6/srclib/apr
#cp -rf ./apr-util-1.5.4 ./httpd-2.4.6/srclib/apr-util 需要apr和apr-utils并解压到 ./srclib/ 目录下, 再进行编译。
#cd httpd-2.4.6
#./configure --prefix=/usr/local/apache --enable-ldap=shared --enable-authnz-ldap=sahred --with-included-apr --with-ldap --with-apr --with-apr-util --enable-so --enable-dav --enable-rewrite=shared --enable-ssl=shared --enable-deflate=shared --enable-authn-dbm=shared --enable-authn-anon=shared --enable-auth-basic=shared --with-mpm=prefork --enable-cache --enable-file-cache --enable-mem-cache --enable-disk-cache
./configure --prefix=/usr/local/apache --enable-ldap --enable-authnz-ldap --with-included-apr --with-ldap --with-apr --with-apr-util --enable-so --enable-dav --enable-rewrite --enable-ssl --enable-deflate=shared --enable-authn-dbm --enable-authn-anon --enable-auth-basic --with-mpm=prefork --enable-cache --enable-file-cache --enable-mem-cache --enable-disk-cache
#make && make install
#ln -s /usr/local/apache /etc/httpd
#rmdir /etc/httpd/logs
#mkdir /var/log/httpd
#ln -s /var/log/httpd /etc/httpd/logs
#rm /etc/rc.d/init.d/http
#cp /usr/local/apache/bin/apachectl /etc/rc.d/init.d/httpd
#/etc/init.d/httpd start
#netstat -ntlp | grep httpd 查看http的端口是否开启
三、安装svn
#tar zvxf subversion-1.8.13.tar.gz
#cd subversion-1.8.10
# ./configure --prefix=/usr/local/subversion --with-apxs=/usr/local/apache/bin/apxs --with-apr=/usr/local/apache --with-apr-util=/usr/local/apache --with-zlib
#make && make install
#cd ~
#vim .bash_profile
#PATH=$PATH:$HOME/bin:/usr/local/subversion/bin
#source .bash_profile
#mkdir -p /var/www/svn
#svnadmin create /var/www/svn/repo1
#chown -R apache:apache /var/www/svn/repo1 增加一个站点
#vim /var/www/svn/repo1/conf/svnserve.conf 修改4个点
#vim /var/www/svn/repo1/conf/passwd 添加两个用户密码
#vim /var/www/svn/repo1/conf/authz 设置权限
#svnserve -d -r /var/www/svn/repo1
#ps aux | grep svn 查看是否正常启动
可以用svn客户端测试一下:
四、http和svn的合用
#cp /usr/local/subvesion/libexec/mod_authz_svn.so /usr/local/apache/modules/mod_authz_svn.so
#cp /usr/local/subvesion/libexec/mod_dav_svn.so /usr/local/apache/modules/mod_dav_svn.so
#vim /etc/httpd/conf/httpd.conf 添加修改以下项
#svnadmin create /var/www/svn/svntest
#cp /var/www/svn/svntest/conf/authz /var/www/svn/
#touch /var/www/svn/passwd
#htpasswd /var/www/svn/passwd svntest
#htpasswd /var/www/svn/passwd svnuser web登录密码设置
#vim /var/www/svn/authz 权限设置
#chown -R apache:apache /var/www/svn/svntest
#vim /etc/httpd/conf/httpd.conf http配置文件添加访问svn站点
登录网页测试一下 http://ip/svntest/svntest 第一个svntest是http配置文件的Location后面那个/svntest;第二个svntest才是svn服务器在本地create的站点
五、http、svn和AD域的合用
#cat /etc/hosts
#cat /etc/resolv.conf
#vim /etc/httpd/conf/httpd.conf
在域服务器上添加ou及用户
登录网页测试一下 http://ip/svntest/svntest ok啦!