Skip to content

Commit

Permalink
2016-02-07完善SVN配置
Browse files Browse the repository at this point in the history
  • Loading branch information
judasn committed Feb 7, 2016
1 parent 49f8e51 commit b91777f
Show file tree
Hide file tree
Showing 5 changed files with 84 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Iptables.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ iptables 的设置在 CentOS 和 Ubuntu 下有些细节不一样,Ubuntu 这里
- 查看已有规则列表,并且显示编号:`sudo iptables -L -n --line-numbers`
- ![Iptables 服务器配置文件常用参数](images/Iptables-a-1.jpg)
- 要删除 INPUT 里序号为 8 的规则,执行:`sudo iptables -D INPUT 8`
- 保存配置命令:`sudo iptables save`
- 保存配置命令:`sudo iptables save 或者 /etc/rc.d/init.d/iptables save`
- 重启服务命令 :`sudo service iptables restart`
- 查看服务状态: `sudo service iptables status`
- 设置开启默认启动: `sudo chkconfig --level 345 iptables on`
Expand Down
86 changes: 83 additions & 3 deletions SVN-Install.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
* [Subversion 1.8 安装](#subversion0)
* [RPM 安装(推荐)](#subversion1)
* [编译安装(不推荐)](#subversion2)
* [资料](#subversion3)
* [SVN 配置](#subversion3)
* [资料](#subversion4)

------

Expand Down Expand Up @@ -94,10 +95,89 @@
- `make install`


<h2 id="subversion3">资料</h2>
<h2 id="subversion3">SVN 配置</h2>

- 在系统上创建一个目录用来存储所有的 SVN 文件:`mkdir -p /opt/svn/repo/`
- 新建一个版本仓库:`svnadmin create /opt/svn/repo/`
- 生成如下目录和文件:
- 目录:`locks`
- 目录:`hooks`
- 目录:`db`
- 目录:`conf`
- 文件:`format`
- 文件:`README.txt`
- 其中,目录 `conf` 最为重要,常用的配置文件都在里面
- `svnserve.conf` 是 svn 服务综合配置文件
- `passwd` 是用户名和密码配置文件
- `authz` 是权限配置文件


- 设置配置文件
- 编辑配置文件:`vim /opt/svn/repo/conf/svnserve.conf`
- ![设置配置文件](images/SVN-Install-a-1.jpg)
- 配置文件中下面几个参数(默认是注释的):
- `anon-access`: 对不在授权名单中的用户访问仓库的权限控制,有三个可选性:`write、read、none`
- `none` 表示没有任何权限
- `read` 表示只有只读权限
- `write` 表示有读写权限
- `auth-access`:对在授权名单中的用户访问仓库的权限控制,有三个可选性:`write、read、none`
- `none` 表示没有任何权限
- `read` 表示只有只读权限
- `write` 表示有读写权限
- `password-db`:指定用户数据配置文件
- `authz-db`:指定用户权限配置文件
- `realm`:指定版本库的认证域,即在登录时提示的认证域名称。若两个版本库的认证域相同,建议使用相同的用户名口令数据文件
- 当前实例的配置内容:`realm = myrepo`


- 添加用户
- 编辑配置文件:`vim /opt/svn/repo/conf/passwd`
- ![添加用户](images/SVN-Install-a-2.jpg)
- 添加用户很简答,如上图所示在配置文中添加一个格式为:`用户名 = 密码` 的即可


- 设置用户权限
- 编辑配置文件:`vim /opt/svn/repo/conf/authz`
- ![设置用户权限](images/SVN-Install-a-3.jpg)
- 配置文件中几个参数解释:
- `r` 表示可写
- `w` 表示可读
- `rw` 表示可读可写
- `* =` 表示除了上面设置的权限用户组以外,其他所有用户都设置空权限,空权限表示禁止访问本目录,这很重要一定要加上
- `[groups]` 表示下面创建的是用户组,实际应用中一般我们对使用者都是进行分组的,然后把权限控制在组上,这样比较方便。使用组权限方式:`@组名 = rw`


- 启动服务
- `svnserve -d -r /opt/svn/repo/ --listen-port 3690`
- `-d` 表示后台运行
- `-r /opt/svn/repo/` 表示指定根目录
- `--listen-port 3690` 表示指定端口,默认就是 3690,所以如果要用默认端口这个也是可以省略掉的

- 停止服务
- `killall svnserve`


- 测试
- iptables 处理
- 一种方式:先关闭 iptables,防止出现拦截问题而测试不了:`service iptables stop`
- 一种方式:在 iptables 中添加允许规则(svn 默认端口是 3690):
- 添加规则:`sudo iptables -I INPUT -p tcp -m tcp --dport 3690 -j ACCEPT`
- 保存规则:`/etc/rc.d/init.d/iptables save`
- 重启 iptables:`sudo iptables restart`
- 在 Windows 的 svn 客户端上访问:`svn://192.168.0.110`


<h2 id="subversion4">资料</h2>

- <http://tecadmin.net/install-subversion-1-8-on-centos-rhel/>
- <http://svn.apache.org/repos/asf/subversion/trunk/INSTALL>
- <http://chenpipi.blog.51cto.com/8563610/1613007>
- <https://blog.linuxeye.com/348.html>
- <http://jingyan.baidu.com/article/046a7b3efb6a5df9c27fa991.html>
- <http://jingyan.baidu.com/article/046a7b3efb6a5df9c27fa991.html>
- <http://www.ha97.com/4467.html>
- <http://blog.feehi.com/linux/7.html>
- <http://my.oschina.net/lionel45/blog/298305?fromerr=1NdIndN0>
- <http://www.centoscn.com/CentosServer/ftp/2015/0622/5708.html>
- <http://blog.csdn.net/tianlesoftware/article/details/6119231>
- <http://www.scmeye.com/thread-419-1-1.html>
- <http://m.blog.csdn.net/article/details?id=7908907>
Binary file added images/SVN-Install-a-1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/SVN-Install-a-2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/SVN-Install-a-3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit b91777f

Please sign in to comment.