Svnserve-based SVN server (installation and configuration in Windows)

Source: Internet
Author: User
Tags tortoisesvn

Svnserve-based SVN server (installation and configuration in Windows)
Keyword: SVN

Install svnserve

From http://subversion.tigris.org/servlets/ProjectDocumentList? Folderid = 91 to get the latest version of subversion.
If you have installed subversion and svnserve is running, you need to stop it before continuing.

Run subversion InstallationProgramIf you are running on your server, skip step 1.

Open the resource manager and go to the Subversion installation directory (usually the bindirectory of C: Program filessubversionplugin, find the file svnserve.exe, intl3_svn.dll, libapr. DLL, lib1_conv. DLL, libapriutil. DLL, libdb *. DLL, libeay32.dll, and ssleay32.dll. Copy these files or all the files in the bin directory to your server directory, such as C: svnserve.

Run svnserve

Now that svnserve has been installed, you need to run it on your server. The simplest way is to enter in the DOS window or windows shortcut:

Svnserve.exe -- daemon
Svnserve will wait for the request on port 3690, and the -- daemon option tells svnserve to run in daemon mode, so that it will not exit before manual termination.

If you have not created a version library, follow the Apache server setting command "configuration" section below.

To verify that svnserve works properly, use the tortoisesvn → version library browser to view the version library.

Assume that your version library is in C: repostestrepo. Your server is called localhost. Enter:

SVN: // localhost/repos/testrepo
When prompted by the version library browser.

You can also use the -- root option to set the root location to restrict access to the server directory, so as to increase security and save time for inputting the svnserve URL:

Svnserve.exe -- daemon -- root drive: pathtorepositoryroot
For example, in the previous test, the current run command of svnserve is:

Svnserve.exe -- daemon -- root C: Repos
In tortoisesvn, the browser URL of our version library is shortened:

SVN: // localhost/testrepo
Note that the -- root option is also required when svnserve and version library are located in different partitions or drive letters.

Svnserve can provide any number of version library services. You just need to put these version libraries under the root directory you just defined, and then access them using the URL relative to the root.

Warning

Do not create and access the Berkeley DB version library on the network share. It cannot exist in a remote file system, even if it is mapped to the drive letter share. If you want to share Berkeley dB on the Internet, the results are unpredictable-you may immediately see a strange error, or you may find that the database has been damaged a few months later.

 

Run svnserve as a service

 

Using common users to run svnserve directly is usually not the best method. It means that your server must have a user login and remember to restart the server and then restart svnserve. The best way is to run svnserve as a Windows service. From subversion 1.4, svnserve can be installed as a Windows service.

To install svnserve as a Windows Service, run the following command in one line to create a service that is automatically started after Windows is started.

SC create svnserve binpath = "C: svnservesvnserve.exe -- service -- root C: repos" displayname = "Subversion" depend = TCPIP start = auto
If any path contains spaces, you must use double quotation marks (escape characters) to include the path. For example:

SC create svnserve binpath = "" C: Program filessubversionbinsvnserve.exe "-- service -- root C: repos" displayname = "Subversion" depend = TCPIP start = auto
After creating a service, you can add descriptions. It is displayed in Windows Service Manager.

SC description svnserve "Subversion server (svnserve )"
Note that the SC command line is special. In the key = value pair, there must be no space between key and =, but a space before value.

Prompt

Microsoft recommends that service programs run with local services or network service accounts. For details, see the services and service accounts security planning guide. To create a service using a local service account, you need to append the following lines in the preceding example.

OBJ = "nt authoritylocalservice"
Note that you need to grant appropriate permissions to some directories of the local service account, including the subversion, your version library, and all applications used by hook scripts. The built-in group name of this account is "local service ".

After the service is installed, you need to start it in the Service Manager (this time only; when the server is restarted, it will automatically start ).

For more information, see Windows Service Support for svnserve.

If you have already installed the early svnserve using the svnservice packaging and want to use the built-in service, you need to delete it from the Service (remember to stop the service first !). Use simple commands

Svnservice-Remove
To delete the service.

Svnserve Authentication

The default svnserve configuration provides anonymous read-only access. This means you can use the svn: // URL for check and update, or use the tortoisesvn version library browser to view the version library, but cannot submit any modifications.

To enable write access to the version library, you can edit the conf/svnserve. conf file in the version library directory. This file controls the configuration of the svnserve daemon and provides useful documents.

To enable Anonymous write access, you only need to set it easily:

[General] anon-access = write
However, you don't know who modified the version library, because the svn: Author attribute is empty, and you cannot control who modified the version library. This is a very dangerous setting.

One way to solve this problem is to create a password database:

[General] anon-access = noneauth-access = writepassword-DB = userfile
Here, userfile and svnserve. the conf file is in the same directory. This file can also be stored in other parts of the file system (this is especially useful when multiple version libraries use the same access permissions) and can use an absolute path, or the relative directory of the conf file. The userfile structure is as follows:

[General] anon-access = noneauth-access = writepassword-DB = userfile
In this example, all unauthenticated users (anonymous) are denied access and the user's read and write permissions in userfile are granted.

Prompt

If you use the same password to maintain multiple versions of the database, using one authentication domain will make your work easier. Because tortoisesvn can cache your creden, you only need to enter it once, for more information, refer to the Subversion manual to create user files and domain and client credential caches.

Use SVN + SSH Authentication

Another method for svnserve authentication is to use SSH to establish a request channel.

By using this method, svnserve will not be started as a daemon, but SSH will start svnserve for you and use SSH to authorize users to run it. Therefore, you need to have an SSH daemon on your server.

It is beyond the scope of this documentation to detail the installation and setup of a Secure Shell, however you can find further information in the tortoisesvn FAQ, ssh how-. you can find other SSH topics within the FAQ by searching for "ssh ".

For more information about svnserve, see Use Subversion for version management.

Svnserve path-based authorization
From subversion1.3, svnserve supports the authorization mode based on the same path as mod_authz_svn. You need to edit the authorization file referenced by CONF/svnserve. conf in the version library path.
[General] authz-DB = authz
Here, authz is the file you created to define access permissions. You can use a separate file for each version library or use the same file for all version libraries, for details about the file format, refer to the "Path-based authorization" section.

Support SASL

From subversion 1.5.0, svnserve and tortoisesvn support SVN: // Cyrus SASL (simple authentication and security layer ). You can find more information in subversion program notes: use Cyrus SASL authentication in subversion.

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.