초간단 Subversion 설치 문서라고 할 수 있겠다. 초간단이란 이유는 Apache와의 연동 부분이 빠져 있어 svnserve 를 사용한 서버로 동작시켜 3690 포트 상으로 사용하는 것을 말한다.
즉, http://server-ip 로 시작하는 것이 아니라 svn://server-ip 라고 하는 svn 단독 서버로 동작시키는 방법이다.
(사실, 아파치와 연동하지 않은 것은 이미 아파치+톰캣 형태로 해당 서버를 사용하고 있어서이다. 귀찮이즘...ㅡㅡ;;)
먼저, 서버 환경은 다음과 같다.
- x86
- OS : Redhat ES 4.x
- Subversion : 1.5.1 rpm version
언제나 그렇치만 대부분의 문서가 환경을 언급하지 않아 곤란한 적이 많았다. Subversion 1.1 이상인 경우 특별한 차이는 없지만 그래도 최신 버전을 사용하였다.
그리고 소스를 사용하지 않고 Redhat 에서의 운영때문에 rpm 을 사용하였다.
먼저, Redhat ES 4.x 버전에서 subversion 1.5.1 RPM 버전을 받아서 설치할 경우 에러가 발생한다. 다음과 같은 dependecy가 발생하는 라이브러리들을 설치해 주어야 한다.
일단, 필요한 rpm 파일들을 받아보자.
http://the.earth.li/pub/subversion/summersoft.fay.ar.us/pub/subversion/latest/
위의 URL을 통해서 가장 최신의 subversion을 구할 수 있다. 일단, 여기선 최종 아래의 링크까지 따라가서 rpm 파일들을 사용하였다.
http://the.earth.li/pub/subversion/summersoft.fay.ar.us/pub/subversion/latest/rhel-4/i386/
여기서 받아야 할 파일들은 다음과 같다.
apr-0.9.12-2.i386.rpm
apr-util-0.9.12-1.i386.rpm
neon-0.27.2-1.i386.rpm
subversion-1.5.1-1.i386.rpm
콘솔에서 먼저 subversion-1.5.1-1.i386.rpm 을 설치해 보자. 위에서 이야기한 대로 에러가 발생한다. 때문에 다음과 같이 apr, apr-util을 업데이트 시켜 주어야 한다.
새로 설치가 아닌 업데이트이다. rpm - qa 명령어를 사용하여 apr을 찾아보면 이미 설치가 되어 있기 때문인데 다음과 같이 해서 찾아보고 업데이트 해 준다.
rpm -qa | grep apr
rpm -Uvh ./apr-0.9.12-2.i386.rpm
rpm -Uvh ./apr-util-0.9.12-1.i386.rpm
rpm -ivh ./neon-0.27.2-1.i386.rpm
그리고, subversion을 rpm 형태로 설치하자.
rpm -ivh ./subversion-1.5.1-1.i386.rpm
특별하게 에러가 발생하진 않았다^^
이제 몇 가지 설정을 통해서 svn repository를 만들고, svnserve 를 데몬으로 돌리고 사용자 아이디와 패스워드를 사용하여 접속하게 해 보자.
1. svn repository 만들기
다음과 같이 "/home/svn" 디렉토리로 이동하고, svn repository를 만들자.
cd /home/svn
svnadmin create --fs-type fsfs sample
svnadmin 명령어를 사용하여 repository를 만드는데 옵션 중에 --fs-type 뒤의 fsfs는 파일 시스템을 저장소로 이용한다는 뜻이고, "fsfs" 대신에 "bdb"라고 기입하면 버클리 데이터베이스를 저장소로 사용한다는 뜻이다.
즉, 버클리 데이터베이스를 파일 저장소로 사용하고 싶은 경우 버클리 디비를 설치해 주어야 한다. 여기선 이러한 과정을 생략한 것이다.
리눅스 특성상 특별한 에러를 리턴하지 않으면 정상적으로 repository 를 생성한 것이다.
2. svnserve 데몬
다음과 같이 명령어를 실행해 보자.
svnserve -d -r /home/svn/
"/home/svn" 디렉토리를 저장소로하여 서버 데몬 형태로 subversion 서버를 구동한 것이다.
여기서 잠시 subversion client 를 사용하여 svn://server-ip/sample 라고 접근해 보면 접속되는 것을 확인하고 가는 것이 좋을 거 같다.
만약, subversion client 를 사용하여 위에서 처럼 접속되지 않으면 잘못 설치한 것임으로 원인을 찾아야 할 것이다.
정상적으로 설치가 되면 anonymous 계정으로 권한이 풀린 상태로 접속이 된 것이다.
보통은 아이디/패스워드를 사용하여 subversion을 사용할 것임으로 보안 설정을 해 보자.
3. subversion 보안 설정
"/home/svn/sample" 디렉토리가 repository로 설정되었음으로 해당 디렉토리에 보면 "conf" 디렉토리가 생성되어져 있는 것을 볼 수 있을 것이다.
따라서 다음과 같이 vi 명령어를 사용하여 svnserve.conf 파일을 열어보자.
vi /home/svn/sample/conf/svnserve.conf
파일을 열었다면 다음과 같이 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 = none
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
수정할 부분은 실제론 다음과 같다.
anon-access = none
즉, anonymous 계정의 접근을 허락하지 않는다.
auth-access = write
즉, 사용자의 권한이 read/write 이다. "read"라고 수정하면 read 권한만 가진다.
password-db = passwd
"/home/svn/conf/passwd" 파일을 사용하여 ID=Password 형태로 사용자 권한을 부여한다.
파일을 저장하고, password-db property의 설정에서 지적한 것과 같이 "/home/svn/conf/passwd" 파일에 사용자 ID와 password를 설정해 보자.
여기서 패스워드가 암호화되지 않는다는 것을 명심하고 셋팅해 주어야 한다. 예제는 다음과 같다.
user=password
자, 이제 별도의 재가동 없이도 subversion client를 사용하여 subversion 서버에 연결해 보자. 아이디와 패스워드를 물어볼 것이다.
위에서 설정한 아이디/패스워드를 입력해 주어 정상적으로 접속이 완료되면 성공한 것이다.
이것으로 subversion 설치 과정을 마친도록 한다.
추후에 시간이 되면 eclipse 플러그인(subclipse)를 사용하여 연결해 보는 것도 올리도록 하겠다.
[참고 링크]
http://www.pyrasis.com/main/Subversion-HOWTO : 오랫동안 subversion 설치 문서로 사용되고 있음.
http://blog.jidolstar.com/82 : 위의 설치문서를 보고 재정리 둠.
댓글 없음:
댓글 쓰기