Ubuntu Server build SVN Service and migration method "Go"

Source: Internet
Author: User
Tags svn

Transferred from: http://www.linuxidc.com/Linux/2013-05/84693.htm

Ubuntu Server build SVN service and Migration method

Use apache+svn,http access mode.

Make sure that Apache is installed and not installed with the following command:

    1. sudo apt-get install apache2  

Then install subversion and Svn-apache connection libraries:

    1. sudo apt-get Install subversion
    2. sudo apt-get install libapache2-svn

Add SVN user groups to manage SVN and add to Www-data's Apache group:

    1. sudo addgroup subversion
    2. sudo usermod -G Subversion -a www-data

You can then create the SVN project repository:

  1. # project warehouses can typically be built into the/HOME/SVN directory
  2. # If the project name is MyProject, create an empty directory first
  3. $ sudo mkdir /home/svn
  4. $ cd /home/svn
  5. $ sudo mkdir myproject
  6. $ sudo chown -R root:subversion myproject
  7. #创建为svn项目, use the following command
  8. $ sudo svnadmin create /home/svn/myproject
  9. # then give the group members the appropriate permissions for all newly added files to the file repository:
  10. # If the order is wrong, you may get an error, please refer to the official Wiki
  11. $ sudo chmod -R g+RWS myproject

Finally, configure Apache to access the SVN service with the HTTP protocol:

    1. # This file is automatically generated when LIBAPACHE2-SVN is installed
    2. $ sudo vi /etc/apache2/Mods-available/dav_svn. conf

Edit the dav_svn.conf configuration file, there are comments, you can remove the previous # to make the statement effective, the final content is probably as follows:

    1. <location/svn> #/svn represents http://hostname/svn/myproject
    2. DAV SVN
    3. SVNPARENTPATH/HOME/SVN #配置仓库父目录
    4. AuthType Basic
    5. AuthName "Tofishes Project Svn"
    6. AUTHUSERFILE/ETC/SUBVERSION/PASSWD #svn用户文件
    7. Authzsvnaccessfile/etc/subversion/authz #授权访问文件
    8. Require Valid-user
    9. </Location>

The SVN user file/etc/subversion/passwd and the authorized Access file/etc/subversion/authz are not present and need to be created manually.

SVN user files can be created by command:

    1. #首次创建需要加-C option to add an SVN user
    2. #执行该命令会提示为新用户user_name设置密码
    3. sudo htpasswd -c /etc/subversion/passwd user_name
    4. #以后添加新用户, you need to remove the-c option, or the previous user is destroyed
    5. sudo htpasswd /etc/subversion/passwd new_name

Users can add, and require administrative authorization, for multiple SVN projects to divide different groups of users:

Edit the authorization file with Vi/etc/subversion/authz, no files are edited and saved automatically, do not worry.

The authorization file content format is as follows:

  1. #用户组指令
  2. [groups] 
  3. #格式为  Group name = user Name 1, user Name 2
  4. = User1, user2  
  5. = User1, user3  
  6. #other groups ...
  7.   repository name for #格式为 SVN project: corresponding directory
  8. [svn_repository_name:/] 
  9. #设置组的权限, R=read, W=write
  10. @group1= rw 
  11. [svn_repository_name2:/web/css]    
  12. @group2= rw 

After the last restart Apache:sudo/etc/init.d/apache2 restart. So the work is all done.

What is the access address, as long as the current server is already bound to a domain name, and the virtual host of this domain name is enabled in Apache.

For example, to access http://www.linuxidc.com/normally, the access address of the SVN project is the http://www.linuxidc.com/svn/project name.

Ubuntu Server build SVN Service and migration method "Go"

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.