CentOS 6でsubversionのバージョンを上げる¶
CentOS 6.4の標準搭載subversionはバージョンが1.6.11と今となっては古い代物です。
新しいSubversionがいくつか提供されていますが、ここではCUIベースでRPMで管理できるWANdisco製subversionを利用します。
WandiscoのRPMリポジトリからSubversionをインストール¶
Wandiscoから、CentOS 6向けのyumリポジトリが提供されています。
http://opensource.wandisco.com/centos/6/svn-1.8/RPMS/
インストール方法を紹介しているブログ等
- http://dqn.sakusakutto.jp/2012/05/centos6-subversion17.html
- http://wankomagic.hatenablog.com/entry/2013/07/10/001936
上述2番目のブログを参照しながらyumリポジトリにwandiscoを追加してインストールしてみました。
- /etc/yum.repos.d/wandisco.repo を作成
[wandisco-svn] name=WANDisco Repository - snv-1.8 centos6 baseurl=http://opensource.wandisco.com/centos/6/svn-1.8/RPMS/$basearch/ enabled=0 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-WANdisco
- GPGキーを取り込み
# rpm --import http://opensource.wandisco.com/RPM-GPG-KEY-WANdisco
- yumでインストール
# yum install --enablerepo=wandisco-svn --disablerepo=base,updates,epel subversion Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * extras: www.ftp.ne.jp Setting up Install Process Resolving Dependencies --> Running transaction check ---> Package subversion.x86_64 0:1.6.11-7.el6 will be updated ---> Package subversion.x86_64 0:1.8.8-1 will be an update --> Processing Dependency: libserf-1.so.1()(64bit) for package: subversion-1.8.8-1.x86_64 --> Running transaction check ---> Package serf.x86_64 0:1.3.2-2 will be installed --> Finished Dependency Resolution Dependencies Resolved ================================================================================ Package Arch Version Repository Size ================================================================================ Updating: subversion x86_64 1.8.8-1 wandisco-svn 2.2 M Installing for dependencies: serf x86_64 1.3.2-2 wandisco-svn 43 k Transaction Summary ================================================================================ Install 1 Package(s) Upgrade 1 Package(s) Total download size: 2.2 M Is this ok [y/N]: y Downloading Packages: (1/2): serf-1.3.2-2.x86_64.rpm | 43 kB 00:00 (2/2): subversion-1.8.8-1.x86_64.rpm | 2.2 MB 00:00 -------------------------------------------------------------------------------- Total 5.7 MB/s | 2.2 MB 00:00 Running rpm_check_debug Running Transaction Test Transaction Test Succeeded Running Transaction Installing : serf-1.3.2-2.x86_64 1/3 Updating : subversion-1.8.8-1.x86_64 2/3 Cleanup : subversion-1.6.11-7.el6.x86_64 3/3 Verifying : subversion-1.8.8-1.x86_64 1/3 Verifying : serf-1.3.2-2.x86_64 2/3 Verifying : subversion-1.6.11-7.el6.x86_64 3/3 Dependency Installed: serf.x86_64 0:1.3.2-2 Updated: subversion.x86_64 0:1.8.8-1 Complete! #
- svnコマンドでバージョン表示
$ svn --version svn, version 1.8.8 (r1568071) compiled Feb 17 2014, 18:16:33 on x86_64-unknown-linux-gnu Copyright (C) 2013 The Apache Software Foundation. This software consists of contributions made by many people; see the NOTICE file for more information. Subversion is open source software, see http://subversion.apache.org/ 以下のリポジトリアクセス (RA) モジュールが利用できます: * ra_svn : svn ネットワークプロトコルを使ってリポジトリにアクセスするモジュール 。 - Cyrus SASL 認証を併用 - 'svn' スキームを操作します * ra_local : ローカルディスク上のリポジトリにアクセスするモジュール。 - 'file' スキームを操作します * ra_serf : Module for accessing a repository via WebDAV protocol using serf. - using serf 1.3.2 - 'http' スキームを操作します - 'https' スキームを操作します ~$
Subversionサーバーとして稼動させるには、wandiscoのリポジトリからmod_dav_svnを追加します。
Subversionクライアントとしてhttp経由でチェックアウトするには、serfを追加します。(svn:Unrecognized URL schemeエラー対応)
Apache経由でアクセスできるリポジトリを用意¶
Subversionをサーバーとして運用できるようApacheとsvnモジュールをインストール
# yum install httpd # yum install --enablerepo=wandisco mod_dav_svn
リポジトリ基点ディレクトリ作成
# mkdir /var/lib/svn
apache svn設定ファイル /etc/httpd/conf.d/subversin.conf の編集
LoadModule dav_svn_module modules/mod_dav_svn.so LoadModule authz_svn_module modules/mod_authz_svn.so <Location /svn> DAV svn SVNParentPath /var/lib/svn/ AuthType Basic AuthName "SVN Repo" AuthUserFile /etc/httpd/conf.d/svn.passwd Require valid-user </Location>
リポジトリの作成
# svnadmin create /var/lib/svn/nolla # chown -R apache.apache /var/lib/svn/nolla
SubversionのBASIC認証ユーザー作成(初回、2回目以降は-cオプション不要)
# htpasswd -c /etc/httpd/conf.d/svn.passwd foouser
Subversionの自動起動設定
# chkconfig httpd on
Subversionの起動
# service httpd start