1、安裝APR-1.2.7和APR-util-1.2.7?
(下載地址:http://apr.apache.org/)
#tar zxvf? apr-1.2.7.tar.gz
#cd?? apr-1.3.9
#./configure
#make
#make install
#tar zxvf apr-util-1.2.7.tar.gz
#cd cd apr-util-1.3.9
#./configure --with-apr=/usr/local/apr/
#make
#make install
2、編譯安裝apache。
#tar zxvf httpd-2.2.3.tar.gz
#cd httpd-2.2.3
#./configure --prefix=/opt/apache??\
???????????? --enable-dav??????????\
???????????? --enable-so???????????? \
???????????? --enable-maintainer-mode?\
????? ???????--with-apr=/usr/local/apr/bin/apr-1-config?\
???????????? --with-apr-util=/usr/local/apr/bin/apu-1-config
#make
#make install
檢查是否安裝成功
#cd??/opt/apache/bin
#./apachectl start
在瀏覽器中輸入http://192.168.1.104/。
3、安裝subversion-deps-1.6.1.tar.gz和subversion-1.6.1-tar.gz
#tar zxvfsubversion-deps-1.6.1.tar.gz
#tar zxvfsubversion-1.6.1.tar.gz
#cdsubversion-1.6.1
#./configure???--prefix=/opt/svn??? ?\
???????????? ???--with-apxs=/opt/apache/bin/apxs?\
???????????? ???--with-apr=/usr/local/apr/??\
????? ??????????--with-apr-util=/usr/local/apr/
#make &&
make install
[if !supportLineBreakNewLine]
[endif]
4、在apache中配置SVN
????? #vi??/opt/apache/conf/httpd.conf
???? ①如果你看到如下兩句,說明安裝是成功的
????? LoadModuledav_svn_module???? modules/mod_dav_svn.so
????? LoadModuleauthz_svn_module?? modules/mod_authz_svn.so
????? 如果有下面一句就用#注釋掉
????? #LoadModulefoo_module modules/mod_foo.so
???? ② 定義apache訪問svn配置:
? ? <Location /svn>
???????? DAV ?svn
????? ????????# SVNPath /opt/svndata
?????????????SVNParentPath /opt/svn/bin/repository??//svn父目錄
?????? ???????//權(quán)限配置文件
?????????????AuthzSVNAccessFile???
????????????????????/opt/svn/bin/repository/project/conf/authz
?????????????AuthType Basic? //連接類型配置
?????????????AuthName "Subversion repository"?? //連接礦提示
????????????? //用戶配置文件
?????????????AuthUserFile
???????????????????/opt/svn/bin/repository/project/conf/passwd
?????????????Require valid-user? //采用何種認(rèn)證
</Location>
#./apachectl restart
5、建立和導(dǎo)入版本庫
#cd?? /opt/svn/bin
#mkdir ./repository
創(chuàng)建倉庫
#./svnadmin?? create??./repository/project
#chmod? 755? ./repository
配置用戶文件和權(quán)限文件
#cd? ./repository/project/conf
與apache的配置相同/opt/svn/bin/repository/project/conf/passwd
#/opt/apache/bin/htpasswd-c?? \
????? /opt/svn/bin/repository/project/conf/passwd?? huang(用戶名)
跟apache配置相同/opt/svn/bin/repository/project/conf/authz
#vi/opt/svn/bin/repository/project/conf/authz
添加以下配置項:
?#倉庫project的根目錄訪問權(quán)限
?[project:/]??
?#用戶huang對倉庫project的訪問權(quán)限
???? huang=rw
#表示所在所有倉庫的根目錄
?[/]
#表示所有用戶具有讀權(quán)限
*=r
?
導(dǎo)出使用以下命令
#/opt/svn/bin/svn checkouthttp://localhost:8888/svn/project
導(dǎo)入使用以下命令
#/opt/svn/bin/svn? import需要導(dǎo)入文件的路徑?? 導(dǎo)入到的倉庫 -m "注釋"
例子:
#/opt/svn/bin/svn? import??\
???????? /root/svn? file:///opt/svn/bin/repository/project\
???????? -m?"初始導(dǎo)入"