linux svn安装和配置,不结合apache
一,安装要的软件
wgethttp://subversion.tigris.org/downloads/subversion-1.6.1.tar.gz
wgethttp://subversion.tigris.org/downloads/subversion-deps-1.6.1.tar.gz
svn的官方网址是http://subversion.tigris.org/
上面二个压缩文件解压后会放到同一个文件下,不要另建文件夹
二,安装独立svn
1,解压安装
1.tarzxvfsubversion-1.6.1.tar.gz
2.tarzxvfsubversion-deps-1.6.1.tar.gz
3.cdsubversion-1.6.1/
4../configure--prefix=/usr/local/svn
5.make&&makeinstall
到这儿就安装好了。安装独立svn,它也考虑到将来有可能会和apache结合,所以安装的时候,它把和apache结合要用到的模块都放到/usr/lib/httpd/modules,部分提示如下
Librarieshavebeeninstalledin:
/usr/lib/httpd/modules
Ifyoueverhappentowanttolinkagainstinstalledlibraries
inagivendirectory,LIBDIR,youmusteitheruselibtool,and
2,查看svn信息
[root@BlackGhostbin]#/usr/local/svn/bin/svnserve--version
svnserve,version1.6.1(r37116)
compiledJul72010,23:06:21
Copyright(C)2000-2009CollabNet.
Subversionisopensourcesoftware,seehttp://subversion.tigris.org/
ThisproductincludessoftwaredevelopedbyCollabNet(http://www.Collab.Net/).
Thefollowingrepositoryback-end(FS)modulesareavailable:
*fs_fs:Moduleforworkingwithaplainfile(FSFS)repository.
CyrusSASLauthenticationisavailable.
3,将svn的bin目录加到环境变量中去
[root@BlackGhost/]#PATH=$PATH:/usr/local/svn/bin
[root@BlackGhost/]#exportPATH
[root@BlackGhost/]#svn
svnsvnadminsvnlooksvnsync
svn2abssvndumpfiltersvnservesvnversion
三,建立仓库,配置svn
1,建个svn的根目录,因为项目不只一个
[zhangy@BlackGhost~]$mkdir-p/home/zhangy/www#-p的意思是说如果没有父目录建之
2,建个仓库
[zhangy@BlackGhost~]$mkdir-p/home/zhangy/www/repos
[zhangy@BlackGhostwww]$svnadmincreate/home/zhangy/www/repos/
3,导入数据
[zhangy@BlackGhost~]$svnimport./svntestfile:///home/zhangy/www/repos-m"Initialrepositorytest"
Addingsvntest/test.php
Committedrevision1.
4,修改svnserve.conf
[root@BlackGhostconf]#visvnserve.conf
[general]
anon-access=none
auth-access=write
password-db=passwd
authz-db=authz
5,目录控制文件authz
[root@BlackGhostconf]#viauthz
[groups]
admin=zhangy
[repos:/]
@admin=rw
*=r
6,修改用户密码文件passwd
[root@BlackGhostconf]#vipasswd
[users]
zhangy=*****
四,启动和简单测试
1,启动svn
[root@BlackGhostwww]#svnserve-d-r/home/zhangy/www
在这里特别的要注意,/home/zhangy/www是仓库的根目录,不要和[repos:/]目录重叠了。如果重叠是会提示你以下错误
[zhangy@BlackGhostcheckout]$svncosvn://127.0.0.1/
svn:Authorizationfailed
2,测试svn
a),checkout
[zhangy@BlackGhostcheckout]$svncosvn://127.0.0.1/repos
Authenticationrealm:<svn://127.0.0.1:3690>3d0c32b1-3841-4518-b6b1-dcdb6c7ed716
Passwordfor'zhangy':
-----------------------------------------------------------------------
ATTENTION!Yourpasswordforauthenticationrealm:
<svn://127.0.0.1:3690>3d0c32b1-3841-4518-b6b1-dcdb6c7ed716
canonlybestoredtodiskunencrypted!Youareadvisedtoconfigure
yoursystemsothatSubversioncanstorepasswordsencrypted,if
possible.Seethedocumentationfordetails.
Youcanavoidfutureappearancesofthiswarningbysettingthevalue
ofthe'store-plaintext-passwords'optiontoeither'yes'or'no'in
'/home/zhangy/.subversion/servers'.
-----------------------------------------------------------------------
Storepasswordunencrypted(yes/no)?yes
Arepos/test.php
Checkedoutrevision1.
checkout的时候会出现Storepasswordunencrypted,解决办法
vi/home/zhangy/.subversion/servers
找到以下内容,注释去掉并改成yes就行了
#store-plaintext-passwords=no
b),add和submit
[zhangy@BlackGhostrepos]$svnaddaaa.php
Aaaa.php
[zhangy@BlackGhostrepos]$svncommitaaa.php-m"ok"
Addingaaa.php
Transmittingfiledata.
Committedrevision2.
svn的操作有很多,在这儿就不多说了。
相关推荐
pub_svnserve.conf的 pub_authz.conf的配置文件有非法字符的原因引起,需要查找pub_authz.conf提的非法内容比如多余的空格删除或直接将pub_authz.conf