Five access methods for svn-Subversion

Source: Internet
Author: User
Tags password protection ssl connection
SVN access method

The Subversion File Repository can be accessed (checked out and checked out) in many different ways-either through a local hard disk or through various network protocols. In any case, the location of the File Repository is always represented by a URL. The following table shows the access methods for different URL modes:

Mode Access Method
File :/// Direct access to the file warehouse on the local hard disk
Http :// Use the WebDAV protocol to access Apache 2 Web servers that support Subversion
Https :// Similar to http: //, SSL encryption is supported.
SVN :// Access the svnserve server through the built-in protocol
SVN + SSH :// Similar to SVN: //, supports the SSH Channel

 

Here, we will only introduce http: // multi-database access. Because of its representativeness, it contains all the basic configurations and logs are recorded here.

Functions:

MD5 encryption (use-M encryption of Apache htpasswd)

Http: // access (mod_dav_svn.so and mod_authz_svn.so of Apache)

Multi-version database coexistence and easy-to-manage independent configuration files (subversion. conf)

Operation on any file in the library file (this is a single SVN: // cannot be achieved)

No extra ports need to be opened

 

 

 

--------------------------------------------------- Installation -----------------------------------------------------

Yum install subversion httpd mod_dav_svn

# You only need to download the latest three configuration sources. Apache can be modified from person to person. The main file is supported by the mod_dav_svn module of Apache.

 

 

-------------------------------------------------- Configure ----------------------------------------------------

The root directory of the database is/home/SVN. Multiple databases are created under the root directory.

# First database:

Mkdir/home/SVN/datesvn

Svnadmin create/home/SVN/datesvn

# Second database:

Mkdir/home/SVN/datesvn1

Svnadmin create/home/SVN/datesvn1

 

 

 

 

# For unified management, all configurations are configured in the first database datesvn and then directed to the configuration file location through Apache, so there is no need to write two configuration files.

VI/home/SVN/datesvn/authz

[Groups] # assign a group for Directory Access
Admin = CH
Docs = Test2


# Database of datesvn
[Datesvn:/]
Ch = RW

 

[Datesvn:/test] # The permission for the test folder in the datesvn Database
@ Docs = R # @ indicates all the members of the group's docs. The top member is the independent member ch.

 

# Database of datesvn1

[Datesvn1:/] # Here [/] [datesvn:/] [datesvn1:/] actually means/home/SVN,/home/SVN/datesvn /, /home/SVN/datesvn. Of course, the [/] Directory is not recommended here.
@ Docs = RW

# Permissions include R, W, RW, And none. Do not do anything like * = R or * = RW. If you have configured a firewall, you should know that the principle is to first close the firewall and then open it. To ensure security, by default, subserve is accessible only when it is written in the directory of the configuration file, but cannot be accessed if it is not written. That is to say, by default, if you do not write anything, it cannot be accessed, that is, closed. Then write down the Directory and permissions, so that there will be no conflicting access rules. For example, if your default access permission in the root directory is R, that is, * = r, do you think that even if you set w later, there will be no problem? I cannot write in any way, as long as there is * = R. Someone wrote this, but I cannot figure out the reason for writing this. Maybe it's a readable library.

 

 

VI/etc/httpd/CONF. d/subversion. conf

<Location/>
Dav SVN
Svnparentpath/home/SVN/# Set the root directory, that is, the root directory of all database files, such as/home/SVN/datesvn and/home/SVN/datesvn1, is/home/SVN
# Svnpath/home/SVN/datesvn # Here is the directory for setting a single library. If there is only one library, you can use this

# <Limitaskt get PROPFIND Options Report>
# Require SSL connection for password protection.
# Sslrequiressl

Authtype basic
Authname "authentication information" # prompt information during SVN connection, which can be manually modified
Authzsvnaccessfile/home/SVN/datesvn/CONF/authz # permission configuration file for file access. You need to create a file. This is not available on the official website. You need to add it on your own.
Authuserfile/home/SVN/datesvn/CONF/passwd # specify the password file
Require valid-user # Only authenticated users can access the service, which is similar to firewall rejection.
# </Limit10000t>
</Location>

 

# Add an accessible user

Htpasswd-C/home/SVN/datesvn/CONF/passwd ch

Htpasswd/home/SVN/datesvn/CONF/passwd Test2

For more information about how to use htpasswd, see my other article.

 

 

Service httpd restart

# The above is a simple template written by an individual after reading the document. For better suggestions, contact me.

 

/* --------------------------------------------------------------- Introduction ------------------------------------------------------------------------

These files in/home/SVN/datesvn/conf are the main configuration files:

Svnserve. conf: SVN service configuration file. Apache has similar functions. Therefore, this file is not used because it is not used.
Passwd: password file.
Authz: Permission configuration file.

 

 

 

After mod_dav_svn is installed, it is displayed in the conf. d directory of Apache by default.Mod_dav_svn.so and mod_authz_svn.so

AndSubversion. conf, of course you will see,

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

You have already written the call for it. You do not need to write it again in the main configuration file HTTD. conf.

 

 

 

Permission problems

# To create a new repository "http: // localhost/repos/stuff" using
# This configuration, run as root:
#
# Cd/var/www/SVN
# Svnadmin create stuff
# Chown-r Apache. Apache stuff
# Chcon-r-t httpd_sys_content_t stuff

Subversion is written in and must be accessible by Apache. If SELinux is enabled, chcon-r-t httpd_sys_content_t stuff is required.

*/

 

After configuration, add, delete, modify, and query the following files:

 

Add User htpasswd/home/SVN/datesvn/CONF/passwd user

Modify permission VI/home/SVN/datesvn/authz

Service httpd reload

 

Access Method

Http: // ip/datesvn

Http: // ip/datesvn1

You can also configure domain name access.

 

For more details, refer to the Subversion Chinese network. It is relatively simple to install the version, but there is no good example for more detailed function customization.

Http://wiki.ubuntu.org.cn/SubVersion

Five access methods for svn-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.