Centos SVN安装搭建全过程

1.安装apache+svn

# yum install httpd  httpd-devel subversion mod_dav_svn  –y

 

2.验证SVN模块

# ls /etc/httpd/modules |grep svn

mod_authz_svn.so

mod_dav_svn.so

# svn --version

svn, version 1.6.11 (r934486)

   compiled May 14 2012, 05:36:26

 

3.通过SVN命令创建仓库和项目

# mkdir /usr/local/svnroot

# svnadmin create /usr/local/svnroot/mmspro

# svn import /home/wwwroot/mms.dba-china.com/ file:///usr/local/svnroot/mmspro -m "initial import"

# chown -R apache.apache /usr/local/svnroot/mmspro/

 

 

4.配置SVN并添加用户

# cd /usr/local/svnroot/

# vim mmspro/conf/svnserve.conf 修改以下内容

anon-access = read

auth-access = write

password-db = /usr/local/svnroot/mmspro/conf/passwd

authz-db = /usr/local/svnroot/mmspro/conf/authz

 

authz文件是配置权限
passwd文件是用来存放用户

 

# vim /usr/local/svnroot/mmspro/conf/authz

 

[groups]

admin = svnadmin

developer = andrew,wade

 

[mmspro:/]

@admin=rw

@developer = rw

 

 

# htpasswd  /usr/local/svnroot/mmspro/conf/passwd svnadmin

# htpasswd  /usr/local/svnroot/mmspro/conf/passwd andrew

 

 

5修改apache的配置,使apacheSVN整合

# vim /etc/httpd/conf.d/subversion.conf

添加和修改如下内容

LoadModule dav_svn_module     modules/mod_dav_svn.so

LoadModule authz_svn_module   modules/mod_authz_svn.so

 

<Location /mmspro>

   DAV svn

   #SVNParentPath /usr/local/svnroot/

   SVNPath /usr/local/svnroot/mmspro

      AuthzSVNAccessFile /usr/local/svnroot/mmspro/conf/authz

      AuthType Basic

      AuthName "Authorization Realm"

      AuthUserFile /usr/local/svnroot/mmspro/conf/passwd

      Require valid-user

</Location>

 

6.验证

 

 

你可能感兴趣的:(SVN,安装,搭建)