Build and configure a Subversion server in Windows

Source: Internet
Author: User
Tags tortoisesvn

1Software Download

Download the Subversion serverProgram.

Download binary installer to http://subversion.tigris.org/, Windows partial download, http://www.collab.net/downloads/subversion.
I downloaded collabnetsubversion-server-1.5.4-1.win32.exe.

2, Server and client Installation

The subversion1.5 installation package comes with apache2.2.8, so you do not need to install the Apache server.

All the way to default installation, if you need to modify the repository root directory or apache2.2.8 port, you can modify your own information, Apache default port is 80, and subversion default repository storage path is C: svn_repository allows you to set the storage path (E: \ svn_repository ).
During the installation process, subversion and Apache are automatically registered as services. After the installation is complete, restart the computer and run services. MSC view the service. We can see that the "apache2.2" and "Subversion server" services have been started automatically. If you do not want them to start automatically, you can change them to manual start.

3Create a version Library (repository)

Data Storage Format: Berkeley dB and fsfs.
To run the Subversion server, you must first create a version Library (repository), which can be seen as a database for storing data on the server. After the Subversion server is installed, you can run it directly, for example:
Svnadmin create E: \ svn_repository \ svndemo
(The default data storage method fsfs can also be used to specify the file system type through the -- FS-type parameter. Optional values include fsfs and DBD ).
A version library is created under the directory e: \ svndemo \ repository.
We can also use tortoisesvn to perform this step graphically:

In the directory e: \ svndemo \ repository, right-click-& gt; tortoisesvn-& gt; Create repository here... ", then you can select the version library mode. Here you can use the default mode, and then create a series of directories and files.
4, Configure users and permissions

Configure Subversion

Modify the file svnserve. conf in the E: \ svndemo \ repository \ conf directory:

# If the verification fails, no permission is granted.
# Anon-access = none
# A maximum of write permissions can be obtained after verification
# Auth-access = write
# Verify the file location
# Password-DB = passwd
# Permission configuration file location
# Authz-DB = authz

Remove the comment keyword at the beginning of the line and set it:

Anon-access = none
Auth-access = write
Password-DB = passwd
Authz-DB = authz

Create the Permission Policy file authz: (there is an authz file in the same directory of svnserver. conf and modify anthz)

[Groups]

Admin = admin, Root

# The keyword "@" indicates the group

[Svndemo:/]

@ Admin = r

Guest = RW
[/Svndemo:/trunk]
@ Admin = r

If you use SVN: // localhost/to connect to the version library, set the following content:
Modify the passwd file in the same directory and remove the following three lines of comment:
# [Users]
# Harry = harryssecret
# Sally = sallyssecret
Finally changed:
[Users]
Harry = harryssecret
Sally = sallyssecret
In the passwd file, the character before "=" is the user name, followed by the password. Note that the comment "#" before "[users]" must be deleted.

If you use http: // localhost/SVN/svndemo to connect to the version library, set the following content:

Use Apache htpasswd to create a user password file and add the user password to the password file:

Create a new authentication file for the first time and add a user AA record to it. The password will be prompted for input.

Htpasswd-c e: \ svn_repository \ svndemo \. htpasswd AA

(A. htpasswd file is generated in the E: \ svn_repository \ svndemo directory to store the passwords of user AA and AA)
Add or modify the password of user AA. Enter the password. On Windows, the password will use the MD5 address modified by Apache.AlgorithmEncryption. on other platforms, crypt () is used for encryption. If the specified file does not exist, htpasswd returns only one error.CodeWithout doing anything else:

Htpasswd E: \ svn_repository \ svndemo \. htpasswd AA

Register the Subversion browser library and permission control Moudle in Apache/CONF/httpd. conf:

Loadmodule
Dav_svn_module modules/mod_dav_svn.so
Loadmodule authz_svn_module modules/mod_authz_svn.so

Note: mod_dav_fs.so and mod_dav.so must be enabled (remove the comment keyword "#" at the beginning) and must be in mod_dav_svn.so
Before mod_authz_svn.so

# Loadmodule dav_fs_module modules/mod_dav_fs.so
# Loadmodule dav_module modules/mod_dav.so

Add location in Apache/CONF/httpd. conf:

# Indicates that the URL for accessing the configuration library is: http://xxx.xxx.xxx/SVN

<Location/SVN>

# Tell apache which module is responsible for serving URLs like that

Dav SVN

# Configure the library path:

Svnparentpath E: \ svn_repository

# Enable basic verification, user name/password verification

Authtype basic

# When a verification dialog box pops up, tell the user what the verification is.

Authname "SVN repos"

# Path of the authentication File

Authuserfile E: \ svn_repository \ svndemo \. htpasswd

# Specify authz to limit the access permissions of each user or group in the version library directory

Authzsvnaccessfile E: \ svn_repository \ svndemo \ conf \ authz

# Only allow https access

# Sslrequiressl

# Subersion built-in XSLT style sheet

# Svnindexxslt "/svnindex. XSL"

# Allow Anonymous Access

# Satisfy any

# Prohibit Anonymous Access

Require valid-user

# Allowed access to the/SVN directory

Svnlistparentpath on

</Location>

5Run the independent server

Run the Apache server and useHttp: // SVN Server IP/SVN/svndemo connection Server.

Run the svnserve-d-r e: \ svndemo \ repository command to run the svn service separately. Do not close the command line window. Close the window will also stop svnserve.

6,SubversionControl access to Chinese Directories

The method is simple, that is, to convert the format of your permission control file to the UTF-8 format without Bom,
Change the permission file to UTF-8 format and I am using the ultraedit menu "ASCII to UTF-8 (UNICODE
Editing )".

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.