ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • CentOS svn 설치
    Linux 2017. 7. 20. 10:20





    개요

    Subversion 1.7 부터는 다음과 같은 주요 개선사항이 있다.

    1. 폴더마다 만들던 .svn 폴더가 최상단에만 위치하도록 working copy module(libsvn_wc)이 완전히 새로 작성
    2. C/S Protocol 속도 최적화.

    RHEL은 안정성을 중시하다 보니 탑재된 패키지의 버전 업그레이드가 잘 안 되므로 Subversion1.7 이 탑재되어 있지 않고 EPEL 에도  1.7이 없는 관계로 별도로 설치하는 방법을 정리해 본다.

    설치

    1. Subversion관련 기술지원과 enterprise Subversion 을 판매하는 회사인 wandisco 에서 리눅스용 패키지를 다운받는다.

      svn 1.7 download
      wget http://opensource.wandisco.com/rhel/6/svn-1.7/RPMS/x86_64/mod_dav_svn-1.7.13-1.x86_64.rpm
      wget http://opensource.wandisco.com/rhel/6/svn-1.7/RPMS/x86_64/subversion-1.7.13-1.x86_64.rpm
      wget http://opensource.wandisco.com/rhel/6/svn-1.7/RPMS/x86_64/subversion-tools-1.7.13-1.x86_64.rpm
      svn 1.8 download
      wget http://opensource.wandisco.com/rhel/6/svn-1.8/RPMS/x86_64/mod_dav_svn-1.8.17-1.x86_64.rpm
      wget http://opensource.wandisco.com/rhel/6/svn-1.8/RPMS/x86_64/subversion-1.8.17-1.x86_64.rpm
      wget http://opensource.wandisco.com/rhel/6/svn-1.8/RPMS/x86_64/subversion-tools-1.8.17-1.x86_64.rpm
      ## 1.8 부터 svn 이 사용하는 HTTP client library 가 serf 로 변경되서 필요
      wget http://opensource.wandisco.com/rhel/6/svn-1.8/RPMS/x86_64/serf-1.3.7-1.x86_64.rpm
      1.9
      wget http://opensource.wandisco.com/rhel/6/svn-1.9/RPMS/x86_64/mod_dav_svn-1.9.5-1.x86_64.rpm
      wget http://opensource.wandisco.com/rhel/6/svn-1.9/RPMS/x86_64/subversion-1.9.5-1.x86_64.rpm
      wget http://opensource.wandisco.com/rhel/6/svn-1.9/RPMS/x86_64/subversion-tools-1.9.5-1.x86_64.rpm
      wget http://opensource.wandisco.com/rhel/6/svn-1.9/RPMS/x86_64/serf-1.3.7-1.x86_64.rpm
    2. 패키지를 설치한다

      yum localinstall serf* mod_dav_svn* subversion*
    3. repository 를 만든다. (SElinux 설정 반영)

      svn repository 생성
      mkdir /var/www/svn/
      cd /var/www/svn
      svnadmin create myrepos
      chown -R apache.apache myrepos
      chcon -R t httpd_sys_content_t myrepos
    4. vi /etc/httpd/conf.d/subversion.conf 열어서 다음 내용을 추가한다.

      ## 1.7부터 도입된 기능으로 On 이면 commit 시에 에러가 발생하는 경우가 있으니 Off 로 설정
      SVNAdvertiseV2Protocol  Off
       
      <Location /svn>
        DAV svn
        SVNParentPath /var/www/svn/
        ### /svn 로 access 할 경우 Repository 를 List 를 보여주려면 on 으로 설정한다.
        SVNListParentPath on
        AuthType Basic
        AuthName "SVN Repo"
        AuthUserFile /var/www/svn/conf/svn.passwd
        Require valid-user
        ## Path-Based Authorization 를 사용할 경우 설정한다.
        AuthzSVNAccessFile /var/www/svn/conf/svn-access-file
      </Location>
    5. AuthUserFile 이 없을 경우 생성한다
      1. touch /var/www/svn/conf/svn.passwd
      2. htpasswd -b /var/www/svn/conf/svn.passwd userid userpwd
    6. AuthzSVNAccessFile 를 사용할 경우 설정 예제

      1. Path-Based ACL 은 [repos-name:path] 또는 [path] 와 같은 형식으로 기술한다.

      2. 권한은 read(r) 와 write(w)로 되어 있으며 id = rw 처럼 기술한다.
      3. SVNParentPath 를 지정했다면 repos-name 을 정확히 기술해야 repository 별로 ACL 을 설정할 수 있다. 
      4. 다음 설정은 calc repository 에 있는 /branches/calc/bug-142 에 대해 harry 는 Read-Write 권한을 sally 는 READ-ONLY 권한을 부여하고 있다.

        [calc:/branches/calc/bug-142]
        harry = rw
        sally = r
      5. permissions 은 parent directory에서 child 로 상속되므로 child 마다 지정할 필요는 없다.
      6. 다음처럼  id 만 기술되어 있고 권한이 없으면 해당 id는 acccess 를 허용하지 않는다.

        [calc:/branches/calc/bug-142]
        harry = rw
        sally =
      7. * 는 모든 계정과 매칭된다. 다음 설정은 최상위 root 부터 anonymous 의 read 를 허용한다. (일반적인 open source repository 의 설정)

        [repos:/myproj]
        * = r

        이 설정은 anonymous 는 read-only 를 계정이 있는 사용자는 write 를 허용한다.

        [repos:/myproj]
        * = r
        lesstif = rw
        user1 = rw
      8. grouping 이 필요하면 id 대신 @그룹명을 적어준다. group 설정은 [groups] keyword 를 이용한다.

        [calc:/projects/calc]
        @calc-developers = rw
         
        [paint:/projects/paint]
        jane = r
        @paint-developers = rw
          
        [groups]
        calc-developers = harry, sally, joe
        paint-developers = frank, sally, jane
        everyone = harry, sally, joe, frank, jane
      9. group 은 다른 그룹을 포함할 수 있다.

        [groups]
        calc-developers = harry, sally, joe
        paint-developers = frank, sally, jane
        everyone = @calc-developers, @paint-developers
    7. service httpd restart
    8. TortoiseSvn 이나 기타 svn client 로 연결하여 제대로 설정되었는지 확인한다.


    댓글

Designed by black7375.