OS 확인
[root@donnert ~]# cat /etc/*-release
CentOS release 5.5 (Final)
설치
[root@donnert ~]# yum install subversion
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* addons: data.nicehosting.co.kr
* base: data.nicehosting.co.kr
* extras: data.nicehosting.co.kr
* updates: data.nicehosting.co.kr
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package subversion.i386 0:1.6.11-11.el5_9 set to be updated
---> Package subversion.x86_64 0:1.6.11-11.el5_9 set to be updated
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package Arch Version Repository Size
================================================================================
Updating:
subversion i386 1.6.11-11.el5_9 updates 3.1 M
subversion x86_64 1.6.11-11.el5_9 updates 3.2 M
Transaction Summary
================================================================================
Install 0 Package(s)
Upgrade 2 Package(s)
Total download size: 6.4 M
Is this ok [y/N]: y
Downloading Packages:
(1/2): subversion-1.6.11-11.el5_9.i386.rpm | 3.1 MB 00:21
(2/2): subversion-1.6.11-11.el5_9.x86_64.rpm | 3.2 MB 00:14
--------------------------------------------------------------------------------
Total 181 kB/s | 6.4 MB 00:36
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Updating : subversion 1/4
Updating : subversion 2/4
Cleanup : subversion 3/4
Cleanup : subversion 4/4
Updated:
subversion.i386 0:1.6.11-11.el5_9 subversion.x86_64 0:1.6.11-11.el5_9
Complete!
SVN 계정 생성(root로 관리할 경우 패스)
[root@donnert ~]# adduser svn
[root@donnert ~]# passwd svn
Changing password for user svn.
New UNIX password:
BAD PASSWORD: it is WAY too short
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
저장소 생성 및 권한 변경
[root@donnert ~]# svnadmin create --fs-type fsfs /home/svn/repos
[root@donnert ~]# chown -R svn:svn /home/svn/repos
[root@donnert ~]# ll /home/svn/repos
합계 48
-rw-r--r-- 1 svn svn 229 5월 14 13:53 README.txt
drwxr-xr-x 2 svn svn 4096 5월 14 13:53 conf
drwxr-sr-x 6 svn svn 4096 5월 14 13:53 db
-r--r--r-- 1 svn svn 2 5월 14 13:53 format
drwxr-xr-x 2 svn svn 4096 5월 14 13:53 hooks
drwxr-xr-x 2 svn svn 4096 5월 14 13:53 locks
설정 변경(이후부터는 svn 계정)
[root@donnert ~]# su - svn
[svn@donnert ~]$ cd repos/conf
[svn@donnert ~]$ vi passwd
아이디=비밀번호
[svn@donnert ~]$ vi authz
[repos:/]
아이디= rw
[svn@donnert ~]$ vi svnserve.conf (주석을 지워줘야 한다)
anon-access = none
auth-access = write
password-db = passwd
authz-db = authz
기동 및 확인
[svn@donnert conf]$ svnserve -d -r /home/svn
[svn@donnert conf]$ ps -ef | grep svnserve | grep -v grep
svn 7375 1 0 13:57 ? 00:00:00 svnserve -d -r /home/svn
[svn@donnert conf]$ netstat -an | grep 3690
tcp 0 0 :::3690 :::* LISTEN
중지 및 확인
[svn@donnert conf]$ killall svnserve
[svn@donnert conf]$ ps -ef | grep svnserve | grep -v grep
[svn@donnert conf]$ netstat -an | grep 3690
추가 폴더 생성(trunk, branches, tag)
의미는 http://cranix.net/302 에서 확인하기 바란다.. 안만들어도 크게 상관없는듯
인증 실패가 생길 경우 --username=xxx 추가해서 인증받기 바란다
[svn@donnert conf]$ svn mkdir svn://localhost/repos/trunk
svn: 로그 메시지를 구하기 위해 외부 프로그램을 사용할 수 없습니다. SVN_EDITOR 환경변수를 설정하시거나 --message (-m) 또는 --file (-F) 옵션을 사용하세요.
svn: 환경변수 SVN_EDITOR, VISUAL, EDITOR 중 하나는 설정하거나, 'editor-cmd' 를 구성화일에 명시해야합니다.
나올경우 아래 추가 후 재실행(나머지2개 폴더도 만들어주자)
[svn@donnert conf]$ SVN_EDITOR=/usr/bin/vim
[svn@donnert conf]$ export SVN_EDITOR
[svn@donnert conf]$ svn mkdir svn://localhost/project/trunk
저장 후 C 선택
Store password unencrypted (yes/no)? yes
Please type 'yes' or 'no': 예
[svn@donnert conf]$ svn list svn://localhost/repos
trunk/
젠장 하다하다 안되서 확인해보니 방화벽 문제였다는...
추가
부팅시 자동 등록되게 할려면
root로 접속 -> vi /etc/rc.d/rc.local
아래 줄을 추가해준다(svn계정으로 실행)
su -c 'svnserve -d -r /home/svn' svn