第一,根据BLFS BOOK安装好Subversion-1.1.4,配置选项用了 --prefix=/usr --with-apr=/usr --with-apr-util=/usr --with-apxs=/usr/sbin/apxs --with-ssl 编译安装很顺利,但发现install后没有所说的~/.subversion/config and /etc/subversion/config 什么的 第二,配制本地访问的svn 完全按照BOOK来的,启动也是利用xinetd启动 1,建立svn组何用户,建立svntest组,把svn用户置入svstest组 groupadd -g 56 svn && useradd -c "SVN Owner" -d /home/svn -m -g svn -s /bin/false -u 56 svn groupadd -g 57 svntest && usermod -G svntest svn 设置用svn何svnserve的时候的mask为022 mv /usr/bin/svn /usr/bin/svn.orig && mv /usr/bin/svnserve /usr/bin/svnserve.orig && cat >> /usr/bin/svn << "EOF" #!/bin/sh umask 002 /usr/bin/svn.orig "$@" EOF cat >> /usr/bin/svnserve << "EOF" #!/bin/sh umask 002 /usr/bin/svnserve.orig "$@" EOF chmod 0755 /usr/bin/svn{,serve} 2,创建仓库 install -d -m0755 /srv && install -d -m0755 -o svn -g svn /srv/svn/repositories && svnadmin create --fs-type fsfs /srv/svn/repositories/svntest 然后我在我的/usr/local下通过mkdir建立一下目录结构 svntest/ # The name of the repository trunk/ # Contains the existing source tree BOOK/ bootscripts/ edguide/ patches/ scripts/ branches/ # Needed for additional branches tags/ # Needed for tagging release points 再初始画导入 svn import -m "Ininial import." /usr/local/svntest file:///srv/svn/repositories/svntest 再把仓库的属主信息改成svn:svntest的 chown -R svn:svntest /srv/svn/repositories/svntest && chmod -R g+w /srv/svn/repositories/svntest && chmod g+s /srv/svn/repositories/svntest/db && usermod -G svn,svntest,[insert existing groups] [username] 其中还可以添加其他没有特权的但也想让其分享仓库的用户和组, 然后就可以通过以下命令查看svn的仓库了 svnlook tree /srv/svn/repositories/svntest/ 3,配制服务器 先备份该仓库的服务器配置文件,在相应conf目录下 cp /srv/svn/repositories/svntest/conf/svnserve.conf /srv/svn/repositories/svntest/conf/svnserve.conf.default 再建立svnserve.conf cat > /srv/svn/repositories/svntest/conf/svnserve.conf << "EOF" [general] anon-access = read auth-access = write EOF 4,利用xinetd启动svn服务器 只要在/etc/xinetd.d/下建立svn cat >> /etc/xinetd.d/svn << "EOF" # Begin /etc/xinetd.d/svn service svn { port = 3690 socket_type = stream protocol = tcp wait = no user = svn server = /usr/bin/svnserve server_args = -i -r /srv/svn/repositories } # End /etc/xinetd.d/svn EOF 再重启xinetd服务 /etc/rc.d/init.d/xinetd restart 另外我拷贝blfs启动脚本中的svn到init.d目录下 此时,随便到哪个目录下,运行 svn checkout file://localhost/srv/svn/repositories/svntest 就可以完全checkout 捡出svntest了 配置能用http访问,及与apache整合 1,检查Httpd.conf中已经有了 LoadModule dav_svn_module lib/apache/mod_dav_svn.so LoadModule authz_svn_module lib/apache/mod_authz_svn.so 2,匿名访问的配置,同样是在Httpd.conf中添加 <Location /svn> DAV svn SVNPath /srv/svn/repositories/svntest </Location> 信息,这样就可以通过http://192.168.0.3/svn/访问,测试通过,:) 另外当有多个仓库时,httpd.conf中可以通过设置 SVNParentPath 值设置 3,通过htpasswd的方式来进行用户访问的验证,添加两个用户,放在/etc/svn-auth-file 文件中 htpasswd -c /etc/svn-auth-file harry htpasswd /etc/svn-auth-file sally 再在刚才的httpd.conf的Location信息中添加认证信息,如下 <Location /svn> DAV svn SVNPath /srv/svn/repositories/svntest AuthType Basic AuthName "Subversion repository" AuthUserFile /etc/svn-auth-file Require valid-user </Location> 测试成功,:) 另外,我通过终端里 svn checkout http://localhost/svn 先输入root的命令,在输入用户名密码,也可以checkout,这里为什么要输入root的密码了?我还是很多不懂啊 http://www.360doc.com/showWeb/0/0/200256.aspx文章提到了仓库中conf目录下的authz和passwd文件的详细含义和用法,很不错,只是我不怎么好试验 06-11-05: 想试验让我的DAV svn通过学校的ldap服务器认证,检查了一下我的配置和club的配置,我的没有Load进来mod_auth_ldap.so,我检查我的没有安装这个模块, 通过scp从club上拷贝回来,但还是不行,提示找不到libexpat.so.1,看来要让apache支持得重新编译apache才行。 查看了apache2.2的中文手册,原来此模块必须在2.1后的版本才支持,我的才2.0.54,差那么一点点哦 |
|