- 论坛徽章:
- 0
|
安装环境
CentOS 4.3 Final
软件列表
httpd-2.0.61.tar.gz
db-4.3.29.tar.gz
subversion-1.3.2.tar.gz
软件位置
/data/software
安装步骤
#mkdir /data/software/pkg -p
安装Berkeley DB
#cd /data/software/pkg
#tar zxvf ../db-4.3.29.tar.gz
#cd db-4.3.29/docs
#../dist/configure
#make && make install
#echo /usr/local/BerkeleyDB.4.3/lib >> /etc/ld.so.conf
#ldconfig
安装Apache
#cd /data/software/pkg
#tar zxvf ../httpd-2.0.61.tar.gz
#./configure --prefix=/usr/apache --enable-dav \ --with-berkeley-db=/usr/local/BerkeleyDB.4.3 --with-dbm=db43
#make && make install
安装Subversion
#cd /data/software/pkg
#tar zxvf ../db-4.3.29.tar.gz
#cd db-4.3.29
#./configure --with-apxs=/usr/apache/bin/apxs --prefix=/usr/local/subversion \ --with-apr=/usr/apache --with-apr-util=/usr/apache --with-ssl --with-zlib \ --enable-maintainer-mode --with-berkeley-db=/usr/local/BerkeleyDB.4.3
#make && make install
建立仓库
#groupadd svn
#useradd svnroot -g svn
#passwd svnroot
#su svnroot
#mkdir /data/svn/repository
#cd /usr/local/subversion/bin
#./svnadmin create /data/svn/repository/test
#cd /data/svn/svnroot/repository/test
#/usr/local/subversion/bin/svnadmin --version
#exit (返回root帐号)
#chmod 700 /data/website/svn/repository
配置SVN
#vi /usr/apache/conf/httpd.conf
//找到下列语句,如果没有则自行添加
LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so
//在后面添加
DAV svn
SVNParentPath /data/website/svn/repository
AuthzSVNAccessFile /etc/svn-access-file
AuthType Basic
AuthName "SVN Test"
AuthUserFile /etc/svn-auth-file
Require valid-user
//#/usr/apache/bin/apachectl restart
生成验证用户(第一次生成时加上参数c,以后增加用户则不用)
#/usr/apache/bin/htpasswd -(c)m /etc/svn-auth-file test
输入用户密码
分配权限
#vi /etc/svn-access-file
### This file is an example authorization file for svnserve.
### Its format is identical to that of mod_authz_svn authorization
### files.
### As shown below each section defines authorizations for the path and
### (optional) repository specified by the section name.
### The authorizations follow. An authorization line can refer to a
### single user, to a group of users defined in a special [groups]
### section, or to anyone using the '*' wildcard. Each definition can
### grant read ('r') access, read-write ('rw') access, or no access
### ('').
[groups]
# harry_and_sally = harry,sally
# [/foo/bar]
# harry = rw
# * =
[/]
# @harry_and_sally = rw
# * = r
test = rw
steven = r
//[groups]下面定义的是组名称及成员用户,[/]表示对整个test项目的操作,他下面的是用户或组在这个项目里的权限
修改Apache启动权限
#vi /usr/apache/conf/httpd.conf
//将apache运行的用户和用户组改成跟仓库一样权限的用户及组
User svnroot
Group svn
#/usr/apache/bin/apachectl restart
访问http://IP/svn/test ,输入刚才创建的用户名和密码进行身份验证,且通过验证后应该可以看到信息。Rivision 1:/
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/13177/showart_507636.html |
|