Using tuserver to build svn services and migration methods

Source: Internet
Author: User
UbuntuServer sets up svn services and migration methods using apache + svn and http access. First confirm the installation of apache, without installation, use the following command: sudoapt-getinstallapache2 and then install subversion and svn-apache Connection Library: sudoapt-getinstallsubversionsudoapt-getinst

Build svn service and migration method on Ubuntu Server

Apache + svn and http access are used.

Make sure that apache is installed. If apache is not installed, run the following command:

  1. sudo apt-get install apache2

Then install the subversion and svn-apache Connection Library:

  1. Sudo apt-get install subversion
  2. Sudo apt-get install libapache2-svn

Add the svn user group to manage svn and add it to the apache Group of www-data:

 

  1. Sudo addgroup subversion
  2. Sudo usermod-G subversion-a www-data

Then you can create the svn project Repository:

  1. # Generally, you can create a project repository to the/home/svn directory.
  2. # Assume that the project name is myproject and an empty directory is created first.
  3. $ Sudo mkdir/home/svn
  4. $ Cd/home/svn
  5. $ Sudo mkdir myproject
  6. $ Sudo chown-R root: subversion myproject
  7. # Create an svn project by running the following command:
  8. $ Sudo svnadmin create/home/svn/myproject
  9. # Then, the group members are granted the corresponding permissions to all the files added to the file warehouse:
  10. # If the command order is wrong, an error may be reported. Refer to the official wiki
  11. $ Sudo chmod-R g + rws myproject

Finally, configure apache and Use http to access the svn service:

  1. # This file is automatically generated when the libapache2-svn is installed
  2. $ Sudo vi/etc/apache2/mod-available/dav_svn.conf

Edit the configuration file dav_svn.conf with comments. You can remove the previous # To make the statement take effect. The final content is roughly as follows:

  1. #/Svn indicates http: // hostname/svn/myproject
  2. DAV svn
  3. SVNParentPath/home/svn # configure the repository parent directory
  4. AuthType Basic
  5. AuthName "ToFishes Project Svn"
  6. AuthUserFile/etc/subversion/passwd # svn User File
  7. AuthzSVNAccessFile/etc/subversion/authz # authorize File Access
  8. Require valid-user

Svn user files/etc/subversion/passwd and authorized access files/etc/subversion/authz do not exist and need to be created manually.

Svn user files can be created using commands:

  1. # Add the-c option for the first creation, and add a svn user
  2. # Executing this command will prompt you to set a password for the new user user_name
  3. Sudo htpasswd-c/etc/subversion/passwd user_name
  4. # Remove the-c option when adding new users. Otherwise, the previous users will be destroyed.
  5. Sudo htpasswd/etc/subversion/passwd new_name

The user can be added, and management authorization is required for multiple svn projects, divided into different user groups:

Use vi/etc/subversion/authz to edit the authorization file. If no file exists, the file is automatically created after being edited and saved. Do not worry.

The authorization file format is as follows:

  1. # User group commands
  2. [groups]
  3. # Format: group name = username 1, username 2
  4. group1 = user1, user2
  5. group2 = user1, user3
  6. #other groups...
  7. # Repository name in the format of svn project: corresponding directory
  8. [svn_repository_name:/]
  9. # Set group permissions, r = read, w = write
  10. @group1= rw
  11. [svn_repository_name2:/web/css]
  12. @group2= rw

Restart apache after modification: sudo/etc/init. d/apache2 restart. This completes all the work.

What is the access address? As long as the current server has been bound to a domain name and the virtual host with this domain name enabled in apache.

For example, if you can access the http://www.linuxidc.com/normally, the svn Project access address is http://www.linuxidc.com/svn/project name.

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.