Linuxにsubversionサーバーをインストールと設定方法

システム要件
svn環境インストール
ソースパッケージのダウンロード
wget http://archive.apache.org/dist/httpd/httpd-2.2.19.tar.bz2
wget http://www.sqlite.org/sqlite-amalgamation-3.6.13.tar.gz
wget http://subversion.tigris.org/downloads/subversion-deps-1.6.6.tar.bz2
wget http://subversion.tigris.org/downloads/subversion-1.6.17.tar.gz

1.aprとapr-utilのインストール
cd httpd-2.2.19/srclib/apr
./configure –prefix=/usr/local/apr
make&&make install
cd ../
./configure –prefix=/usr/local/apr-util –with-apr=/usr/local/apr
make&&make install

2.apacheのインストール
cd httpd-2.2.19
./configure –prefix=/usr/local/webserver/httpd-2.2.19 –enable-dav –enable-so –with-apr=/usr/local/apr/bin/apr-1-config –with-apr-util=/usr/local/apr-util/bin/apu-1-config –with-included-apr
make && make install

3.subversionのインストール
cd subversion-1.6.17
./configure –prefix=/usr/local/webserver/svn –with-apxs=/usr/local/webserver/httpd-2.2.19/bin/apxs –with-apr=/usr/local/apr/bin/apr-1-config –with-apr-util=/usr/local/apr-util/bin/apu-1-config –with-ssl –with-zlib=/usr –enable-maintainer-mode
make && make install

4.インストールエラー現象と解決方法:
checking sqlite library version (via header)… unsupported SQLite version
checking sqlite library version (via pkg-config)… none or unsupported 3.3
no
An appropriate version of sqlite could not be found. We recommmend
3.6.13, but require at least 3.4.0.
Please either install a newer sqlite on this system
or
get the sqlite 3.6.13 amalgamation from:
http://www.sqlite.org/sqlite-amalgamation-3.6.13.tar.gz
unpack the archive using tar/gunzip and copy sqlite3.c from the
resulting directory to:
/data/software/subversion-1.6.17/sqlite-amalgamation/sqlite3.c
This file also ships as part of the subversion-deps distribution.
configure: error: Subversion requires SQLite

4.1 解決方法
sqlite-amalgamation-3.6.13.tar.gzをダウンロード
[root@svn subversion-1.6.6]# mkdir sqlite-amalgamation
[root@svn soft]# cp sqlite-3.6.13/sqlite3.c /data/software/subversion-1.6.17/sqlite-amalgamation/
4.2 再度configure,エラー下記:
configure: maintainer-mode: adding GCC warning flags
configure: error: –with-zlib requires an argument.

4.3 zlibをインストールする、subversion-deps-1.6.6.tar.bz2 をダウンロード
cd subversion-1.6.6/zlib/
./configure –shared
make

4.4 再度インストール、下記エラー:
BDB WARNING:
configure: WARNING: we have configured without BDB filesystem support
You don’t seem to have Berkeley DB version 4.0.14 or newer
installed and linked to APR-UTIL. We have created Makefiles which
will build without the Berkeley DB back-end; your repositories will
use FSFS as the default back-end. You can find the latest version of
Berkeley DB here:
http://www.oracle.com/technology/software/products/berkeley-db/index.html
make && make install

5.subversionを設定
 5.1 ディレクトリを作成
mkdir /data/subversion
5.2 ファイルを作成
touch svn-access-file
touch svn-auth-file
5.3 ライブラリを作成
svnadmin create /data/subversion/lxsym_web

6.apacheのhttpd.confを設定

6.1 subversionをインストール後、apacheの「conf/httpd.conf」にモジュールを追加
LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so
6.2 設定変更を追加
listen 8098を修正

<Location /svn>
DAV svn
SVNParentPath /data/subversion/
#SVNPath /data/subversion
AuthType Basic
AuthName “Subversion repository"
AuthUserFile /data/subversion/svn-auth-file
Require valid-user
AuthzSVNAccessFile /data/subversion/svn-access-file
</Location>
<Directory /data>
AllowOverride none
Options MultiViews
order allow,deny
Allow from all
</Directory>

6.3 ユーザーと権限を追加
htpasswd svn-auth-file startnews24_test1
パスワードを2回入力した後、成功メッセージを表示する
Adding password for user startnews24_test1
vi svn-access-file
[groups]
lxsym_all = admin
[lxsym_web:/]
admin = rw
@lxsym_all = r
test1 = rw
* =

6.4 設定完了、画面の確認
http://svn.XXX.com:8098/svn/lxsym_web/

Linux

Posted by arkgame