Version: CentOS6.2_32bit、httpd-2.2.24.tar.gz、subversion-1.7.9.tar.gz |
1、Httpd的安装: [iyunv@SRV src]# tar zxvf httpd-2.2.24.tar.gz [iyunv@SRV src]# cd httpd-2.2.24 [iyunv@SRV httpd-2.2.24]# ./configure --prefix=/usr/local/apache2 --enable-dav --enable-so --enable-maintainer-mode --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util [iyunv@SRV httpd-2.2.24]# make && make install |
2、Subversion的安装: [iyunv@SRV src]# tar zxvf subversion-1.7.9.tar.gz [iyunv@SRV src]# cd subversion-1.7.9 [iyunv@SRV subversion-1.7.9]# ./configure --prefix=/usr/local/subversion --with-apxs=/usr/local/apache2/bin/apxs --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --without-berkeley-db [iyunv@SRV subversion-1.7.9]# make && make install
[iyunv@SRV bin]# svnserve --version svnserve,版本1.7.9 (r1462340) 编译于 Apr 24 2013,20:09:13
Copyright (C) 2013 The Apache Software Foundation. This software consists of contributions made by many people; see the NOTICE file for more information.
下列版本库后端(FS) 模块可用:
* fs_fs : 模块与文本文件(FSFS)版本库一起工作。
Cyrus SASL 认证可用。
[iyunv@SRV bin]#
configure: error: Subversion requires SQLite
[iyunv@SRV src]# wget http://www.sqlite.org/2013/sqlite-amalgamation-3071602.zip
[iyunv@SRV src]# unzip sqlite-amalgamation-3071602.zip
[iyunv@SRV src]# cd sqlite-amalgamation-3071602
[iyunv@SRV sqlite-amalgamation-3071602]# mkdir -p ../subversion-1.7.9/sqlite-amalgamation
[iyunv@SRV sqlite-amalgamation-3071602]# cp sqlite3.c ../subversion-1.7.9/sqlite-amalgamation
[iyunv@SRV sqlite-amalgamation-3071602]# cd ../subversion-1.7.9
[iyunv@SRV subversion-1.7.9]#
|
3、配置Apache与SVN [iyunv@SRV local]# vi apache2/conf/httpd.conf LoadModule dav_svn_module modules/mod_dav_svn.so LoadModule authz_svn_module modules/mod_authz_svn.so
[iyunv@SRV ~]# mkdir /opt/svndata [iyunv@SRV ~]# chown -Rv daemon /opt/svndata/ [iyunv@SRV ~]# chmod -R 755 /opt/svndata/ [iyunv@SRV ~]# /usr/local/subversion/bin/svnadmin create --fs-type fsfs /opt/svndata/Project1 [iyunv@SRV ~]# /usr/local/apache2/bin/htpasswd -c /opt/svndata/auth_user RELEARN New password: Re-type new password: Adding password for user RELEARN [iyunv@SRV ~]# /usr/local/apache2/bin/htpasswd /opt/svndata/auth_user Readonly New password: Re-type new password: Adding password for user Readonly
[iyunv@SRV ~]# vi /opt/svndata/Access_Rights [groups] AdminGroup = RELEARN GuestGroup = Readonly [Project1:/] @AdminGroup = rw @GuestGroup = r
[iyunv@SRV ~]# vi /usr/local/apache2/conf/httpd.conf #SVN config file Include conf/extra/svn-config.conf [iyunv@SRV ~]# vi /usr/local/apache2/conf/extra/svn-config.conf <Location /svn> DAV svn SVNParentPath /opt/svndata AuthType Basic AuthName "Subversion" AuthzSVNAccessFile /opt/svndata/Access_Rights AuthUserFile /opt/svndata/auth_user Require valid-user </Location> |
[iyunv@SRVsvndata]# vi Access_Rights [groups] Project1_AdminGroup = RELEARN Project1_GuestGroup = Readonly
Project2_AdminGroup = Project2_admin Project2_GuestGroup = Project2_user [Project1:/] @Project1_AdminGroup = rw @Project1_GuestGroup = r
[Project2:/] @Project2_AdminGroup = rw @Project2_GuestGroup = r ~――――――――― [groups] G_Project1 = RELEARN,wuyw [Project1:/] @G_Project1 = rw * = r
<Location /svn> DAV svn #开启DAV模块支持 SVNParentPath /var/www/newsvn
#<LimitExceptGET PROPFIND OPTIONS REPORT> AuthType Basic AuthName "Subversion" AuthUserFile /var/www/newsvn/conf/auth.conf AuthzSVNAccessFile /var/www/newsvn/conf/access.conf #授权配置文件(路经访问权限) Require valid-user #</LimitExcept> 打开</LimitExcept>注释,将允许匿名访问 </Location>
|