티스토리 뷰

Programing

Subversion 설치(linux)

애플자라 2012. 2. 2. 14:03
반응형

소스 관리를 위해 사용되는 SVN 서버를 설치하는 방법을 소개할까 합니다.

 

Subversion을 설치합니다(yum을 이용하였습니다).

 

# yum install -y subversion

 

저장소 디렉터리를 생성합니다. 디렉터리는 임의로 지정 가능합니다.

 

파일 시스템을 이용한 방식

# svnadmin create --fs-type fsfs /var/repos

 

버클리DB를 이용한 방식

# svnadmin create --fs-type bdb /var/repos

 

디렉터리 그룹 권한을 변경합니다.

 

# chmod -R g+w /var/repos

 

SVN 설정을 변경합니다.

 

# vi /var/repos/conf/svnserve.conf

[general]

anon-access = read # 익명 사용자 읽기 권한

auth-access = write # 등록된 사용자 쓰기 권한

password-db = passwd # 인증에 사용될 패스워드 설정 파일

 

사용자 ID와 비밀번호를 추가합니다.

 

# vi /var/repos/conf/passwd

[user]

kyudoc = 1234

 

SVN 서버를 실행합니다.

 

# svnserve -d -r /var/repos

 

리눅스 부팅 시 자동으로 실행하도록 하시려면 '/etc/rc.d/rc.local' 파일에 다음과 같이 추가합니다.

 

# vi /etc/rc.d/rc.local

svnserve -d -r /var/repos

 

저장소에 trunk, branches, tags 디렉터리를 생성합니다.

 

먼저 SVN 에디터를 설정해야 합니다.

 

# vi ~/.bash_profile

export SVN_EDITOR=/usr/bin/vim

# source .bash_profile

 

먼저 trunk 디렉터리부터 생성합니다.

 

# svn mkdir svn://localhost/trunk

 

위와 같이 실행하면, 다음과 같이 vim 에디터가 자동으로 실행됩니다. :q를 눌러서 빠져 나옵니다.

 

--This line, and those below, will be ignored--

A    svn://localhost/trunk
~
(... 중략 ...)
~
"svn-commit.tmp" 4L, 77C                                      1,0-1         All

 

이어서 다음과 같이 물어보면 c를 입력합니다.

 

Log message unchanged or not specified
(a)bort, (c)ontinue, (e)dit:
c

 

root 암호와 svn에 등록한 사용자 ID 및 암호를 입력합니다.

 

Authentication realm: <svn://localhost:3690> 8951903c-f2c3-4193-bf79-c79530563c5e
Password for 'root': 루트 암호 입력
Authentication realm: <svn://localhost:3690> 8951903c-f2c3-4193-bf79-c79530563c5e
Username: 사용자 ID 입력
Password for 'kyudoc': 사용자 암호 입력

-----------------------------------------------------------------------
ATTENTION!  Your password for authentication realm:

   <svn://localhost:3690> 8951903c-f2c3-4193-bf79-c79530563c5e

can only be stored to disk unencrypted!  You are advised to configure
your system so that Subversion can store passwords encrypted, if
possible.  See the documentation for details.

You can avoid future appearances of this warning by setting the value
of the 'store-plaintext-passwords' option to either 'yes' or 'no' in
'/root/.subversion/servers'.
-----------------------------------------------------------------------
Store password unencrypted (yes/no)? yes

Committed revision 1.

 

위와 같은 방법으로 branches와 tags 디렉터리를 생성합니다. 생성이 완료되면 다음과 같이 확인하실 수 있습니다.

 

# svn list svn://localhost/

branches/

tags/

trunk/

 

SVN 포트 번호는 3690인데, 방화벽이 실행되고 있으면 외부에서 접근할 수 없으므로 다음과 같이 해제합니다.

 

# iptables -I INPUT -p tcp --dport 3690 -j ACCEPT

# /etc/rc.d/init.d/iptables save

# /etc/rc.d/init.d/iptables restart

반응형
반응형
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
«   2024/04   »
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30
글 보관함