A concise tutorial on building SVN servers under Windows _win Server

Source: Internet
Author: User

SVN (Subversion) is a version management tool. Currently, most open source software uses SVN as the code versioning software. In addition to remembering all the changes to files and directories, SVN can also restore files to a previous version, and you can check history to see what changes were made to the data. It's a "Time Machine".

Install SVN program

Install SVN

SVN download Address: http://subversion.apache.org/packages.html
This article examples svn installation directory for C:\Program Files\subversion
After the installation is complete, the environment variable may be automatically added to the system environment variable path added by C:\Program Files\subversion\bin.

Then, reboot the machine.

Create local SVN

Create an SVN library

Here The example SVN Library address D:\svn\repository (the folder exists, otherwise the SVN command behind it will fail)

CMD to use the command svnadmin create D:\svn\repository
After the command completes, on the D:\svn\repository directory, SVN creates multiple folders, such as Conf,dav,db, and so on.

Add user

Enter the D:\svn\repository\conf folder, edit the svnserve.conf file, remove password-db = passwd before the annotation symbol # (there is no white space before), indicating that the password is obtained from the passwd.

Then edit the passwd file and add the user name under [users], such as the following:

Copy Code code as follows:

[Users]
# Harry = Harryssecret
# sally = Sallyssecret
Test = 123456

Indicates that a user was added with the user named Test and the password is 123456

Registering SVN to System services

CMD uses the following command:

Copy Code code as follows:

SC create Svnserve binpath= "C:\Program files\subversion\bin\svnserve.exe--service-r D:\svn\repository" depend= Tcpip S tart= Auto
SC start Svnserve


Here, SVN should be built up. Access Address: Svn://localhost

SVN configuration Optimizations

Anonymous access

The default svn is an anonymous, read-only operation. Modified as follows:

Modify the D:\svn\repository\conf\svnserve.conf file to change anon-access = read to anon-access = None

Read and Write permissions
The default SVN is to open all directory permissions. Modified as follows:

Modify the D:\svn\repository\conf\svnserve.conf file to remove authz-db = Authz before the annotation symbol # (no white space before), indicating that authorization is obtained from Authz.

Then edit the Authz file and modify it as follows:

Copy Code code as follows:

[/]
Test = RW
Test2 = RW
* =

[/secret]
Test2 =

Indicates that test all directories can read and write, test2 can only read and write all contents of the secret directory, and other users are not authorized.

SVN port

The SVN default port is 3690, how to modify the SVN port as follows:

Copy Code code as follows:

SC create svnserve8888 binpath= "C:\Program files\subversion\bin\svnserve.exe--service-r D:\svn\repository-- Listen-port 8888 "depend= Tcpip start= Auto
SC start svnserve8888

Access Address: svn://localhost:8888/

SVN list

The SVN list can be generated by Apache to access SVN content in the browser, as follows:

1, the C:\Program Files\subversion\bin under the mod_dav_svn.so and mod_authz_svn.so, copied to the Apache Modules folder
2, modify the Apache configuration file httpd.conf:

1) Remove the annotation symbol from the following two items #:

Copy Code code as follows:

#LoadModule Dav_fs_module modules/mod_dav_fs.so
#LoadModule Dav_module modules/mod_dav.so

2) Add the following content:

Copy Code code as follows:

LoadModule Dav_svn_module modules/mod_dav_svn.so
LoadModule Authz_svn_module modules/mod_authz_svn.so
<Location/svn>
DAV SVN
Svnpath d:/svn/repository
</Location>

After restarting Apache, Apache will generate an SVN list, Access address: HTTP://LOCALHOST/SVN

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.