1. 环境
- Cent OS 4.7
2. 前提
已安装:
- Apache 2(--enable-ssl)
安装文档参考: Installaction - Httpd 。
- Neon (--with-ssl)
安装文档参考该文档附录: Neon的安装。
3. 步骤
从subversion.tigris.org 下载 subversion-1.5.5.tar.bz2安装包。
shell> ./configure \
--prefix=/work/tools/subversion \
--with-apxs=/work/tools/apache2/bin/apxs \
--with-apr=/work/tools/apache2 \
--with-apr-util=/work/tools/apache2 \
--with-neon=/usr/local \
--with-ssl
shell> make
shell> make install
4. 配置
shell> vi /etc/profile
SVN_HOME=/work/tools/subversion
PATH=$SVN_HOME/bin:$PATH
export $PATH
shell> source /etc/profile
shell> mkdir -p /work/repositories
shell> svnadmin create --fs-type fsfs /work/repositories/repo1
shell> cd /work/tools/apache2
shell> vi conf/httpd.conf
<Location /svn> DAV svn SVNListParentPath on SVNParentPath /work/repositories AuthType Basic AuthName "Hillmover Code Repositories" AuthUserFile svnpasswd AuthzSVNAccessFile svnaccess Require valid-user </Location>
shell> bin/htpass -c svnpasswd scm
New password: xxxx
Re-type new password: xxxx
shell> bin/htpass svnpasswd hillmover
New password: xxxx
Re-type new password: xxxx
shell> bin/htpass svnpasswd anotherDev1
...
shell> bin/htpass svnpasswd guest
...
shell> vi svnaccess
[groups] admin = scm dev = hillmover, anotherDev1 # Default access rule for ALL repositories # Everyone cannot access, admins can read/write. [/] * = @admin = rw # Allow developers complete access to their project repos [repo1:/] @dev = rw
shell> service httpd restart
5. 校验
Case 1:
摘要:用户hillmover可以读写代码库repo1。 步骤: 1. User opens the web browser(IE/Firefox), go to page: http://localhost/svn/repo1/ 2. Web browser pop-ups a dialog for authentication 3. User inputs 'hillmover '/'password' 期望结果: 1. Web browser displays the contents of repo1.
Case 2:
摘要:用户guest不可以读/写代码库repo1。 步骤: 1. User opens the web browser(IE/Firefox), go to page: http://localhost/svn/repo1/ 2. Web browser pop-ups a dialog for authentication 3. User inputs 'guest '/'password' 期望结果: 1. Web browser displays a warning about failed authentication, and no any contents of repo1 are displayed.
附: Neon的安装
- 从webdav.org 下载neon-0.28.3.tar.gz安装包.
- shell> ./configure --with-ssl
- shell> make & make install