debian 下配置SVN
2009-05-16 13:12
239 查看
SVN有以下几种访问协议:
这里只说明SVN://协议的配置及使用
最简单也最实用
当然也将HTTP://协议的也顺便说一点
安装apache subversion
创建目录:
# mkdir -p /var/local/repos
创建仓库数据库:
# svnadmin create /var/local/repos
将仓库的写权限赋给 kevin:
# chown -R www-data:www-data /var/local/repos
在repos目录下生成了一些文件
├─repos
│ ├─conf
│ ├─dav
│ ├─db
│ │ ├─revprops
│ │ ├─revs
│ │ └─transactions
│ ├─hooks
│ └─locks
进入conf后,修改svnserve.conf文件,设定访问权限,指定authz和passwd文件
svnserve.conf:
[general]
### These options control access to the repository for unauthenticated
### and authenticated users. Valid values are "write", "read",
### and "none". The sample settings below are the defaults.
anon-access = none
auth-access = write
### The password-db option controls the location of the password
### database file. Unless you specify a path starting with a /,
### the file's location is relative to the directory containing
### this configuration file.
### If SASL is enabled (see below), this file will NOT be used.
### Uncomment the line below to use the default password file.
password-db = passwd
### The authz-db option controls the location of the authorization
### rules for path-based access control. Unless you specify a path
### starting with a /, the file's location is relative to the the
### directory containing this file. If you don't specify an
### authz-db, no path-based access control is done.
### Uncomment the line below to use the default authorization file.
authz-db = authz
### This option specifies the authentication realm of the repository.
### If two repositories have the same authentication realm, they should
### have the same password database, and vice versa. The default realm
### is repository's uuid.
#realm = My First Repository
passwd文件:每一位用户设置,文件内容如下:
authz文件:
[groups]
# 定义组信息
p1_group_a = p1_admin1
p1_group_d = p1_d1
p1_group_t = p1_t1
p2_group_a = p2_admin1
p2_group_d = p2_d1
p2_group_t = p2_t1
[/]
# 指定所有的版本库默认只读,root可读写
* = r
root = rw
[project1:/]
# 指定对版本库project1根目录的权限
@p1_group_a = rw
导入版本库:
大家如果想拷贝自己的目录到版本库的话 用下面的命令:
svn import yourprojectname file:///var/local/repos -m "initial import"
将工作目录放到新目录
svn checkout http://192.168.102.20/repos/login/src/ src2
启动 svnserve:svnserve -d -r /var/local/repos
自动更新:
SVN客户端即可用svn://hostname/来访问,更新操作
这样就完成配置,但还有不足,无法自动更新到WEB目录,现在让我们来完成自动更新设置
拷贝版本库中hooks下的post-commit.tmpl为post-commit,并修改post-commit中的内容:
将内容
REPOS="$1"
REV="$2"
commit-email.pl "$REPOS" "$REV" commit-watchers@example.org
log-commit.py --repository "$REPOS" --revision "$REV"
修改为:/usr/bin/svn update WEB目录 即可。
协议 | 访问方法 |
---|---|
file:/// | 通过本地磁盘访问。 |
http:// | 与Apache组合,通过WebDAV协议访问。 |
https:// | 同上,但支持SSL协议加密连接。 |
svn:// | 通过svnserve服务自定义的协议访问。 |
svn+ssh:// | 同上,但通过SSH协议加密连接。 |
最简单也最实用
当然也将HTTP://协议的也顺便说一点
安装apache subversion
创建目录:
# mkdir -p /var/local/repos
创建仓库数据库:
# svnadmin create /var/local/repos
将仓库的写权限赋给 kevin:
# chown -R www-data:www-data /var/local/repos
在repos目录下生成了一些文件
├─repos
│ ├─conf
│ ├─dav
│ ├─db
│ │ ├─revprops
│ │ ├─revs
│ │ └─transactions
│ ├─hooks
│ └─locks
进入conf后,修改svnserve.conf文件,设定访问权限,指定authz和passwd文件
svnserve.conf:
[general]
### These options control access to the repository for unauthenticated
### and authenticated users. Valid values are "write", "read",
### and "none". The sample settings below are the defaults.
anon-access = none
auth-access = write
### The password-db option controls the location of the password
### database file. Unless you specify a path starting with a /,
### the file's location is relative to the directory containing
### this configuration file.
### If SASL is enabled (see below), this file will NOT be used.
### Uncomment the line below to use the default password file.
password-db = passwd
### The authz-db option controls the location of the authorization
### rules for path-based access control. Unless you specify a path
### starting with a /, the file's location is relative to the the
### directory containing this file. If you don't specify an
### authz-db, no path-based access control is done.
### Uncomment the line below to use the default authorization file.
authz-db = authz
### This option specifies the authentication realm of the repository.
### If two repositories have the same authentication realm, they should
### have the same password database, and vice versa. The default realm
### is repository's uuid.
#realm = My First Repository
passwd文件:每一位用户设置,文件内容如下:
[users] p1_admin1 = p1_admin1 p1_d1 = p1_d1 p1_t1 = p1_t1 p2_admin1 = p2_admin1 p2_d1 = p2_d1 p2_t1 = p2_t1
authz文件:
[groups]
# 定义组信息
p1_group_a = p1_admin1
p1_group_d = p1_d1
p1_group_t = p1_t1
p2_group_a = p2_admin1
p2_group_d = p2_d1
p2_group_t = p2_t1
[/]
# 指定所有的版本库默认只读,root可读写
* = r
root = rw
[project1:/]
# 指定对版本库project1根目录的权限
@p1_group_a = rw
导入版本库:
大家如果想拷贝自己的目录到版本库的话 用下面的命令:
svn import yourprojectname file:///var/local/repos -m "initial import"
将工作目录放到新目录
svn checkout http://192.168.102.20/repos/login/src/ src2
启动 svnserve:svnserve -d -r /var/local/repos
自动更新:
SVN客户端即可用svn://hostname/来访问,更新操作
这样就完成配置,但还有不足,无法自动更新到WEB目录,现在让我们来完成自动更新设置
拷贝版本库中hooks下的post-commit.tmpl为post-commit,并修改post-commit中的内容:
将内容
REPOS="$1"
REV="$2"
commit-email.pl "$REPOS" "$REV" commit-watchers@example.org
log-commit.py --repository "$REPOS" --revision "$REV"
修改为:/usr/bin/svn update WEB目录 即可。
相关文章推荐
- Debian squeeze下安装git,svn配置以及其它。
- debian配置openssh和SVN+websvn(备忘)
- SVN 在Debian/Ubuntu、windows 2003 的配置安装与使用
- debian下安装配置svn
- linux debian安装配置SVN服务器
- Debian apache2 + SVN + Redmine 配置
- debian-svn配置多个版本库
- linux debian安装配置SVN服务器
- debian配置静态ip
- Mac OS X下配置apache2.2+SVN 1.4.4+PHP 5.2
- debian7 安装配置
- MyEclipse 8.6的SVN 插件安装,优化,配置
- SVN服务端的两中配置方式比较
- SVN 导出代码在VS2012运行提示“未能将网站xx 配置为使用 ASP.NET 4.0,为了使此网站正确运行,您必须将它手动配置为使用 ASP.NET 4.0”
- 配置svn的问题,
- linux安装配置svn
- zend studio 使用SVN配置工具
- SVN配置使用
- CentOS 7下搭建配置SVN服务器
- Linux下SVN安装配置的方法