Ubuntu server construction-build SVN server with Apache

Source: Internet
Author: User
Tags subversion client
Install the subversion and the corresponding apache module, assuming we have installed the server, to participate in Server Installation section $ sudoapt-getinstallsubversion $ sudoapt-getinstalllibapache2-svn to create a version library, and add a group of subversion, add the user to the group because the default apache Group user in Ubuntu is www-data $ sudoaddgroup.

Install the subversion and the corresponding apache module. Assume that the server has been installed.
$ Sudo apt-get install subversion
$ Sudo apt-get install libapache2-svn

Create a version library, add a group of subversions, and add users to the group, because the default apache Group user in Ubuntu is www-data.
$ Sudo addgroup subversion
$ Sudo usermod-G subversion-a www-data

Create svn version Library
$ Sudo mkdir/home/svn
$ Cd/home/svn

Create an SVN File Repository
$ Sudo svnadmin create/home/svn/myproject
Grant the group members the following permissions to all new files added to the File Repository:
$ Sudo chmod-R g + rws myproject
$ Sudo chown-R root: subversion myproject

Access Method
File: // directly access the file repository on the local hard disk
Http: // use the WebDAV protocol to access Apache 2 Web servers that support Subversion.
Https: // similar to http: //, supports SSL encryption
Svn: // access the svnserve server through the built-in protocol
Svn + ssh: // similar to svn: //, supports the SSH Channel

 


You can perform this operation when testing on the server.

$ Svn co file: // home/svn/myproject

Or

$ Svn co file: // localhost/home/svn/myproject


If so, you can perform remote operations to achieve collaborative development. You must add the following code snippets to your/etc/apache2/mod-available/dav_svn.conf file, which can also be used in http. conf.

DAV svn

SVNPath/home/svn/myproject

AuthType Basic

AuthName "test"

AuthUserFile/etc/subversion/passwd

Require valid-user

Next, you need to create the/etc/subversion/passwd file, which contains the details of user authorization. To add a user, run the following command:

Sudo htpasswd-c/etc/subversion/passwd user_name

Then you can use the following command to access $ svn co http: // hostname/svn/myproject -- username user_name. On windows, you can install the subversion client for testing. After importing the project, you can use svn log to check whether user_name has done anything. So far, a svn server for collaborative development has been successfully built.

For more information about Ubuntu, see Ubuntu special page http://www.linuxidc.com/topicnews.aspx? Tid = 2

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.