博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
文件服务器 之 Debian下配置使用Subversion版本控制服务器
阅读量:7077 次
发布时间:2019-06-28

本文共 2504 字,大约阅读时间需要 8 分钟。

作者: achaoge

来自:www.linuxsir.org
摘要:就像大多数软件的安装和配置一样,Debian下面配置和使用Subversion也是非常的方便。现以使用apache2+mod_svn的方式加以说明。

假定条件:

我们将我们所有的项目都放在/var/lib/svn目录下,
我们要创建foo这个项目,
项目的使用人员有张三(zhangs)和李四(lis),
张三(zhangs)是领导,只负责审查审查(只读),不用修改,
李四(lis)是苦工,什么都要干(读写)。

1,首先当然是安装apache2和subversion。

apt-get install libapache2-svn apache2-mpm-prefork subversion

(这儿选用apache2-mpm-prefork的理由是当前在Debian中只有这个版本可以使用php4)

2,创建一个项目

svnadmin create /var/lib/svn/foo

因为我们是要由apache2来提供服务,所以将目录权限改成是apache2运行时用户www-data:

chown www-data.www-data /var/lib/svn/foo -R

3,配置apache2

编辑/etc/apache2/mods-available/dav_svn.conf,使之如下:

# 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>

修改访问权限的配置文件/etc/apache2/dav_svn.authz(/etc/apache2/mods-available/dav_svn.conf指定的),使之如下:

[foo:/]
* =
zhangs = r
lis = rw

然后在添加用户到 /etc/apache2/dav_svn.passwd

htpasswd2 -c /etc/apache2/dav_svn.passwd zhangs
(输入密码)
htpasswd2 -c /etc/apache2/dav_svn.passwd lis
(输入密码)

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)

转载地址:http://kkcml.baihongyu.com/

你可能感兴趣的文章
2017GAITC丨朱小燕:人机对话能直接能减少90%人工,极大提升效率
查看>>
《Spring Boot官方指南》翻译邀请
查看>>
在 CentOS 和 RHEL 上安装 Puppet 服务器和客户端
查看>>
《Raspberry Pi用户指南》——1.2 Windows vs. Linux
查看>>
大数据与机器学习:实践方法与行业案例.3.2 自动加载的流程
查看>>
资讯APP走出同质化怪圈,精细化用户画像成契机
查看>>
JDK11 | 第七篇 : ZGC 垃圾收集器
查看>>
对软键盘回车键检测
查看>>
入门Java一年进阿里,分享我学Java的那些思考!
查看>>
ida 常用操作&快捷键--待续
查看>>
Android MediaPlayer 播放铃声setDataSource异常
查看>>
Token登录认证
查看>>
波音737 MAX全球禁飞,外墙清洗行业安全同样不容小觑
查看>>
魔窗mLink发布2019收费标准,20W年费是物有所值?还是重度收费?
查看>>
新版pyecharts,Python可视化so easy and powerful !
查看>>
小程序国际化实现方式
查看>>
Node.js学习之(第二章:http模块)
查看>>
设计模式 小记
查看>>
好程序员web前端精讲 web前端三要素
查看>>
C#入门1 0 与J2ee对立的平台 net
查看>>