Subversionのインストール

openSUSEなんで、yastでいれます。 [yast] ⇒ [Software] ⇒ [Software Management] より、インストール。

subversion 1.4.4
subversion-server 1.4.4

Apache WebDAVとの連携

*
apacheの設定追加

[yast] ⇒ [System] ⇒ [/etc/sysconfig Editor] より、Apache2 を開く。

Network
- WWW
- Apache2

*
APACHE_MODULESに以下を追加する。

dav dav_lcok dav_fs dav_svn authz_svn

*
/etc/apache2/sysconfig.d/loadmodule.confに以下が追加されていること

LoadModule dav_module /usr/lib/apache2-prefork/mod_dav.so
LoadModule dav_lock_module /usr/lib/apache2-prefork/mod_dav_lock.so
LoadModule dav_fs_module /usr/lib/apache2-prefork/mod_dav_fs.so
LoadModule dav_svn_module /usr/lib/apache2/mod_dav_svn.so
LoadModule authz_svn_module /usr/lib/apache2/mod_authz_svn.so

*
/etc/apache2/conf.d/subversion.confに以下を追記する

SVNPathで指定したディレクトリがリポジトリになります。


DAV svn
SVNPath /srv/svn/repos

AuthType Basic
AuthName "Authorization Realm"
AuthUserFile /etc/apache2/.svnpasswd <-- パスワード管理ファイル
AuthzSVNAccessFile /srv/svn/svnauthz.conf <-- アクセス制御ファイル
Require valid-user

*
リポジトリの作成

# mkdir -p /srv/svn/repos
# svnadmin create /srv/svn/repos
# chown -R wwwrun:www /srv/svn/repos

*
パスワードファイルの作成

htpasswd2で作成。hogeとpowユーザーを作成してみる。

# htpasswd2 -b -c /etc/apache2/.svnpasswd hoge hogepass
# htpasswd2 -b /etc/apache2/.svnpasswd pow powpass

*
アクセス制御ファイルの作成

アクセス制御は([リポジトリ名:パス])の下にユーザー毎の権限を指定します。権限は親ディレクトリの設定を継承します。

# vi /srv/svn/svnauthz.conf
[repos:/]

gem install mysqlで*** extconf.rb failed ***(OpenSUSE)

tkrmb:~% sudo gem install mysql
Bulk updating Gem source index for: http://gems.rubyforge.org
Select which gem to install for your platform (i686-darwin8.9.1)
1. mysql 2.7.3 (mswin32)
2. mysql 2.7.1 (mswin32)
3. mysql 2.7 (ruby)
4. mysql 2.6 (ruby)
5. Skip this gem
6. Cancel installation
> 3
Building native extensions. This could take a while...
ERROR: While executing gem ... (Gem::Installer::ExtensionBuildError)
ERROR: Failed to build gem native extension.

ruby extconf.rb install mysql
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lm... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lz... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lsocket... no
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lnsl... no
checking for mysql_query() in -lmysqlclient... no

extconf.rb failed ***

Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.

Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/opt/local/bin/ruby
--with-mysql-config
--without-mysql-config
--with-mysql-dir
--without-mysql-dir
--with-mysql-include
--without-mysql-include=${mysql-dir}/include
--with-mysql-lib
--without-mysql-lib=${mysql-dir}/lib
--with-mysqlclientlib
--without-mysqlclientlib
--with-mlib
--without-mlib
--with-mysqlclientlib
--without-mysqlclientlib
--with-zlib
--without-zlib
--with-mysqlclientlib
--without-mysqlclientlib
--with-socketlib
--without-socketlib
--with-mysqlclientlib
--without-mysqlclientlib
--with-nsllib
--without-nsllib
--with-mysqlclientlib
--without-mysqlclientlib


Gem files will remain installed in /opt/local/lib/ruby/gems/1.8/gems/mysql-2.7 for inspection.
Results logged to /opt/local/lib/ruby/gems/1.8/gems/mysql-2.7/gem_make.out


tkrmb:~% locate libmysqlclient
/usr/local/mysql-5.0.45-osx10.4-i686/lib/libmysqlclient.15.0.0.dylib
/usr/local/mysql-5.0.45-osx10.4-i686/lib/libmysqlclient.15.dylib
/usr/local/mysql-5.0.45-osx10.4-i686/lib/libmysqlclient.a
/usr/local/mysql-5.0.45-osx10.4-i686/lib/libmysqlclient.dylib
/usr/local/mysql-5.0.45-osx10.4-i686/lib/libmysqlclient_r.15.0.0.dylib
/usr/local/mysql-5.0.45-osx10.4-i686/lib/libmysqlclient_r.15.dylib
/usr/local/mysql-5.0.45-osx10.4-i686/lib/libmysqlclient_r.a
/usr/local/mysql-5.0.45-osx10.4-i686/lib/libmysqlclient_r.dylib


tkrmb:~% sudo gem install mysql -- --with-mysql-dir=/usr/local/mysql
Need to update 1 gems from http://gems.rubyforge.org
.
complete
Select which gem to install for your platform (i686-darwin8.9.1)
1. mysql 2.7.3 (mswin32)
2. mysql 2.7.1 (mswin32)
3. mysql 2.7 (ruby)
4. mysql 2.6 (ruby)
5. Skip this gem
6. Cancel installation
> 3
Building native extensions. This could take a while...
Successfully installed mysql-2.7