Configure the svn server in Windows

Source: Internet
Author: User
Tags tortoisesvn
1. Download an object
  • Download the latest subversion. here I select svn-1.4.6-setup.exe.
  • Download "Subversion
    Windows Service "Software Package (not required for XP or above)
  • Download tortoisesvn
2. Install the Subversion server

Because I download the setup.exe version, the system variables will be automatically set after the installation program is installed. If you download the zip version, you need to manually set the system variables.
You can install setup.exe directly. Install it to D: \ Program Files \ subversion.

First, create the svn repository (repository)

Svnadmin create F: \ lava \ SVN \[Note] You can also use tortoisesvn to create a repository, right-click the target folder, and choose create repository.

After repository is created, several files and folders are generated under the directory. The dav directory is the directory provided for Apache and mod_dav_svn to store internal data; the DB directory is all version-controlled data files; the hooks directory stores the directory of the hook script file; locks is used to hold the directory of the data locked by the Subversion file library, and is used to track the client that accesses the file library; the format file is a text file with only one integer in it, indicating the version number configured in the current file library;

3. Configure the svn Server


Open the configuration file conf \ svnserve. conf In the svn directory and modify the configuration parameters.
Example: D: \ svnhome \ conf \ svnserve. conf remove the annotator before the following content #
[General]
Anon-access = none
Auth-access = write
Password-DB = passwd
Realm = my first Repository

Note:
Anon-access = none
-- Anonymous access is not allowed! This is very important, or anyone else can access this code repository.
Auth-access = write
-- Allow modification submission
Password-DB = passwd
-- Password File Name

 

[Note] If you need to control the access user identity, then:
# [General]
# Password-DB = passwd

# At the beginning of each line, where the second row specifies the name of the authentication file, that is, the passwd file
Open the passwd file and set

# [Users]
# Harry = harryssecret
# Sally = sallyssecret

The beginning of these lines # characters are removed. This is set to a user. One row is stored in the format of "username = password". For example, you can insert a row: Admin = admin888, add a user with the username admin and password admin888 to the system.

4. Run the svn Server

Run SVN Service
Execute

Svnserve -- daemon -- root F: \ lava \ SVN

Service start, -- daemon can be abbreviated to-D, -- root can be abbreviated to-R, you can create a batch processing file and put it in the Windows Startup Group to run the svn service at startup, or in this address http://clanlib.org /~ MBN/svnservice/downloads the svnservice.exe file, copies it to the E: \ SVN \ bin directory, and then runs it from the command line:

Svnservice-install -- daemon -- root "E: \ SVN \ repository"
SC config svnservice start = auto
Net start svnservice  5. Add as System Service


Method 1 (recommended ):
In Windows NT (including Windows XP, Windows 2000, and Windows 2003 Server), a tool for installing services is included, which is called "service control" and also supports SC .exe.
1. Install as a service:
For example, my subversion is installed in "D: \ Program Files \ subversion", and the version library is in "D: \ svn_root". I want the corresponding subversion service name to be svnservice, the command for installing the svn service can be written as follows:
SC create svnservice
Binpath = "D: \ Program Files \ subversion \ bin \ svnserve.exe -- service-r d: \ svn_root"
Displayname = "svnservice"
Depend = TCPIP
Note that the preceding command is divided into multiple lines, but it should be in one line during actual execution. In addition, the "-d" option, that is, the daemon mode, is used when svnserve is started previously. It cannot be used here, and the service cannot be started. Similarly, the "-I" and "-T" options cannot be used.
There are two other points to be handled with caution. First, if the path contains spaces, you must use "\" to process the "signature number. If svnserve.exe is in" C: \ Program Files \ subversion, the command should be written as "binpath =" \ "C: \ Program Files \ subversion \ bin \ svnserve.exe \" (Content in ""). The entire command is as follows, the red part is the changed part:
SC create svnservice
Binpath = "\" D: \ Program Files \ subversion \ bin \ svnserve.exe \ "-- service-r d: \ svnroot"
Displayname = "svnservice"
Depend = TCPIP
SC also requires the option format. For example, "depend = TCPIP" cannot be written as "depend = TCPIP" or "depend = TCPIP ", that is, there must be spaces before "=.
2. Start the service
After the command is executed in the command line window, the service has not been started. You can continue to run "Net start svnservice" to start the service.
3. Stop the service
Use "net stop svnservice" to stop the service.
4. delete a service
If there is a problem with the service installation, you may need to delete the service. To delete the previously added service, Run "SC Delete svnservice". "svnservice" is the name we used when creating the service.
5. The configuration service is automatically started.
By default, the installed Service will not start with windows. To enable the svn service to start with windows, you need to modify the "SC create" command (Delete first ), add the "Start = auto" option:
SC create svnservice
Binpath = "D: \ Program Files \ subversion \ bin \ svnserve.exe -- service-r d: \ svn_root"
Displayname = "svnservice"
Depend = TCPIP
Start = auto
Of course, you can also use graphical tools to modify Service Attributes. You can run "services. msc" in "start-> Run..." And then modify the Service Attributes on the interface.
Method 2:
Create a batch file and place it in the Windows Startup Group to run the svn service at startup.
Method 3:
This address http://clanlib.org /~ MBN/svnservice/downloads the svnservice.exe file, copies it to the E: \ SVN \ bin directory, and then runs it from the command line:
Svnservice -- install -- daemon -- root "E: \ SVN \ repository"
SC config svnservice start = auto
Net start svnservice
This file turns SVN into a service in windows and is automatically started by default. Note: When you execute the third sentence, make sure that the svn service that was previously run in the command line mode has been stopped, if the task is not stopped, press Ctrl + C in the window to stop the task.

Related Article

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.