LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 5949|回复: 5

Debian下配置使用Subversion版本控制服务器

[复制链接]
发表于 2004-4-16 11:30:59 | 显示全部楼层 |阅读模式
三,我用的是Debian,怎么配置使用Subversion
就像大多数软件的安装和配置一样,Debian下面配置和使用Subversion也是非常的方便。现以使用apache2+mod_svn的方式加以说明。
假定条件:
我们将我们所有的项目都放在/var/lib/svn目录下,
我们要创建foo这个项目,
项目的使用人员有张三(zhangs)和李四(lis),
张三(zhangs)是领导,只负责审查审查(只读),不用修改,
李四(lis)是苦工,什么都要干(读写)。


1,首先当然是安装apache2和subversion。
[php]apt-get install libapache2-svn apache2-mpm-prefork subversion[/php]
(这儿选用apache2-mpm-prefork的理由是当前在Debian中只有这个版本可以使用php4)
2,创建一个项目
[php]svnadmin create /var/lib/svn/foo[/php]
因为我们是要由apache2来提供服务,所以将目录权限改成是apache2运行时用户www-data:
[php]chown www-data.www-data /var/lib/svn/foo -R[/php]
3,配置apache2
编辑/etc/apache2/mods-available/dav_svn.conf,使之如下:
[php]
# dav_svn.conf - Example Subversion/Apache configuration
#
# For details and further options see the Apache user manual.

# <Location URL> ... </Location>
# URL controls how the repository appears to the outside world.
# In this example clients access the repository as http://hostname/svn/repos
<Location /svn>

  # uncomment this to enable the repository
   DAV svn

  # set this to the path to your repository

   SVNParentPath /var/lib/svn
   SVNIndexXSLT "/svnindex.xsl"

  # The following allows for basic http authentication.  Basic authentication
  # should not be considered secure for any particularly rigorous definition of
  # secure.

  # to create a passwd file
  # # rm -f /etc/apache2/dav_svn.passwd
  # # htpasswd2 -c /etc/apache2/dav_svn.passwd dwhedon
  # New password:
  # Re-type new password:
  # Adding password for user dwhedon
  # #

  # Uncomment the following 3 lines to enable Basic Authentication
   AuthType Basic
   AuthName "Subversion Repository"
  # AuthLDAPEnabled on
  # AuthLDAPURL ldap://localhost/ou=Users,dc=sczfcpa,dc=com?uid?one
   AuthUserFile /etc/apache2/dav_svn.passwd
  

  # Uncomment the following line to enable Authz Authentication
   AuthzSVNAccessFile /etc/apache2/dav_svn.authz

  # Uncomment the following three lines allow anonymous read, but make
  # committers authenticate themselves

  # <LimitExcept GET PROPFIND OPTIONS REPORT>
    Require valid-user
  # </LimitExcept>

</Location>
[/php]

修改访问权限的配置文件/etc/apache2/dav_svn.authz(/etc/apache2/mods-available/dav_svn.conf指定的),使之如下:
[php]
[foo:/]
* =
zhangs = r
lis = rw[/php]

然后在添加用户到 /etc/apache2/dav_svn.passwd
[php]
htpasswd2 -c /etc/apache2/dav_svn.passwd zhangs
(输入密码)
htpasswd2 -c /etc/apache2/dav_svn.passwd lis
(输入密码)
[/php]

apache2的监听端口在 /etc/apache2/ports.conf 里面设置,我设置的81,这样可以不影响现有的apache 1.3

现在可以试试用 http://localhost:81/svn/foo 来访问了。

参考文档:
Subversion book 的中文翻译文档 http://freebsd.sinica.edu.tw/~plasma/svnbook ,感谢对岸的同胞为中文的贡献
subversion book 的英文文档 (暂时找不到了,安装subversion后在/usr/share/doc/subversion/book/book.html)
发表于 2004-4-16 11:38:59 | 显示全部楼层
removed
发表于 2004-6-28 20:32:37 | 显示全部楼层

英文版文档路径

http://svnbook.red-bean.com/svnbook/book.html

和翻译稿已经有较大并更了(Draft Revision 1411M->Revision 10061),哪位能更新一下翻译稿啊
发表于 2004-6-29 06:44:11 | 显示全部楼层

回复: 英文版文档路径

最初由 平和 发表
http://svnbook.red-bean.com/svnbook/book.html

和翻译稿已经有较大并更了(Draft Revision 1411M->Revision 10061),哪位能更新一下翻译稿啊

Please contact the original translator. Or do it by yourself.
发表于 2006-3-28 17:00:18 | 显示全部楼层
怎么方便的解决如下问题:
我的工作目录为abc,其下有若干子目录s_abc_1,s_abc_2,等等。由于项目需要,某次,我不但向abc中添加了N个文件,同时还向 s_abc_1,s_abc_2等许多子目录中添加了N多文件(包括文件夹),请告诉俺怎么才能用比较便利的方法把新添加了的文件and文件夹提交到 subversion的库里边?
回复 支持 反对

使用道具 举报

发表于 2006-5-26 17:09:27 | 显示全部楼层
修正一下
htpasswd2 -c /etc/apache2/dav_svn.passwd zhangs
(输入密码)
htpasswd2 -c /etc/apache2/dav_svn.passwd lis
(输入密码)
这是错误的 这样会把第一次创建的文件覆盖调的
应该这个
htpasswd2 -mc /etc/apache2/dav_svn.passwd zhangs第一次用户的时候
htpasswd2 -m /etc/apache2/dav_svn.passwd lis以后的用户
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表