태그 보관물: 리눅스

리눅스 SVN 서버 설치 및 사용법

서브버전(subversion)이란?

자유 소프트웨어 버전 관리 시스템이다. 명령행 인터페이스에서 사용하는 명령어를 따서 “SVN” 이라고 줄여서 부르기도 하며, 제한이 있던 CVS를 대체하기 위해 2000년부터 콜랩넷에서 개발되었다.

현재는 아파치 최상위 프로젝트로서 전 세계 개발자 커뮤니티와 함께 개발되고 있는 상태다.

서브 버전은 서버-클라이언트 모델을 따르며, 서버는 작업하는 컴퓨터내에 둘 수도 있고, 전산망에 연결된 별도의 컴퓨터에 두고 사용할 수도 있다. 서브버전 서버와 클라이언트는 http, https, svn, svn+ssh의 규약으로 통신한다.

서브버전(subversion) 기능

어떠한 기능들이 있는지 살펴보게 되면 아래와 같다.

  • automatical writing을 지원하므로, 쓰기 도중 중단으로 인한 저장소 내의 불일치나 손상을 피할 수 있다.
  • 이름을 바꾸거나, 복사하거나, 파일을 지워도 계정 기록을 유지한다.
  • 시스템이 등록부, 개명, 파일 메타데이터에 대해서도 판본 호수를 지정 관리한다. 사용자는 디렉터리 전체를 빠르게 옮기거나 복사하면서도 전체의 개정 이력을 보유할 수 있다.
  • 심볼릭 링크도 판본 호수를 지정.
  • 이진 파일의 경우 한번 저장한 후 변경될 경우 차이점만 저장하기 때문에 저장소를 효율적으로 사용할 수 있다.
  • 아파치 HTTP 서버를 네트워크 서버로, 웹대브/델타-V를 통신규약으로 사용한다. svnserve라는 독립된 서버 프로세스도 있어서 TCP/IP를 통해 전용 통신규약을 사용한다.
  • 소스 저장소의 크기에 관계 없이 일정한 시간 안에 가지 치기(branching)나 태그 넣기(tagging)를 할 수 있다.
  • 태생적으로 클라이언트-서버, 계층 라이브러리 설계를 채택.
  • 클라이언트/서버 통신규약이 버전간 차이를 양뱡향으로 보냄.
  • 소스 저장소로의 접근이 최적화되어 있으므로, 소스 저장고에서 필요 없는 네트워크 트래픽을 줄일 수 있다.

리눅스 SVN 설치

리눅스 환경

OS : CentOS6.7 64bit

대부분 레드헷 기반의 CentOS 또는 이와 비슷한 운영체제에서는 yum install 을 통해서 손쉽게 설치가 가능하다. 아래 내용을 참고하여 자신이 운영하는 서버에 설치해보자.

[root@dslee src]# yum install subversion
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirror.oasis.onnetcorp.com
* extras: mirror.oasis.onnetcorp.com
* rpmforge: mirror.fairway.ne.jp
* updates: mirror.oasis.onnetcorp.com
base                                                                                                                                                              | 3.7 kB     00:00     
couchbase                                                                                                                                                         | 2.5 kB     00:00     
extras                                                                                                                                                            | 3.4 kB     00:00     
rpmforge                                                                                                                                                          | 1.9 kB     00:00     
updates                                                                                                                                                           | 3.4 kB     00:00     
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package subversion.x86_64 0:1.6.11-15.el6_7 will be installed
--> Processing Dependency: perl(URI) >= 1.17 for package: subversion-1.6.11-15.el6_7.x86_64
--> Processing Dependency: apr >= 1.3.0 for package: subversion-1.6.11-15.el6_7.x86_64
--> Processing Dependency: libneon.so.27()(64bit) for package: subversion-1.6.11-15.el6_7.x86_64
--> Processing Dependency: libaprutil-1.so.0()(64bit) for package: subversion-1.6.11-15.el6_7.x86_64
--> Processing Dependency: libapr-1.so.0()(64bit) for package: subversion-1.6.11-15.el6_7.x86_64
--> Running transaction check
---> Package apr.x86_64 0:1.3.9-5.el6_2 will be installed
---> Package apr-util.x86_64 0:1.3.9-3.el6_0.1 will be installed
---> Package neon.x86_64 0:0.29.3-3.el6_4 will be installed
--> Processing Dependency: libproxy.so.0()(64bit) for package: neon-0.29.3-3.el6_4.x86_64
--> Processing Dependency: libpakchois.so.0()(64bit) for package: neon-0.29.3-3.el6_4.x86_64
---> Package perl-URI.noarch 0:1.40-2.el6 will be installed
--> Running transaction check
---> Package libproxy.x86_64 0:0.3.0-10.el6 will be installed
--> Processing Dependency: libproxy-python = 0.3.0-10.el6 for package: libproxy-0.3.0-10.el6.x86_64
--> Processing Dependency: libproxy-bin = 0.3.0-10.el6 for package: libproxy-0.3.0-10.el6.x86_64
---> Package pakchois.x86_64 0:0.4-3.2.el6 will be installed
--> Running transaction check
---> Package libproxy-bin.x86_64 0:0.3.0-10.el6 will be installed
---> Package libproxy-python.x86_64 0:0.3.0-10.el6 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=========================================================================================================================================================================================
Package                                         Arch                                   Version                                            Repository                               Size
=========================================================================================================================================================================================
Installing:
subversion                                      x86_64                                 1.6.11-15.el6_7                                    updates                                 2.3 M
Installing for dependencies:
apr                                             x86_64                                 1.3.9-5.el6_2                                      base                                    123 k
apr-util                                        x86_64                                 1.3.9-3.el6_0.1                                    base                                     87 k
libproxy                                        x86_64                                 0.3.0-10.el6                                       base                                     39 k
libproxy-bin                                    x86_64                                 0.3.0-10.el6                                       base                                    9.0 k
libproxy-python                                 x86_64                                 0.3.0-10.el6                                       base                                    9.1 k
neon                                            x86_64                                 0.29.3-3.el6_4                                     base                                    119 k
pakchois                                        x86_64                                 0.4-3.2.el6                                        base                                     21 k
perl-URI                                        noarch                                 1.40-2.el6                                         base                                    117 k
Transaction Summary
=========================================================================================================================================================================================
Install       9 Package(s)
Total download size: 2.8 M
Installed size: 13 M
Is this ok [y/N]: y
Downloading Packages:
(1/9): apr-1.3.9-5.el6_2.x86_64.rpm                                                                                                                               | 123 kB     00:00     
(2/9): apr-util-1.3.9-3.el6_0.1.x86_64.rpm                                                                                                                        |  87 kB     00:00     
(3/9): libproxy-0.3.0-10.el6.x86_64.rpm                                                                                                                           |  39 kB     00:00     
(4/9): libproxy-bin-0.3.0-10.el6.x86_64.rpm                                                                                                                       | 9.0 kB     00:00     
(5/9): libproxy-python-0.3.0-10.el6.x86_64.rpm                                                                                                                    | 9.1 kB     00:00     
(6/9): neon-0.29.3-3.el6_4.x86_64.rpm                                                                                                                             | 119 kB     00:00     
(7/9): pakchois-0.4-3.2.el6.x86_64.rpm                                                                                                                            |  21 kB     00:00     
(8/9): perl-URI-1.40-2.el6.noarch.rpm                                                                                                                             | 117 kB     00:00     
(9/9): subversion-1.6.11-15.el6_7.x86_64.rpm                                                                                                                      | 2.3 MB     00:00     
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                    2.4 MB/s | 2.8 MB     00:01     
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : libproxy-bin-0.3.0-10.el6.x86_64                                                                                                                                      1/9 
Installing : libproxy-python-0.3.0-10.el6.x86_64                                                                                                                                   2/9 
Installing : libproxy-0.3.0-10.el6.x86_64                                                                                                                                          3/9 
Installing : apr-1.3.9-5.el6_2.x86_64                                                                                                                                              4/9 
Installing : apr-util-1.3.9-3.el6_0.1.x86_64                                                                                                                                       5/9 
Installing : perl-URI-1.40-2.el6.noarch                                                                                                                                            6/9 
Installing : pakchois-0.4-3.2.el6.x86_64                                                                                                                                           7/9 
Installing : neon-0.29.3-3.el6_4.x86_64                                                                                                                                            8/9 
Installing : subversion-1.6.11-15.el6_7.x86_64                                                                                                                                     9/9 
Verifying  : libproxy-0.3.0-10.el6.x86_64                                                                                                                                          1/9 
Verifying  : libproxy-bin-0.3.0-10.el6.x86_64                                                                                                                                      2/9 
Verifying  : pakchois-0.4-3.2.el6.x86_64                                                                                                                                           3/9 
Verifying  : libproxy-python-0.3.0-10.el6.x86_64                                                                                                                                   4/9 
Verifying  : neon-0.29.3-3.el6_4.x86_64                                                                                                                                            5/9 
Verifying  : perl-URI-1.40-2.el6.noarch                                                                                                                                            6/9 
Verifying  : subversion-1.6.11-15.el6_7.x86_64                                                                                                                                     7/9 
Verifying  : apr-1.3.9-5.el6_2.x86_64                                                                                                                                              8/9 
Verifying  : apr-util-1.3.9-3.el6_0.1.x86_64                                                                                                                                       9/9 
Installed:
subversion.x86_64 0:1.6.11-15.el6_7                                                                                                                                                 
Dependency Installed:
apr.x86_64 0:1.3.9-5.el6_2      apr-util.x86_64 0:1.3.9-3.el6_0.1    libproxy.x86_64 0:0.3.0-10.el6    libproxy-bin.x86_64 0:0.3.0-10.el6    libproxy-python.x86_64 0:0.3.0-10.el6   
neon.x86_64 0:0.29.3-3.el6_4    pakchois.x86_64 0:0.4-3.2.el6        perl-URI.noarch 0:1.40-2.el6     
Complete!

리눅스 SVN 설정 사용법 운영하기

몇가지 수동으로 설정해줘야 되는 항목들이 존재한다. 아래 내용을 참고해서 설정 및 운영테스트를 진행해본다.

[root@dslee src]# 
[root@dslee src]# mkdir /svn
[root@dslee src]# cd /svn/
[root@dslee svn]# svnadmin create --fs-type fsfs share1
[root@dslee svn]# ll
합계 4
drwxr-xr-x. 6 root root 4096 2016-01-20 13:44 share1
[root@dslee svn]# cd share1/
[root@dslee share1]# ll
합계 24
-rw-r--r--. 1 root root  229 2016-01-20 13:44 README.txt
drwxr-xr-x. 2 root root 4096 2016-01-20 13:44 conf
drwxr-sr-x. 6 root root 4096 2016-01-20 13:44 db
-r--r--r--. 1 root root    2 2016-01-20 13:44 format
drwxr-xr-x. 2 root root 4096 2016-01-20 13:44 hooks
drwxr-xr-x. 2 root root 4096 2016-01-20 13:44 locks
[root@dslee share1]# cd conf/
[root@dslee conf]# ll
[root@dslee conf]# svnserve -d -r /svn/
[root@dslee conf]# svn checkout svn://192.168.0.2/share1
체크아웃된 리비전 0.
[root@dslee conf]# vi /svn/share1/conf/svnserve.conf
[general]
anon-access = none
auth-access = write
password-db = passwd
realm = My First Repository
[root@dslee conf]# svn checkout svn://192.168.0.2/share1
인증 영역(realm): <svn://192.168.0.2:3690> My First Repository
'root'의 암호:
인증 영역(realm): <svn://192.168.0.2:3690> My First Repository
사용자명:dslee
'dslee'의 암호:
-----------------------------------------------------------------------
ATTENTION!  Your password for authentication realm:
<svn://192.168.0.2:3690> My First Repository
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
[root@dslee conf]# vi /root/.subversion/servers
주석해제
store-plaintext-passwords = no
[root@dslee conf]# svn checkout svn://192.168.0.2/share1
인증 영역(realm): <svn://192.168.0.2:3690> My First Repository
'dslee'의 암호:
체크아웃된 리비전 0.
[root@dslee conf]# 

SVN 클라이언트 사용법

http://wiki.tunelinux.pe.kr/pages/viewpage.action?pageId=885029

SVN 클라이언트 사용법은 위 링크 페이지를 참고하면 더욱 자세하게 설명되어 있다.