Ubuntu SVN Server Configuration

Source: Internet
Author: User
Tags addgroup auth chmod mkdir svn

2012-11-24 20:20:16|  Category: Linux/unix | Tags: svn ubuntu | report | font size Subscription


One, SVN installation
1. Installation package
$ sudo apt-get install subversion
2. Add SVN Admin user and Subversion Group
$ sudo adduser svnuser
$ sudo addgroup subversion
$ sudo addgroup svnuser subversion
3. Create a project directory
$ sudo mkdir/home/svn
$ cd/home/svn
$ sudo mkdir repos
$ sudo chown-r root:subversion repos
$ sudo chmod-r g+rws repos
4. Create SVN file Warehouse
$ sudo svnadmin create/home/svn/repos

5. Access mode and project import (instance can be ignored):
$ svn Co file:///home/default is repos file

or
$ svn co
file://localhost/
* Note: If you are unsure of the host's name, you must use a three slash (///), and if you specify the name of the host, you must use two slashes (//).

The following command is used to import the project into the SVN file warehouse (instance instance can be ignored ) :
$ svn import-m "New Import "/home/svn/fitness file:///home/svnuser/src/fitness
Be sure to note the importing information

6. Access permission settings
Modify/ Home/svn/fitness directory:
svnserve.conf, passwd, Authz three files, the line at the front end does not allow spaces

Edit svnserve.conf file, the following two lines uncomment
password-db = password
authz-db = Authz
//Supplemental Description
# [general]
Anon-access = read
Auth-access = Write
Password-db = passwd
where anon-access and auth-access permissions for anonymous and privileged users are granted to anonymous users with read-only permissions, but if you want to deny access to a user who is not hiding
, just change read to none to achieve Objective. The
//--
Edit/home/svnuser/etc/passwd is as follows:
[users]
Mirze = 123456
Test1 = 123456
Test2 = 123456
//--


Edit/home/svnuser/etc/authz as follows
[Groups]
admin = Mirze,test1
Test = Test2
[/]
@admin =RW
*=r
Three users are set up here, mirze,test1,test2 passwords are 123456.
where Mirze and test1 belong to the admin group, have read and write permission, test2 belong to the test group only Read permission
7. Start SVN service
svnserve-d--listen-port 3690-r/home/svn/repos
Description Description:
-D indicates that Svnserver is running in "daemon" process mode
-r Specifies the root location of the file system (the root directory of the version library repos) so that clients can access the version library without entering the full path
such as: svn://192.168.1.8/
The SVN installation is complete.
LAN access mode:
For example: SVN checkout svn://192.168.1.8//local/dir
-----------------------------------------------------------------------

two. Service Boot:

Create a script file in the INIT.D directory svnd.sh
# CD/ETC/INIT.D
# Vim Svnd.sh
Enter svnd.sh content as follows (/VAR/SVN for SVN installation directory):

#!/bin/bash
#svnserve Startup
svnserve-d--listen-post 3690-r/home/svn/repos

and then executes:
# update-rc.d svnd.sh Defaults
# chmod 777 svnd.sh
using SVN co svn://192.168.1.8/  /local /dir

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.