CentOS 6.5 配置SVN

来源:互联网 发布:58中国网络经纪人 编辑:程序博客网 时间:2024/05/09 11:19
1、安装软件
[root@code386 ~]# yum install httpd httpd-devel subversion mod_dav_svn mod_auth_mysql
 
2、确认已经安装了svn模块
[root@code386 ~]# cd /etc/httpd/modules
[root@code386 modules]# ls |grep svn
mod_authz_svn.so
mod_dav_svn.so
[root@code386 modules]#


3、检验已经安装的SVN版本信息
[root@code386 modules]# svnserve --version
svnserve, version 1.6.11 (r934486)
   compiled Mar  6 2014, 10:49:10
Copyright (C) 2000-2009 CollabNet.
Subversion is open source software, see http://subversion.tigris.org/
This product includes software developed by CollabNet (http://www.Collab.Net/).
The following repository back-end (FS) modules are available:
* fs_base : Module for working with a Berkeley DB repository.
* fs_fs : Module for working with a plain file (FSFS) repository.
Cyrus SASL authentication is available.
[root@code386 modules]#


4、建立svn库
[root@code386 ~]# mkdir -p /home/svn/repositories
[root@code386 ~]# svnadmin create^Chome/svn/repositories
[root@code386 ~]# ls /home/svn/repositories
conf  db  format  hooks  locks  README.txt
[root@code386 ~]#


5、配置密码和权限
[root@code386 ~]# cd /home/svn/repositories/conf
[root@code386 conf]# ls
authz  passwd  svnserve.conf
#配置密码
[root@code386 conf]#  vi passwd
#添加下列内容
code386=778899
#添加读写权限
[root@code386 conf]# vi authz
[/]
code386=rw
 
[root@code386 conf]#  vi svnserve.conf
[general]
anon-access=none
auth-access=write
password-db=passwd
authz-db=authz
realm=/home/svn/repositories


6、配置端口
[root@code386 ~]# /sbin/iptables -I INPUT -p tcp --dport 3690 -j ACCEPT
[root@code386 ~]# /etc/rc.d/init.d/iptables save iptables
iptables: Saving firewall rules to /etc/sysconfig/iptables:[  OK  ]
[root@code386 ~]# /etc/init.d/iptables restart
iptables: Setting chains to policy ACCEPT: filter          [  OK  ]
iptables: Flushing firewall rules:                         [  OK  ]
iptables: Unloading modules:                               [  OK  ]
iptables: Applying firewall rules:                         [  OK  ]
[root@code386 ~]#


7、启动和检查进程
[root@code386 ~]# svnserve -d -r /home/svn/repositories
[root@code386 ~]# ps -ef|grep svn|grep -v grep
root     17579     1  0 08:08 ?        00:00:00 svnserve -d -r /home/svn/repositories


8、查检端口
[root@code386 ~]# netstat -ln|grep 3690
tcp        0      0 0.0.0.0:3690                0.0.0.0:*                   LISTEN     
[root@code386 ~]#


9、设置开机启动svn服务
[root@code386 ~]# vi /etc/rc.d/rc.local
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.
touch /var/lock/subsys/local
#添加启动项
svnserve -d -r /home/svn/repositories
[root@code386 ~]#
0 0
原创粉丝点击