SVN Install Guide

  1. Introduction

1.1 Installing Subversion

1.1.1 The Subversion Windows installation package can be downloaded from the Subversion server, at the following URL:

 http://subversion.apache.org/packages.html

I have downloaded the distribution packaged in a standard Windows installation program. For the Subversion version 1.6.3, grab the file named Setup-Subversion-1.6.3.msi .

The installation itself is completely straight-forward. You read [and accept] a license agreement, select the destination directory, press Next a couple of times, wait for the file copying to stop and press finish. What you get in the end, is the Subversion is installed in the directory you have specified.

The default directory is C:\Program Files\Subversion and I install in the directory D:\Program Files\Subversion, and here is a list of directories the installation creates:

D:\Program Files\Subversion\bin Contains all the binaries like svn.exe, svnadmin.exe and svnlook.exe. And Contains the Apache 2.2 plug-in modules mod_authz_svn.so and mod_dav_svn.so . D:\Program Files\Subversion\iconv D:\Program Files\Subversion\share D:\Program Files\Subversion\licences

The D:\Program Files\Subversion\bin is added to the path.

And that's about all there is to the installation.

At this point it is probably recommendable to restart the system, before moving on to configuration.

1.2 Installing Apache 2.2

1.2.1. The Apache 2.2 server for Windows installation package can be downloaded from the Apache.org server, at the following URL:

 http://httpd.apache.org/download.cgi

I have downloaded the distribution packaged in a standard Windows installation program - the httpd-2.2.17-win32-x86-openssl-0.9.8o.msi .

The installation itself is completely straight-forward. You read [and accept] a license agreement, select the Apache binding (I picked the 2.2.x), enter your domain name, server name, the administrator's e-mail address, and the port the server will be listening on. The default values are already selected for you. For dedicated a subversion server, I suggest you leave it running on port 80. You can always change it later.

Then you can select typical, or custom install. Selecting typical install lets you choose the destination directory, and after that it starts copying files. When it finishes, you're done.

  1. Configuration

2.1 Configuring Subversion

The Subversion stores the content into so called repositories. You need at least one repository to store all your data into, or may have multiple repositories, one for each project. This HOWTO will assume multiple repositories are used. We will call these projects project1 and project2.

So, let's create a directory for all our projects, and then a subdirectory for each of the projects, e.g.:

D:\Repositories\project1D:\Repositories\project2These are just directories to hold our repositories, now we must create the repositories themselves, using the svnadmin utility:

svnadmin create D:\Repositories\project1
svnadmin create D:\Repositories\project2

2.2 Configuring Apache 2.2 server

As the Apache server will only be a front end for the Subversion system, I suggest that all the Subversion specific files are stored in a separate directory, which is at hand, and not hidden away in some Apache directory. In the best spirit of *nix systems, let us name that directory etc.

D:\etc

But, before we start with the Subversion specific configuration, let us make the necessary steps and configuration changes, to link the Apache server with Subversion.

Step 1 (add some svn refrence module to apache)

Copy the files mod_authz_svn.so and mod_dav_svn.so from D:\Program Files\Subversion\bin into D:\Program Files\Apache Software foundation\Apache2.2\modules .

Step 2 (modify configure file)

Modify the D:\Program Files\Apache Software foundation\Apache2.2\conf\httpd.conf file:

Add the modules to the Apache server:

  1. Delete "#
                        #LoadModule dav_fs_module modules/mod_dav_fs.so
                        #LoadModule dav_module modules/mod_dav.so
 
 
 
 
 
 
 
 
 
 
 

which in D:\Program Files\Apache Software Foundation\Apache2.2\conf\httpd

  1. Add these codes at the end of "LoadModule? ... "
                        LoadModule dav_svn_module modules/mod_dav_svn.so 
                        LoadModule authz_svn_module modules/mod_authz_svn.so

At the end of the file, include a Subversion configuration file. We will create this file in one of the next steps.

Include D:/etc/subversion.conf (the file subversion.conf define next)

Step 3

Our decision was that anonymous access to repositories will not be allowed. Also, we would like that only the developers working on a specific project, can modify the contents of that project's repository. All other developer will have read only permissions to all projects. After all, we want our developers to share their code, don't we.

So first, we create a password file for authentication. All the developers that will use our Subversion server must chose a user name and a password. Unfortunately, the simplest way to do this is locally, so you must ask all the developers to come to the system and enter chose a password.

In the best tradition of Subversion book, let us name our developers Harry and Sally. Since we have two projects, we'll have a somewhat bigger development department, adding Ross and Rachel to our list of employees.

-------------------------------------------------------------------------------------------------

	cd D:\Program Files\Apache Software Foundation\Apache2.2\bin 
					
	D:\Program Files\Apache Software Foundation\Apache2.2\bin>htpasswd -cm D:\etc\svn-auth-file harry
	New password: ***** 
	Re-type new password: *****
	Adding password for user harry

	D:\Program Files\Apache Software Foundation\Apache2.2\bin>htpasswd -m D:\etc\svn-auth-file sally
	New password: *******
	Re-type new password: *******
	Adding password for user sally

	D:\Program Files\Apache Software Foundation\Apache2.2\bin>htpasswd -m D:\etc\svn-auth-file ross
	New password: ***** 
	Re-type new password: *****
	Adding password for user ross

	D:\Program Files\Apache Software Foundation\Apache2.2\bin>htpasswd -m D:\etc\svn-auth-file rachel
	New password: ***** 
	Re-type new password: *****
	Adding password for user rachel

--------------------------------------------------------------------------------------------------

When using the command for the first time, add the -c option. This creates the file named D:\etc\svn-auth-file . The -m option instructs the htpasswd utility to use MD5 algorithm to encrypt the passwords.

Step 4

Now that we can authenticate our users, we must configure the access rights to our repositories. To do this, we create another file in our etc directory.

D:\etc\svn-acl

--------------------------------------------------------------------------------------------------

	#
	# specify groups here
	#
	[groups]
	team1 = ross, rachel

	#
	# team1 group has a read/write access to project1 repository
	# all subdirectories
	# all others have read access only 
	#
	[project1:/]
	@team1 = rw
	* = r

	#
	# project2 repository, only harry and sally have read-write access to project2
	#
	[project2:/]
	harry = rw
	sally = rw
	* = r

	#
	# ross is helping with the time zone part of the project2
	#
	[project2:/timezone]
	harry = rw
	sally = rw
	ross = rw
	* = r

--------------------------------------------------------------------------------------------------

The groups section can be used to define groups of users. For repository project1, only users from the group team1 have read/write access. All other users have read only access.

Step 5

In the end it is time to link the Apache server with the Subversion. This is done using the D:\etc\subversion.conf file:

---------------------------------------------------------

				<Location /project1>
				  DAV svn
				  SVNPath D:/Repositories/project1

				  AuthType Basic
				  AuthName "Subversion Project1 repository"
				  AuthUserFile D:/etc/svn-auth-file

				  Require valid-user

				  AuthzSVNAccessFile D:/etc/svn-acl
				</Location>

				<Location /project2>
				  DAV svn
				  SVNPath D:/Repositories/project2

				  AuthType Basic
				  AuthName "Subversion Project2 repository"
				  AuthUserFile D:/etc/svn-auth-file

				  Require valid-user

				  AuthzSVNAccessFile D:/etc/svn-acl
				</Location>
				
-----------------------------------------------------------

The developers can access the D:\Repositories\project1 repository at the  http://subversion/project1(http://localhost/project1/) URL. The access is only available to a valid user, and a basic HTTP authentication is used. The Apache server can read the valid user names and passwords from the D:\etc\svn-auth-file file. The D:\etc\svn-acl file defines the access rights to the repository.

  1. Restart the Apache server for the configuration changes to take effect

 

 

Reproduced, please indicate the source!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
CentOS是一种基于Linux的操作系统,而SVN是一种版本控制系统。在CentOS上安装和配置SVN可以实现团队协作开发和版本管理。 要在CentOS上安装SVN,可以按照以下步骤进行操作: 1. 更新系统:使用以下命令更新系统软件包: ``` sudo yum update ``` 2. 安装SVN服务器软件包:使用以下命令安装SVN服务器软件包: ``` sudo yum install subversion ``` 3. 创建SVN仓库:使用以下命令创建一个新的SVN仓库: ``` sudo svnadmin create /path/to/repository ``` 4. 配置SVN访问权限:编辑SVN仓库的配置文件,设置访问权限。可以使用以下命令打开配置文件: ``` sudo vi /path/to/repository/conf/svnserve.conf ``` 在文件中找到并取消注释以下行,以允许匿名访问: ``` anon-access = read auth-access = write password-db = passwd authz-db = authz ``` 5. 创建SVN用户:编辑密码文件,创建一个新的SVN用户。可以使用以下命令打开密码文件: ``` sudo vi /path/to/repository/conf/passwd ``` 在文件中添加用户名和密码,格式为: ``` username = password ``` 6. 设置SVN仓库的权限:编辑权限文件,设置SVN仓库的用户权限。可以使用以下命令打开权限文件: ``` sudo vi /path/to/repository/conf/authz ``` 在文件中添加用户和对应的权限,格式为: ``` [repository:/] username = rw ``` 7. 启动SVN服务器:使用以下命令启动SVN服务器: ``` sudo svnserve -d -r /path/to/repository ``` 现在,你已经在CentOS上成功安装和配置了SVN服务器。其他用户可以通过SVN客户端连接到该服务器,并进行代码的版本控制和协作开发。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值