SVN 서버 설치 / 저장소 만들기 / 서버 설정하기
다운로드 주소 : http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=91
파일 : Setup-Subversion-1.5.6.msi or svn-win32-1.5.6.zip
받을 파일의 압축을 푼다. 필자의 경우 (C:\Python25\svn-win32-1.5.6)에 압축을 풀었다.
SVN의 해당 패스를 등록한다. (윈도우7 기준 : 내컴퓨터 > 우측 버튼 속성 > 시스템보호 > 고급 > 환경 변수)
시스템 변수 에 svn~~`\bin을 등록한다. 아래 그림을 참조한다.
콘솔 창을 띄우고(명령 프롬프트 : 윈도우 키 > 실행 > cmd)
저장장소로 이동한다. (필자의 경우 C:\Python25\Repository에 디렉토리를 만들었다.)
svnadmin create LoveHouse를 입력한다. LoveHouse는 프로젝트 이름이다. ^^
실행하게 되면 LoveHouse의 디렉토리에 SVN 설정과 관련된 디렉토리와 파일이 생성된다.
다음으로는 SVN 프로토콜을 사용하기 위한 서버 설정을 해주어야 한다.
해당 프로젝트 SVN 설정으로 이동한다. (필자의 경우 C:\Python25\Repository\LoveHouse\conf)
svnserve.conf파일에서 붉은색 부분의 주석(#)을 제거 한다.
[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 |
anon-access 항목의 설정은 로그인하지 않는 사용자에게 접근 권한을 설정하는 부분이다.
anon-access 항목은 read, write, none 세 가지 값으로 설정할 수 있다.
read는 읽기 권한, write는 쓰기 권한, none는 읽기와 쓰기 권한을 허용하지 않는 설정이다.
auth-access 항목의 설정은 로그인한 사용자에 대한 접근 권한을 설정하는 부분이다.
auth-access 항목도 anon-access 항목과 같이 read, write, none 세 가지 값을 가진다.
passwd-db 항목은 저장소에 접근할 사용자 계정과 비밀번호 관리할 파일의 이름을 지정하는 것이다.
기본 파일 이름은 passwd를 사용하며, 다른 이름을 사용할 수도 있다.
authz-db 항목은 파일과 디렉토리에 대한 접근 권한을 관리하는 파일의 이름을 지정하는 것이다.
기본 파일 이름은 authz를 사용하며, 다른 이림을 사용할 수 있다.
다음으로 passwd 설정을 한다.
passwd를 메모장이나 워드패드를 통해서 열게 되면 아래와 같이 보이게 된다.
새로운 사용자를 추가하려면 사용자 아이디 = 비밀번호로 입력하면 된다.
예를 들어 admin이라는 사용자의 패스워드가 admin이라면 admin = admin으로 입력하면 된다.
다음으로는 authz 파일의 설정이다. 같은 디렉토리 (필자의 경우 C:\Python25\Repository\LoveHouse\conf)에 authz라는 파일을 열어보자.
이 파일의 경우 사용자와 그룹별로 각 디렉토리, 파일에 대한 접근 권한을 설정할 수 있다.
경로 | 설명 |
[foo/bar] | /foo/bar 디렉토리에 대한 접근 권한 설정이다. 저장소가 하나일 때 유용하게 사용할 수 있다. |
[/trunk:/pom.xml] | /trunk 디렉토리의 pom.xml 파일에 대한 접근 권한 설정이다. |
[LoveHouse:/bar/fuz] | LoveHouse 저장소의 /bar/fuz 디렉토리에 대한 접근 권한 설정이다. 여러개의 저장소에서 authz 파일을 공유할 때 사용한다. |
[LoveHouse:/trunk/pom.xml] | LoveHouse 저장소의 /trunk 디렉토리 아래에 pom.xml 파일에 대한 접근 권한 설정이다. |
권한 설정 예제 | 설명 |
harry = rw | harry 아이디를 쓰는 사용자에게 읽기(r), 쓰기(w) 권한이 있다. |
&joe = r | joy 그룹에 읽기(r) 권한이 있다. 권한을 설정할 때 그룹 앞에는 &을 사용한다. |
sally = | sally 아이디를 쓰는 사용자는 설정한 경로에 접근할 권한이 없다. |
[groups]
[LoveHouse:/] |