Complete SVN installation and simple use

Source: Internet
Author: User

Install

1. obtain resources

(1) Apache HTTP Server 2.0.55 . Used for integration with SVN

(2) svn- 1.3.2 -Setup.exe SVN Server

(3) tortoisesvn- 1.3.2 . 5840-svn-1.3.0.msi SVN Client

(4) languagepack _ 1.3.2 _ Zh_cn.exe tortoise Language Pack

(5) A third-party tool of svnservice.zip SVN that uses SVN for Windows Background services

Ii. Installation

You can directly install steps 1, 2, 3, and 4 above. Note that you need to restart them after installation 3 and installation 4, then extract 5 to the bin directory under the installation directory in 2. Now installation is complete

Iii. Configuration

There is nothing special to configure. You can use it after installation. You can use the client tool 3 to right-click an empty folder and create a file library here. An SVN repository file is created. We recommend that you do not specify a specific name for Apache integration. Then, go to the project or the file or folder to which you want to add version control. Right-click the file and choose import from the shortcut menu, in the displayed dialog box, enter the repository address. After the import is completed, a complete file version is generated.

Note: by default, the client in 3 imports the sub-folder of the current folder. If you want to import the sub-folder of the current directory, put it in a folder and then perform the import operation.

Then configure the Repository: Go to the conf file in the repository directory, find the svnserve. conf file, and

[General]

Anon-access = read

Auth-access = write

Password-DB = passwd

Realm = my first Repository

Remove the # sign in front of it, and then remove the space in front of it. Save.

Here: Anon-access refers to the anonymous access permission, which can be read, write, or none. The default value is read.

Auth-access indicates the permission to authenticate the user. It can be read, write, or none. The default value is write.

Password-DB refers to the path of the password database, removing the previous one, storing the user name and password for authentication, username = passwd

Then modify the passwd file.

1. Remove the # above [users]. Otherwise, SVN can only Log On As an anonymous user, and the client will not display a logon window. An error will be returned unless your anon is not none.

2. Add username and password username = Password

4. Start the svn Server

For a single code repository

Start command svnserve-d-r/home/svnrepo -- listen-host 192.168.100.200

-D Indicates running in the background, and-R specifies the root directory of the server, so that you can directly access the server using SVN: // server IP address. If the server has multiple IP addresses, use listen-host to specify the IP address of the listener.

We can access the svn server through SVN: // 192.168.100.200 on the svn client.

For multiple code repositories, you can use the-r option to specify the server root directory at startup. However, you need to write the relative path of Each repository relative to the svn root directory during access.

For example, we have two code repositories:/home/repoa and/home/repob. We use svnserve-d-r/home -- listen-host 192.168.100.200 to start them, when accessing the client, you can use SVN: // 192.168.100.200/repoa and SVN: // 192.168.1.200/repob to access two projects respectively.

After the process is started, we can use PS aux | grep svnserv to check whether the svnserve process exists.

V. Open Server ports

The default SVN port is 3690. You need to open this port on the firewall.

You can also use the -- listen-port option of svnserve to specify an opened port. However, in this case, the client must use the local port, such as SVN: // 192.168.100.200: 9999 /.

6. Integration with Apache

Various methods for accessing Repository

SVN has abstracted the access to the repository during design. Therefore, in theory, as long as it is a method that can be used to send data or can be determined by others, you can use it to access repository.

In practice, SVN currently supports a limited number of access methods, but it also has more access than the original CVs, and can be used in the future. The SVN Method for accessing repository must be specified in the Parameter Setting section of the URL, which can be:

File :///

Directly access the repository in the local disaster recovery system.

Http ://

Through the Apache server that supports SVN (in the form of module), access through WebDAV

Https ://

WebDAV is used, but SSL is added.

SVN ://

Depends on the region of the self-built database, and uses svnserve to access the repository.

SVN + SSH ://

Same as SVN: //, but it is set as tunnel through SSH protocol

 

Another common way to use SVN is to integrate it with Apache. Access the Code through the HTTP protocol, view the Code through the web interface, and perform permission Authentication through the security control of the HTTP server.

The installation points are as follows:

0. Assume that Apache is installed to D: \ apache2.

1 copy % svn_home % \ bin \ libdb42.dll, libeay32.dll, and ssleay32.dll to % apache_home % \ bin

2 Copy % svn_home % \ httpd \ *. So to % apache_home % \ modules

3. Modify % apache_home % \ conf \ httpd. conf to add or modify:

Loadmodule dav_module modules/mod_dav.so

Loadmodule dav_fs_module modules/mod_dav_fs.so

Loadmodule dav_svn_module modules/mod_dav_svn.so

Loadmodule authz_svn_module modules/mod_authz_svn.so

4. Add/SVN in <virtualhost> <location>

<Location/svnserver>

Dav SVN

Svnpath D:/svndir/taowap

</Location>

5. Restart Apache and access http: // localhost/svnserver through a browser to view the Subversion information.

In terms of access control, you can use Windows domain user authentication. You can also use MySQL, passwd files, LDAP, and other authentication methods supported by Apache.

Here I use the file method. First, create a file to save the password. If you do not need to encrypt the password, add the-p parameter to generate plain text.

% Apache_home % \ bin \ htpasswd-C-P d: \ passwd \ passwords user1

The generated file is as follows:

# Username: Password

User1: 123456

If you want to control permissions by group, you can create a groups file at the same time with the following content:

# Format: groupname: username1 username2

Svngroup: user1 user2

Add the permission Control Section to/svnserver in httpd. conf:

<Location/svnserver>

Dav SVN

# Point to the root of SVN Repository

Svnpath D:/svnrepo

Authtype basic

Authname "Subversion repository"

Authuserfile D:/passwd/passwords

Authgroupfile D:/passwd/groups

Require group svngroup

</Location>

Restart the server and browse http: // localhost/svnserver. In the security dialog box, enter the user name and password.

VII. Appendix: svnserve [Option]
Valid options:
-D [-- daemon]: Background Mode
-- Listen-port Arg: Listener port (background Mode)
-- Listen-host Arg: Listener host name or IP address (in background Mode)
-- Foreground: run on the foreground (useful for debugging)
-H [-- help]: displays the help
-- Version: displays version information.
-I [-- inetd]: inetd Mode
-R [-- root] Arg: Service root directory
-R [-- Read-Only]: Disagree; Use the archive configuration file
-T [-- tunnel]: tunnel mode
-- Tunnel-user Arg: tunnel user name (the mode is the name of the current user UID)
-T [-- threads]: Use a thread to replace a process.
-X [-- listen-once]: listens once (useful for debugging)

 

Reference: http://doc.zoomquiet.org/data/20050617140221/

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.