Contents
- 1 環境
- 2 サーバの構築
- 3 Subversion環境の構築
- 4 Tracの利用
- 5 コマンド
- 5.1 svn
- 5.2 svnadmin
- 5.2.1 crashtest
- 5.2.2 create
- 5.2.3 deltify
- 5.2.4 dump
- 5.2.5 freeze
- 5.2.6 help (?, h)
- 5.2.7 hotcopy
- 5.2.8 list-dblogs
- 5.2.9 list-unused-dblogs
- 5.2.10 load
- 5.2.11 lock
- 5.2.12 lslocks
- 5.2.13 lstxns
- 5.2.14 pack
- 5.2.15 recover
- 5.2.16 rmlocks
- 5.2.17 rmtxns
- 5.2.18 setlog
- 5.2.19 setrevprop
- 5.2.20 setuuid
- 5.2.21 unlock
- 5.2.22 upgrade
- 5.2.23 verify
- 5.3 svndumpfilter
- 5.4 svnlook
- 5.5 svnmucc
- 5.6 svnrdump
- 5.7 svnserve
- 5.8 svnsync
- 5.9 svnversion
- 6 Subversionの運用
- 7 Tips
環境
- OS
CentOS release 6.4 (64bit)
- Subversion Version
1.8.8
サーバの構築
iptables
※iptablesについて
HTTP、HTTPSはデフォルトでは閉じられているため、ポートを開放する必要がある。
次のように編集する。
vi /etc/sysconfig/iptables
IPアドレスの制限をせず、標準のHTTP、HTTPSポートを使用する場合は以下を追記する。
(-A INPUT -j REJECT –reject-with icmp-host-prohibitedより前に記述する)
-A INPUT -p tcp --dport 3690 -j ACCEPT -A INPUT -p tcp --dport http -j ACCEPT -A INPUT -p tcp --dport https -j ACCEPT
再起動して反映させる。(reloadでは反映されない)
service iptables restart
Subversion環境の構築
インストール
ソースコードからインストール
過去のバージョンを使用したい場合はこちら
- 関連パッケージをインストールする
- コンパイラをインストールする
yum install gcc
- コンパイラをインストールする
- ダウンロードサイト:http://subversion.apache.org/download/からアーカイブのURLを取得する
- ダウンロードする
wget http://ftp.yz.yamagata-u.ac.jp/pub/network/apache/subversion/subversion-1.8.8.tar.gz
- アーカイブファイルを展開する
tar xzfv subversion-*.tar.gz
- SQLiteを用意する
- SQLiteをダウンロードする
wget https://sqlite.org/2014/sqlite-amalgamation-3080403.zip
- 展開する
unzip sqlite-amalgamation-*.zip
- Subversionソースコードディレクトリへ移動させる
mv sqlite-amalgamation-3080403 subversion-1.8.8/sqlite-amalgamation
- ダウンロードしたファイルは削除する
rm -f sqlite-amalgamation-*.zip
- SQLiteをダウンロードする
- ソースコードディレクトリへ移動する
cd subversion-*
- コンパイル最適化設定を行う
export CFLAGS="-O3 -m64"
- configure設定を行う
./configure --prefix=/usr/local/`pwd | sed "s/.*\///"` 2>&1 | tee configure.log.`date +"%Y%m%d"`
使用できる設定内容は以下のとおり
[root@subversion1 subversion-1.8.8]# ./configure --help `configure' configures subversion 1.8.8 to adapt to many kinds of systems. Usage: ./configure [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print `checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for `--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or `..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [/usr/local] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, `make install' will install all the files in `/usr/local/bin', `/usr/local/lib' etc. You can specify an installation prefix other than `/usr/local' using `--prefix', for instance `--prefix=$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/subversion] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] --target=TARGET configure for building compilers for TARGET [HOST] Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-sqlite-compatibility-version=X.Y.Z Allow binary to run against SQLite as old as ARG --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) --enable-experimental-libtool Use APR's libtool --enable-static Build static libraries --enable-shared Build shared libraries --enable-all-static Build completely static (standalone) binaries. --enable-local-library-preloading Enable preloading of locally built libraries in locally built executables. This may be necessary for testing prior to installation on some platforms. It does not work on some platforms (Darwin, OpenBSD, ...). --enable-bdb6 Allow building against BDB 6+. See --with-berkeley-db for specifying the location of the Berkeley DB installation. Using BDB 6 will fail if this option is not used. --disable-keychain Disable use of Mac OS KeyChain for auth credentials --enable-ev2-impl Use Ev2 implementations, where available [EXPERIMENTAL] --disable-nls Disable gettext functionality --disable-plaintext-password-storage Disable on-disk caching of plaintext passwords and passphrases. (Leaving this functionality enabled will not force Subversion to store passwords in plaintext, but does permit users to explicitly allow that behavior via runtime configuration.) --enable-debug Turn on debugging --enable-optimize Turn on optimizations --enable-disallowing-of-undefined-references Use -Wl,--no-undefined flag during linking of some libraries to disallow undefined references --enable-maintainer-mode Turn on debugging and very strict compile-time warnings --disable-full-version-match Disable the full version match rules when checking Subversion library compatibility. --enable-mod-activation Enable mod_dav_svn in httpd.conf --enable-gcov Turn on gcov coverage testing (GCC only). --enable-gprof Produce gprof profiling data in 'gmon.out' (GCC only). --enable-runtime-module-search Turn on dynamic loading of RA/FS libraries including third-party FS libraries --enable-javahl Enable compilation of Java high-level bindings (requires C++) Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-apr=PATH prefix for installed APR, path to APR build tree, or the full path to apr-config --with-apr-util=PATH prefix for installed APU, path to APU build tree, or the full path to apu-config --with-serf=PREFIX Serf HTTP client library (enabled by default if found) --with-apr_memcache=PREFIX Standalone apr_memcache client library --with-apxs[=FILE] Build shared Apache modules. FILE is the optional pathname to the Apache apxs tool; defaults to "apxs". --with-apache-libexecdir[=PATH] Install Apache modules to Apache's configured modules directory instead of LIBEXECDIR; if PATH is given, install to PATH. --with-sqlite=PREFIX Use instmalled SQLite library or amalgamation file. --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use both] --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-sysroot=DIR Search for dependent libraries within DIR (or the compiler's sysroot if not specified). --with-trang=PATH Specify the command to run the trang schema converter --with-doxygen=PATH Specify the command to run doxygen --with-expat=INCLUDES:LIB_SEARCH_DIRS:LIBS Specify location of Expat --with-berkeley-db[=HEADER:INCLUDES:LIB_SEARCH_DIRS:LIBS] The Subversion Berkeley DB based filesystem library requires Berkeley DB $db_version or $db_alt_version. If you specify `--without-berkeley-db', that library will not be built. If you omit the argument of this option completely, the configure script will use Berkeley DB used by APR-UTIL. --with-sasl=PATH Compile with libsasl2 in PATH --without-gpg-agent Disable support for GPG-Agent --with-gnome-keyring Enable use of GNOME Keyring for auth credentials (enabled by default if found) --with-libmagic=PREFIX libmagic filetype detection library --with-kwallet[=PATH] Enable use of KWallet (KDE 4) for auth credentials --with-openssl This option does NOT affect the Subversion build process in any way. It tells an integrated Serf HTTP client library build process where to locate the OpenSSL library when (and only when) building Serf as an integrated part of the Subversion build process. When linking to a previously installed version of Serf instead, you do not need to use this option. --with-editor=PATH Specify a default editor for the subversion client. --with-zlib=PREFIX zlib compression library --with-jdk=PATH Try to use 'PATH/include' to find the JNI headers. If PATH is not specified, look for a Java Development Kit at JAVA_HOME. --with-jikes=PATH Specify the path to a jikes binary to use it as your Java compiler. The default is to look for jikes (PATH optional). This behavior can be switched off by supplying 'no'. --with-swig=PATH Try to use 'PATH/bin/swig' to build the swig bindings. If PATH is not specified, look for a 'swig' binary in your PATH. --with-ruby-sitedir=SITEDIR install Ruby bindings in SITEDIR (default is same as ruby's one) --with-ruby-test-verbose=LEVEL how to use output level for Ruby bindings tests (default is normal) --with-ctypesgen=PATH Specify the path to ctypesgen. This can either be the full path to a ctypesgen installation, the full path to a ctypesgen source tree or the full path to ctypesgen.py. --with-junit=PATH Specify a path to the junit JAR file. Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a nonstandard directory <lib dir> LIBS libraries to pass to the linker, e.g. -l<library> CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if you have headers in a nonstandard directory <include dir> CXX C++ compiler command CXXFLAGS C++ compiler flags CPP C preprocessor CXXCPP C++ preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to <http://subversion.apache.org/>.
- エラーが出なかった場合、インストールを行う
make 2>&1 | tee make.log.`date +"%Y%m%d"` make install 2>&1 | tee make_install.log.`date +"%Y%m%d"`
- リンク作成、環境変数設定などを行う
- インストールディレクトリへのシンボリックリンクを作成する。
これによって、複数のバージョンを同居させ、リンクを切り替えることで、バージョン変更が可能となる。
各バージョンの実行ファイルはデフォルトでは各バージョンの設定ファイルを読み込むこととなる。
ln -s /usr/local/subversion-`pwd | sed "s/.*\///"` /usr/local/subversion
- インストールディレクトリへのシンボリックリンクを作成する。
- 共通した環境とするために環境変数を設定する
export SUBVERSION_HOME=/usr/local/subversion
- ツール類にパスを通す
export PATH=$SUBVERSION_HOME/bin:$PATH
- 環境変数を再起動後も有効にする
echo "" >> /etc/bashrc echo "# SUBVERSION ENVIRONMENT VARIABLE" >> /etc/bashrc echo "export SUBVERSION_HOME=$SUBVERSION_HOME" >> /etc/bashrc echo "export PATH=\$SUBVERSION_HOME/bin:\$PATH" >> /etc/bashrc
- 環境変数を再起動後も有効にする
- インストールに使用したパッケージを削除する
cd ../ rm -rf subversion-*
- リポジトリ管理用のディレクトリを作成する
mkdir -p /usr/local/data/svn-repository
サーバの設定
Subversionをサーバとして使用するにはApache HTTPD経由と、Subversion専用サーバのsvnserve経由の方法がある。
使用する方の設定を以下で行う。
Apacheの設定
vi $APACHE_HOME/conf/httpd.conf
LoadModule dav_module modules/mod_dav.so <IfModule dav_module> LoadModule dav_svn_module /usr/local/subversion/libexec/mod_dav_svn.so <IfModule dav_svn_module> LoadModule authz_svn_module /usr/local/subversion/libexec/mod_authz_svn.so <IfModule authz_svn_module> <Location /svn> DAV svn SVNParentPath "/usr/local/data/svn-repository" </Location> </IfModule> </IfModule> </IfModule>
svnserveの設定
- svnserve自体をデーモンとして使用する
svnserveを常時起動させ、接続を待ち受けさせる。
- 起動ユーザを作成する
※ユーザ名をsubversionとすると8文字を超えてしまい、ps等でユーザ名の代わりにuidが表示されてしまう
useradd --user-group --no-create-home --shell /sbin/nologin svn
- 起動スクリプトを作成する
vi /etc/init.d/subversion
以下を記述する
#!/bin/sh # # chkconfig: 3 95 10 # # description: Subversion # PRODUCT=Subversion USER=svn CONFIG=/usr/local/subversion/subversion.conf OPTIONS=`cat $CONFIG` BIN_SERVER=/usr/local/subversion/bin/svnserve LOCK=/var/lock/subsys/subversion PID=/var/run/subversion.pid PROCESS=svnserve # Source function library. if [ -f /etc/rc.d/init.d/functions ]; then . /etc/rc.d/init.d/functions elif [ -f /etc/init.d/functions ]; then . /etc/init.d/functions fi start() { echo "Starting $PRODUCT with $CONFIG" if [ -f $LOCK ]; then echo "$PRODUCT is running now." exit 1 fi daemon --pidfile $PID --user $USER $BIN_SERVER $OPTIONS echo "Started $PRODUCT" touch $LOCK return 0 } stop() { echo "Stopping $PRODUCT" killproc $PROCESS rm -f $LOCK rm -f $PID echo "Stoped $PRODUCT" return 0 } restart() { stop start return 0 } case "$1" in start) start ;; stop) stop ;; restart) restart ;; status) status $BIN_SERVER ;; *) echo "Usage: $0 {start|stop|restart|status}" exit 1 esac exit 0
- 設定ファイルを作成する
echo "-d -r /usr/local/data/svn-repository" > /usr/local/subversion/subversion.conf
- オーナー・権限を変更する
chown svn:svn /etc/init.d/subversion chmod 755 /etc/init.d/subversion chown -R svn:svn $SUBVERSION_HOME/
- サービス登録する
chkconfig --add subversion chkconfig --list subversion
- svnserveを起動する
service subversion start
- 起動ユーザを作成する
- inetd経由で使用する
Subversionは通常アクセス頻度が低いため、スーパーデーモン(inetd)経由でアクセスすることで、
使用していないときにリソースを消費することを抑えられる。
ただし、応答はやや遅くなる。
Tracの利用
プロジェクト管理ツールのTracをインストールすることで、Subversionで管理しているコンテンツの最新版や差分内容を
WEBブラウザで閲覧することができる。
Trac:http://trac.edgewall.org/
Tracのインストール
- Tracをインストールする
- 次のURLから最新版のTracのダウンロードURLを確認する
http://trac.edgewall.org/wiki/TracDownload#LatestStableRelease - ダウンロードする
wget http://download.edgewall.org/trac/Trac-1.0.1.tar.gz
- 次のURLから最新版のTracのダウンロードURLを確認する
- アーカイブファイルを展開する
tar xvzf Trac-*.tar.gz
- ソースコードディレクトリへ移動する
cd Trac-*
- setuptoolsをインストールする
wget http://peak.telecommunity.com/dist/ez_setup.py python ez_setup.py
- Tracをインストールする
python ./setup.py install
- インストールに使用したパッケージを削除する
cd ../ rm -rf Trac-*
- Tracデータ用ディレクトリを作成する
mkdir /usr/local/data/trac
Subversionと同期
Subversionと同期させるためには、リポジトリを再作成する必要がある。
最新版のSubversionではTracに対応していないためである。
- 新規にリポジトリを作る場合
- リポジトリを作成する
svnadmin create --compatible-version 1.6 /usr/local/data/svn-repository/<リポジトリ名>
- オーナーを変更する
chown -R svn:svn /usr/local/data/svn-repository/<リポジトリ名>
- Tracのディレクトリを作成する
※複数のリポジトリが存在しても、Tracは個別に用意した方が良い
trac-admin /usr/local/data/trac/<リポジトリ名> initenv
いくつか入力を求められるので、入力する。デフォルトでも良い。 - SVNを使用する設定を追加する
vi /usr/local/data/trac/<リポジトリ名>/conf/trac.ini
以下を追記
[components] tracopt.versioncontrol.svn.* = enabled
- 認証可能な状態で、もしくはanonymousユーザに管理者権限をつけてWEBサーバを起動させる
- WEBブラウザでアクセスし、認証が必要な場合はログインする
- Adminページのリポジトリ設定ページを開く
http://XXX/TTT/admin/versioncontrol/repository
- 「Add Repository」部にリポジトリ情報を入力し、「Add」ボタンを押す
- リポジトリをTracに認識させる
trac-admin /usr/local/data/trac/<リポジトリ名> repository resync "<リポジトリ名>"
- post-commitスクリプトを修正する
vi /usr/local/data/svn-repository/<リポジトリ名>/hooks/post-commit
以下を記述
#!/bin/sh REPOS="$1" REV="$2" TXN_NAME="$3" /usr/bin/trac-admin /usr/local/data/trac/<リポジトリ名> changeset added "<リポジトリ名>" $REV
- オーナーを変更する
chown svn:svn /usr/local/data/svn-repository/<リポジトリ名>/hooks/post-commit
- パーミッションが無い場合は与える
chmod 755 /usr/local/data/svn-repository/<リポジトリ名>/hooks/post-commit
- リポジトリを作成する
WEBサーバの起動
Apache経由での利用
tracdによる起動
TracにはTrac専用のWEBサーバツールのtracdが含まれる。
これを起動することで、HTTPアクセスが可能となる。
なお、起動時に複数のtracのパスを指定することで、単一のデーモンで複数のtracプロジェクトを閲覧することができる
- 最小での起動方法
- 全てのユーザに管理者権限をつける場合は以下を実行する(ログインは不要)
trac-admin /usr/local/data/trac/<リポジトリ名> permission add anonymous TRAC_ADMIN
- tracdを起動する
tracd --port 8000 /usr/local/data/trac/<リポジトリ名>
- 全てのユーザに管理者権限をつける場合は以下を実行する(ログインは不要)
- 認証を行う
- 認証ファイルを作成する
htdigest -c /usr/local/data/trac/<リポジトリ名>/conf/htdigest trac <ユーザ名>
パスワードを問われるので設定する - 権限を付与する
trac-admin /usr/local/data/trac/<リポジトリ名> permission add <ユーザ名> TRAC_ADMIN
- tracdを起動する
tracd --port <ポート番号> /usr/local/data/trac/<リポジトリ名> --auth=<リポジトリ名>,/usr/local/data/trac/<リポジトリ名>/conf/htdigest,trac
- 認証ファイルを作成する
トラブルシューティング
エラーメッセージ
- SVNと連携設定をしていない
- エラーメッセージ
TracError: Unsupported version control system "svn": Can't find an appropriate component, maybe the corresponding plugin was not enabled?
- エラーメッセージ
- 解決法
SVNを使用する設定を追加する
vi /usr/local/data/trac/<リポジトリ名>/conf/trac.ini
以下を追記
[components] tracopt.versioncontrol.svn.* = enabled
- SVNのリポジトリバージョンが旧バージョンと互換性が無い
- エラーメッセージ
TracError: Couldn't open Subversion repository /usr/local/svn-repository/s1: SubversionException: ("Expected FS format between '1' and '4'; found format '6'", 160043)
- エラーメッセージ
- 解決法
互換性を持たせてリポジトリ作成をする
svnadmin create --compatible-version 1.6 /usr/local/data/svn-repository/<リポジトリ名>
コマンド
svn
チェックアウト
svn co <URL>
新規フォルダ・ファイル追加
svn add <対象フォルダ/ファイル>
フォルダを指定した場合、子階層以下も全て対象となる
コミット
svn commit -m "<コメント>"
ファイル一覧表示
svn list <URL>
特定パスを更新から除外
svn up --set-depth exclude <パス>
実行後commitが必要になるので、最新状態で行う必要がある。
svnadmin
crashtest
create
deltify
dump
freeze
help (?, h)
hotcopy
list-dblogs
list-unused-dblogs
load
lock
lslocks
lstxns
pack
recover
rmlocks
rmtxns
setlog
setrevprop
setuuid
unlock
upgrade
verify
svndumpfilter
svnlook
svnmucc
svnrdump
svnserve
svnsync
svnversion
Subversionの運用
リポジトリの作成
- リポジトリ用のディレクトリを作成する
svnadmin create /usr/local/data/svn-repository/<リポジトリ名>
- オーナーを変更する
chown -R svn:svn /usr/local/data/svn-repository/<リポジトリ名>
- 正常に作成できたか確認する
svn list svn://localhost/<リポジトリ名>
何も表示されなければ正常である。
プロトコルはHTTP使用の場合はhttp://~とする。
リポジトリの設定変更
設定はブロックごとに分かれており、各設定は適切なブロックに記述する。
設定ファイルは各リポジトリのディレクトリ内の、以下のパスに存在する。
conf/svnserve.conf
confフォルダ内のほかのファイルはこの設定ファイルで設定することで、読み出される。
全般的な設定
- ブロック
[general]
- 設定項目
- ログインしていないユーザの権限
anon-access = [write | read | none]
デフォルトはread
- ログインしていないユーザの権限
- 認証されたユーザの権限
auth-access = [write | read | none]
- 認証情報ファイルの読み込み
認証情報を別ファイルに記述しておき、そのファイルを読み込む。
ただし、SASLが有効な場合、読み込まれない。
なお、認証情報は必ず別ファイルに記述し、このpassword-dbで読み込まないと正常に動作しない。
password-db = <ファイルパス>
- リポジトリ内のパスのアクセス制御ファイルの読み込み
リポジトリ内の各パスに対して、ユーザ毎のアクセス制限を行う記述を
別ファイルにしておき、そのファイルを読み込む。
authz-db = <ファイルパス>
ユーザに関する設定
この設定はpassword-db設定を行ったうえ、別ファイル内に記述する必要がある。
- ブロック
[users]
- 設定項目
- 認証情報
<ユーザ名> = <パスワード>
- 認証情報
SASL
[sasl] [default] [pre-commit] [aliases] [groups]
hookスクリプトの作成
Commit前後など、サーバにアクセスした際のあるタイミングで任意のスクリプトを実行することができる。
スクリプト一覧
スクリプトは各ディレクトリのhookフォルダ内に作成する。
デフォルトでテンプレートファイルが作成されており、各ファイル名の .tmpl を取り除くことで実行することができる。
テンプレートをコピーするなどして作る場合は、実行権限を与える必要がある。
- コピーして作成する手順
cp hooks/post-commit.tmpl hooks/post-commit chown svn:svn hooks/post-commit
- スクリプト一覧
- post-commit
commit後に実行する - post-lock
- post-revprop-change
- post-unlock
- pre-commit
- pre-lock
- pre-revprop-change
- pre-unlock
- start-commit
- post-commit
スクリプトの作成
Tips
コミット時にアップデート(デプロイ)する
- 読み取りにユーザ認証が必要な場合
- Subversionユーザを作成する
echo "deployer = <パスワード>" >> <リポジトリパス>/conf/passwd
- subversionを停止する
service subversion stop
- svnユーザのホームディレクトリを作成する
mkdir /usr/local/subversion/home chown svn:svn /usr/local/subversion/home usermod -d /usr/local/subversion/home svn
- svnユーザをログイン可能にする
usermod -s /bin/bash svn
- subversionを起動する
service subversion start
- svnユーザでチェックアウトする
su svn svn co svn://localhost/<URL> --username deployer <展開パス> exit
- post-commit設定を行う
vi /usr/local/data/svn-repository/test1/hooks/post-commit
以下を記述する
/usr/local/subversion/bin/svn up <展開パス>
- 再度ログイン不可に戻す
usermod -s /sbin/nologin svn
- Subversionユーザを作成する