CentOS安装和配置SVN
环境:centos 6.5 x64
#安装软件包
yum -y install mod_dav_svn
yum -y install httpd
#新建目录
mkdir -p /opt/svn
#新建仓库
svnadmin create /opt/svn/test(svnadmin create /opt/svn/repositories)
#cope配置文件(未测试,密码明文)
cp /opt/svn/test/conf/* /opt/svn/
# vim passwd
[users]
irving = 123456
:wq!
# vim /opt/svn/test/conf/authz
[groups]
[/]
irving=rw
:wq!
#配置授权文件
mkdir /opt/svn/conf
#新建用户
htpasswd -c /opt/svn/conf/pwd.conf irving(首次需要-c ,否则会覆盖上次用户)
htpasswd /opt/svn/conf/pwd.conf test
在用户最上方加上[users]
[users]
irving=xxxxxx
test=xxxxxx
#保存退出
:wq
#配置用户权限
vi /opt/svn/conf/authz.conf
[groups]
admin=irving,test
view=user1
@admin=rw
[test:/]
user1=r
[/]表示根目录以下的权限定义
[repos1:/]表示仓库下的权限定义
如果要分项目,则以此规则类推:
如:[repos1:/aaa]则表示仓库下的aaa项目的权限定义。
@admin 表示admin这个组下的用户权限。
user1=r 表示user1这个用户的权限。
权限类型:r,w,rw 分别表示只读,只写,读写。
#保存退出
:wq
#修改SVN版本库配置文件
vi /opt/svn/test/conf/svnserve.conf
[general]
anon-access = none
auth-access = write
password-db = /opt/svn/conf/pwd.conf #指向用户配置文件
authz-db = /opt/svn/conf/authz.conf #指向权限配置文件
realm = test #指向svn仓库地址
#配置httpd
vi /etc/httpd/conf.d/subversion.conf
修改
<Location /svn> DAV svn SVNListParentPath on SVNParentPath /opt/svn AuthType Basic AuthName "Authorization Realm" AuthUserFile /opt/svn/conf/pwd.conf AuthzSVNAccessFile /opt/svn/conf/authz.conf Require valid-user # Limit write permission to list of valid users. # <LimitExcept GET PROPFIND OPTIONS REPORT> # Require SSL connection for password protection. # SSLRequireSSL # AuthType Basic # AuthName "Authorization Realm" # AuthUserFile /opt/svn/conf/pwd.conf # AuthzSVNAccessFile /opt/svn/conf/authz.conf # Require valid-user # </LimitExcept> </Location>
#配置Apache对版本库的访问权限
chown -R apache.apache /opt/svn/test
#配置svn的端口
vi /etc/httpd/conf/httpd.conf
找到#Listen 12.34.56.78:80这一行 (默认80端口)
#重启httpd服务
service httpd restart
#系统启动时Apache自动运行
chkconfig httpd on
#查看进程
ps aux|grep svn
访问:http://ip/svn/
Refer:
http://my.oschina.net/u/1245614/blog/340167
客户端
http://sourceforge.net/projects/tortoisesvn/
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 周边上新:园子的第一款马克杯温暖上架
· Open-Sora 2.0 重磅开源!
· .NET周刊【3月第1期 2025-03-02】
· 分享 3 个 .NET 开源的文件压缩处理库,助力快速实现文件压缩解压功能!
· [AI/GPT/综述] AI Agent的设计模式综述
2012-12-15 未能加载包Microsoft SQL Management Studio