Linux SVN

下载地址:http://subversion.apache.org/packages.html

系统 CentOS6.8

1. 简易安装

安装:

[root@node opt]# yum install subversion

查看版本:

[root@node opt]# svn --version
svn, version 1.6.11 (r934486)
compiled Aug 17 2015, 08:37:43
...

或 #svnserve --version

创建资源库位置:

[root@node opt]# pwd
/opt
[root@node opt]# mkdir -p svn/rep

创建资源库:

[root@node opt]# svnadmin create /opt/svn/rep/
[root@node opt]# ll /opt/svn/rep/
total 24
drwxr-xr-x. 2 root root 4096 May 17 10:50 conf
drwxr-sr-x. 6 root root 4096 May 17 10:50 db
-r--r--r--. 1 root root 2 May 17 10:50 format
drwxr-xr-x. 2 root root 4096 May 17 10:50 hooks
drwxr-xr-x. 2 root root 4096 May 17 10:50 locks
-rw-r--r--. 1 root root 229 May 17 10:50 README.txt

配置SVN:

[root@node conf]# pwd
/opt/svn/rep/conf
[root@node conf]# ll
total 12
-rw-r--r--. 1 root root 1080 May 17 10:50 authz
-rw-r--r--. 1 root root 309 May 17 10:50 passwd
-rw-r--r--. 1 root root 2279 May 17 10:50 svnserve.conf

以上三个文件就是Subversion核心配置,简介:

authz :账号及权限管理

passwd :账号密码管理

svnserver.conf :服务相关配置

编辑 authz :

[aliases]
# joe = /C=XZ/ST=Dessert/L=Snake City/O=Snake Oil, Ltd./OU=Research Institute/CN=Joe Average

[groups]
# harry_and_sally = harry,sally
# harry_sally_and_joe = harry,sally,&joe
miselehe_dev = mi1,mi2

[/]
mi1 = rw
mi2 = rw


# [/foo/bar]
# harry = rw
# &joe = r
# * =

# [repository:/baz/fuz]
# @harry_and_sally = rw
# * = r

编辑 passwd:

[users]
# harry = harryssecret
# sally = sallyssecret

mi1 = mi1passwd
mi2 = mi2passwd

编辑 svnserver.conf :

anon-access = read
auth-access = write
password-db = passwd
authz-db = authz

将以上四行注释取消。

启动SVN:

[root@node ~]# svnserve -d -r /opt/svn/rep/
[root@node ~]# ps -ef | grep svn
root       3093      1  0 11:09 ?        00:00:00 svnserve -d -r /opt/svn/rep/
root       3095   2890  0 11:09 pts/0    00:00:00 grep svn

防火墙开启 3690 端口:

[root@node ~]# vim /etc/sysconfig/iptables
# Firewall configuration written by system-config-firewall
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 3690 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT
[root@node ~]# service iptables restart
iptables: Setting chains to policy ACCEPT: filter          [  OK  ]
iptables: Flushing firewall rules:                         [  OK  ]
iptables: Unloading modules:                               [  OK  ]
iptables: Applying firewall rules:                         [  OK  ]

访问:



2.整合Apache

Apache 安装方法: http://www.miselehe.com/article/view/69

。。。





转载请指明出处!http://www.miselehe.com/article/view/60

推荐文章