예를 들어
/home/svn 이 svn의 저장소를 놓을 위치이고
그 아래에 각각의 프로젝트가 들어 간다면

저장소의 위치는 /home/svn이다.

svnserve -d로 구동할때 의 경로는 /home/svn이 되고
svn으로 checkout을 할때의 경로는 각 프로젝트를 넣어 준다.

예를 들어

/home/svn/proj1
/home/svn/proj2
가 있다면

svn://svnserver.ip.addr/proj1
이런식으로 접속하면 프로젝트에 대해서 보인다.

음.. 그런데 굳이 각각의 저장소로 여러개의 저장소에 구분을 해야 하는 이유가 있을려나..
그냥 repos 이런식으로 하나의 저장소만을 만들고
그 아래에 디렉토리/폴더로 구분하면 될텐데 말이다...

아무튼 각 저장소별 ./conf 디렉토리에는
passwd / auth / svnserve.conf가 존재하며

svnserve.conf의 주석 몇개와
passwd에 사용자 계정을 추가하면
svn:// 식으로 접속하여 사용이 가능하다.
svn+ssh://은 아직.. OTL


svnserve.conf
### This file controls the configuration of the svnserve daemon, if you
### use it to allow access to this repository.  (If you only allow
### access through http: and/or file: URLs, then this file is
### irrelevant.)

### Visit http://subversion.tigris.org/ for more information.

[general]
### These options control access to the repository for unauthenticated
### and authenticated users.  Valid values are "write", "read",
### and "none".  The sample settings below are the defaults.
anon-access = read
auth-access = write
### The password-db option controls the location of the password
### database file.  Unless you specify a path starting with a /,
### the file's location is relative to the directory containing
### this configuration file.
### If SASL is enabled (see below), this file will NOT be used.
### Uncomment the line below to use the default password file.
password-db = passwd
### The authz-db option controls the location of the authorization
### rules for path-based access control.  Unless you specify a path
### starting with a /, the file's location is relative to the the
### directory containing this file.  If you don't specify an
### authz-db, no path-based access control is done.
### Uncomment the line below to use the default authorization file.
# authz-db = authz
### This option specifies the authentication realm of the repository.
### If two repositories have the same authentication realm, they should
### have the same password database, and vice versa.  The default realm
### is repository's uuid.
# realm = My First Repository

[sasl]
### This option specifies whether you want to use the Cyrus SASL
### library for authentication. Default is false.
### This section will be ignored if svnserve is not built with Cyrus
### SASL support; to check, run 'svnserve --version' and look for a line
### reading 'Cyrus SASL authentication is available.'
# use-sasl = true
### These options specify the desired strength of the security layer
### that you want SASL to provide. 0 means no encryption, 1 means
### integrity-checking only, values larger than 1 are correlated
### to the effective key length for encryption (e.g. 128 means 128-bit
### encryption). The values below are the defaults.
# min-encryption = 0
# max-encryption = 256

passwd
### This file is an example password file for svnserve.
### Its format is similar to that of svnserve.conf. As shown in the
### example below it contains one section labelled [users].
### The name and password for each user follow, one account per line.

[users]
# harry = harryssecret
# sally = sallyssecret
userid = password

위의 경우는 사용자명 userid, 암호가 password인 경우이며,
svn에 수정/삭제 시 아래와 같이 인증을 요구하게 된다.



[참고 : http://www.pyrasis.com/main/Subversion-HOWTO#s-4.3]
Posted by 구차니
CollabNet Subversion Server and Client v1.5.5 (for Windows) 를 다운로드 하려면 가입이 필요하다.

설치 화면은 간단한데 svnserve와 apache용 MOD_DAV_SVN을 옵션으로 고를 수 있다.

svn 서버 설정화면으로 포트와 repository를 정해주면 된다.

설치를 완료 하면 자동으로 c:\svn_repository 가 생성된다.
하지만 내용이 하나도 없어서 svn이 접근을 하지 못한다는 에러가 발생한다.

그리고 "Install svnserve to run as Windows service" 일뿐, service가 실행되지는 않는다.
물론 리부팅하면 자동으로 시작이 되긴하겠지만, 설치 직후 안된다면 service가 실행시켜 주면 된다.


authorization failed가 뜨면 아래의 링크를 참조하여 해결하면 된다.

5) Configure permissions for the repository

  • Open with notepad the repository configuration C:\SVNREPOSITORY\conf\svnserve.conf
    and paste just the following lines (remove everything else):
    [general]
    anon-access = none
    auth-access = write
    password-db = passwd.conf
    authz-db = authz.conf
    #realm = My First Repository

    Please note that I renamed "passwd" to "passwd.conf" and "authz" to "authz.conf" both
    in the config file here, and in the filesystem too, so I can just associate the conf extension with notepad and make my life easier.

    Note also that when a realm is not specified, it will be assumed to be the repository guid (created when you created repository). Realms should be unique among different repositories, unless you want to share the same permissions among them.
  • Rename authz to authz.conf
  • Rename passwd to passwd.conf
  • Open passwd.conf with notepad and put some users/passwords by pasting the following lines (remove everything else):
    [users]
    admin = qwerty147
    ricardo = pwd123
    marcelo = pwd456
    joao = pwd789
  • Now open authz.conf with notepad and paste just the following lines (remove everything else):
    # guests will have read permission in all repository
    # writers must include all non-admin users who must have write
    #    permission on some folder (read permission on root is needed for that)
    [groups]
    admins = admin, ricardo
    writers = marcelo
    guests = joao
    project1 = marcelo

    [/]
    @admins = rw
    @writers = r
    @guests = r
    * =

    # please note that permissons (ex: admins group) don't propagate from root to subprojects
    [/Project1]
    @project1 = rw
    @admins = rw
    * =
  • Now you can try again mkdir:
    C:\>svn mkdir svn://localhost/Products
    Authentication realm: e9852c7c-f11f-1946-b4a8-49fa8b53a267
    Password for 'Ricardo': ******


    Please note that it will by default assume your username is the same as your windows login. If it is not, just put any password, and it will ask you for your correct username.
  • If everything went ok you will get a message like "Committed revision 1"

    Congratulations! You have made your first change to the repository.

    Now let's create another folder: C:\> svn mkdir svn://localhost/Projects
    The password won't be asked this time, because it's cached for your user (Documents and settings\username\Application Data\Subversion\auth\)

[출처 : http://www.smarter-technologies.com/smarter/Default.aspx?tabid=128&EntryID=12]

svn_repository의 내부 구조 & conf 내용물들

svnserve.conf의 기본 내용. 전부 주석처리다 ㄱ-

passwd는 사용하는 계정에 대한 아이디/암호를 저장한다.

이녀석은.. 아무튼 인증파일이다. 특정 리파지터리에 특정 유저의 권한을 설정한다.



심심해서 해본 뻘짓

[다운로드 : http://www.collab.net/downloads/subversion/] <- 가입필요
[다운로드 : http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=91]

'프로그램 사용 > Version Control' 카테고리의 다른 글

CVS / SVN 차이점?  (2) 2009.03.06
SVN 사용기  (0) 2009.03.05
TortoiseSVN 사용하기  (2) 2009.02.26
TortoiseSVN - Svnserve Based Server  (5) 2009.02.26
cvs 서버 설치 / 복원  (2) 2009.01.22
Posted by 구차니