티스토리 뷰

study/Linux

SVN서버 설치하기

koreaparks 2011. 12. 21. 22:47



위의 블로그에서 퍼온글이며 설치도중 확인한 에러를 추가하여 포스팅 합니다.


소스 관리를 위해 사용되는 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


 

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


# vi ~/.bash_profile

export SVN_EDITOR=/usr/bin/vim

# source .bash_profile



이후에 에러를 방지하기 위해서 다음과 같이 설정합니다. 


Store password unencrypted (yes/no)? 에러

 이 부분에서 넘어가지 않을 시 

vi ~/.subversion/servers 에서

# store-passwords = no  부분의 주석을 지워주면 됩니다.


저장소에 trunk, branches, tags 디렉터리를 생성해야 합니다. 먼저 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

 



svnserve.conf:12: Option expected 에러
위의 /var/repos/conf/svnserve.conf 에서 주석제거시 공백을 없애지 않아서 생기는 문제입니다. 다시 찾아가서 공백을 없애주면 해결됩니다.


 

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

 

SVN 서버 설치가 완료 되었습니다. 간단하게 리눅스 쉘에서 사용해보실 수 있습니다.

 

Import

$ svn import sjpsp svn://localhost/trunk -m "" --no-ignore

 

Commit

$ svn commit sjpsp

 

Update

$ svn update sjpsp

 

※ 이 포스팅에 사용된 리눅스는 페도라를 사용하였습니다.

 

※ 참고 사이트

 



참고


SVN 종료하기 
$ killall svnserve 


 

'study > Linux' 카테고리의 다른 글

리눅스 설치시 무한 깜빡임 해결 방법  (3) 2013.12.08
Fedora 리눅스 mysql 한글문제 해결방법  (0) 2012.05.18
program..  (0) 2011.11.08
리눅스 설정  (0) 2011.09.09
리눅스 bashrc로 경로(프롬프트)색상입히기  (3) 2011.07.08
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday