yum install subversion
apache安装详见
http://jinjzk.iteye.com/blog/2082152
1、依赖包
tar xzvf zlib-1.2.8.tar.gz
cd zlib-1.2.8
./configure --prefix=/usr/local/zlib
make
make install
2、安装svn
tar zxvf sqlite-autoconf-3080100.tar.gz
tar zxvf subversion-1.8.5.tar.gz
cd sqlite-autoconf-3080100
./configure --prefix=/usr/local/sqlite
make
make install
cd subversion-1.8.5
./configure --prefix=/usr/local/subversion --with-apxs=/usr/local/apache/bin/apxs --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --with-sqlite=/usr/local/sqlite --enable-maintainer-mode --with-zlib=/usr/local/zlib
make
make install
3、apache配置
so文件复制
cp /usr/local/subversion/libexec/mod_authz_svn.so /usr/local/apache/modules/mod_authz_svn.so
cp /usr/local/subversion/libexec/mod_dav_svn.so /usr/local/apache/modules/mod_dav_svn.so
httpd.conf配置文件修改
vi /usr/local/apache/conf/httpd.conf
LoadModule dav_module modules/mod_dav.so
LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so
#svn
<Location /svn>
DAV svn
SVNParentPath /usr/svn
AuthType Basic
AuthName "Subversion repository"
#密码存储文件
AuthUserFile /usr/local/subversion/auth.conf
Require valid-user
#用户访问目录的权限文件
AuthzSVNAccessFile /usr/local/subversion/access.conf
</Location>
4、SVN配置
vi /etc/profile
PATH=/usr/local/apache/bin:$PATH
PATH=/usr/local/subversion/bin:$PATH
退出VI
source /etc/profile
#创建版本库
svnadmin create /usr/svn/repos
报错:
svnadmin: /lib/libz.so.1: no version information available (required by /usr/local/subversion/lib/libsvn_delta-1.so.0)
解决:找到zlib中的文件
cp /usr/tmp/svn/zlib-1.2.8/libz.so.1 /lib/
#添加用户并设置密码:
htpasswd -c /usr/local/subversion/auth.conf jinzk
#输入两次密码
htpasswd /usr/local/subversion/auth.conf wuyq
#输入两次密码
#SVN用户访问目录权限配置文件
touch /usr/local/subversion/access.conf
vi /usr/local/subversion/access.conf
#用户组设置
[groups]
g1 = jinzk
g2 = jinzk
#版本库,组1为读写权限,组2为只读
[repos:/]
@g1 = rw
@g2 = r
* =
#/usr/svn/repos/conf/svnserve.conf配置文件修改
anon-access = none
auth-access = write
password-db = /usr/local/subversion/auth.conf
authz-db = /usr/local/subversion/access.conf
启动SVN
#svnserve -d -r /usr/svn --config-file /usr/svn/svnserve.conf
svnserve -d -r /usr/svn --config-file /usr/svn/repos/conf/svnserve.conf
启动APACHE
/usr/local/apache/bin/apachectl start