---
title: "centos下step by step安装svn"
author: "snageyang"
date: "2011-07-17T21:17:30Z"
tags: []
categories: ["非技术"]
slug: "centos-step-by-step-svn"
draft: false
lastmod: "2011-09-05T22:48:47Z"
id: 1126464
url: "https://snageyang.iteye.com/blog/1126464"
---

```java

//yum安装subversion及其依赖包
yum install mod_dav_svn subversion
//apache的httpd.conf所在位置
vim /etc/httpd/conf/httpd.conf
//启动apache
service httpd start
//subversion的配置文件目录
cd /etc/httpd/conf.d/
vim subversion.conf


<Location /repos>
   DAV svn
   //资源库目录
   SVNParentPath /var/www/svn/repos
   //apache访问控制配置文件
   AuthzSVNAccessFile /etc/svn-acl-conf
   AuthType Basic
   AuthName "Subversion repos"
   //svn认证配置文件
   AuthUserFile /etc/svn-auth-conf
   Require valid-user
</Location>

//创建合法apache访问用户，输入两次密码
htpasswd -cm /etc/svn-auth-conf imark

//创建svn资源库目录
mkdir /var/www/svn/
mkdir /var/www/svn/repos
cd /var/www/svn/repos
//创建imark库
svnadmin create imark
//设置imark目录的用户组和用户
chown -R apache.apache imark
//重启apache
service httpd restart

//编辑svn资源库的访问控制
vi /etc/svn-acl-conf
[imark:/]
imark =  rw

```




```

    //svn导入本地文件到repos库中
    svn import  -m 'import' imark file:///var/www/svn/repos/imark/trunk/imark/
    svn list file:///var/www/svn/repos/imark/trunk/imark/ 

```

参考文章 <http://wiki.centos.org/HowTos/Subversion>