﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>BlogJava-Alpha-随笔分类-subversion</title><link>http://www.blogjava.net/Alpha/category/40502.html</link><description>多少春秋风雨改 多少崎岖不变爱</description><language>zh-cn</language><lastBuildDate>Tue, 18 Sep 2012 08:51:07 GMT</lastBuildDate><pubDate>Tue, 18 Sep 2012 08:51:07 GMT</pubDate><ttl>60</ttl><item><title>Centos搭建SVN服务器三步曲</title><link>http://www.blogjava.net/Alpha/archive/2011/12/19/366739.html</link><dc:creator>Alpha</dc:creator><author>Alpha</author><pubDate>Mon, 19 Dec 2011 03:44:00 GMT</pubDate><guid>http://www.blogjava.net/Alpha/archive/2011/12/19/366739.html</guid><wfw:comment>http://www.blogjava.net/Alpha/comments/366739.html</wfw:comment><comments>http://www.blogjava.net/Alpha/archive/2011/12/19/366739.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/Alpha/comments/commentRss/366739.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/Alpha/services/trackbacks/366739.html</trackback:ping><description><![CDATA[搭建SVN服务，有效的管理代码，以下三步可以快速搞定。<br /><span style="font-size: 18pt">1、安装&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>&nbsp;&nbsp;&nbsp; <br />
<div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><!--<br />
<br />
Code highlighting produced by Actipro CodeHighlighter (freeware)<br />
http://www.CodeHighlighter.com/<br />
<br />
--><span style="color: #000000">
<div><span style="font-size: 14pt">#yum install subversion</span><br /><br /><span style="font-size: 14pt">&nbsp; 判断是否安装成功</span><br /><span style="font-size: 14pt">#subversion -v<br /><br /></span></div></span><span style="font-size: 14pt; color: #000000">&nbsp; svnserve,&nbsp;version&nbsp;</span><span style="font-size: 14pt; color: #000000">1.6</span><span style="font-size: 14pt; color: #000000">.</span><span style="font-size: 14pt; color: #000000">11</span><span style="font-size: 14pt; color: #000000">&nbsp;(r934486)</span><br /><span style="font-size: 14pt">出现上面的提示，说明安装成功。</span><br /><br />
<div><br /><span style="font-size: 14pt">有了SVN软件后还需要建立SVN库。</span><br /><span style="font-size: 14pt">#</span><span style="font-size: 14pt; color: red">mkdir /opt/svn/repos</span><br /><span style="font-size: 14pt">#</span><span style="font-size: 14pt; color: red">svnadmin create /opt/svn/repos</span><br /><span style="font-size: 14pt">执行上面的命令后，自动在repos下建立多个文件， 分别是conf, db,format,hooks, locks, README.txt。</span></div></div>&nbsp;&nbsp;&nbsp; <br /><br /><span style="font-size: 18pt">2、配置</span><br /><br />&nbsp; &nbsp;&nbsp; 上面的操作很简单，几个命令就搞定, 下面的操作也不难。<br />&nbsp;&nbsp;&nbsp;&nbsp; 进入上面生成的文件夹conf下，进行配置,&nbsp;&nbsp; 有以下几个文件authz, passwd, svnserve.conf<br />&nbsp;&nbsp;&nbsp;&nbsp; 其中authz 是权限控制，可以设置哪些用户可以访问哪些目录,&nbsp;&nbsp; passwd是设置用户和密码的,&nbsp;&nbsp;&nbsp; svnserve是设置svn相关的操作。<br /><br /><br /><span style="font-size: 18pt">&nbsp;&nbsp; 2.1先设置passwd</span><br />&nbsp;&nbsp;&nbsp; <br />
<div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><!--<br />
<br />
Code highlighting produced by Actipro CodeHighlighter (freeware)<br />
http://www.CodeHighlighter.com/<br />
<br />
--><span style="color: #000000">[users]<br />#&nbsp;harry&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;harryssecret<br />#&nbsp;sally&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;sallyssecret<br />hello=123<br />用户名=密码<br /><br />
<div>这样我们就建立了hello用户， 123密码&nbsp;&nbsp;</div></span></div><br />&nbsp;&nbsp; <span style="font-size: 18pt">2.2 再设置权限authz</span><br /><br />
<div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><!--<br />
<br />
Code highlighting produced by Actipro CodeHighlighter (freeware)<br />
http://www.CodeHighlighter.com/<br />
<br />
--><span style="color: #000000">[</span><span style="color: #000000">/</span><span style="color: #000000">]<br />hello</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;rw<br /><br />
<div>意思是hello用户对所有的目录有读写权限，当然也可以限定。<br />如果是自己用，就直接是读写吧。</div><br /></span></div><br /><br /><span style="font-size: 18pt">2.3最后设定snvserv.conf</span><br /><span style="font-size: 18pt"><br /></span>
<div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><!--<br />
<br />
Code highlighting produced by Actipro CodeHighlighter (freeware)<br />
http://www.CodeHighlighter.com/<br />
<br />
--><span style="color: #000000">anon</span><span style="color: #000000">-</span><span style="color: #000000">access&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;none&nbsp;#&nbsp;使非授权用户无法访问<br />auth</span><span style="color: #000000">-</span><span style="color: #000000">access&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;write&nbsp;#&nbsp;使授权用户有写权限<br />password</span><span style="color: #000000">-</span><span style="color: #000000">db&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;password<br />authz</span><span style="color: #000000">-</span><span style="color: #000000">db&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;authz&nbsp;&nbsp;&nbsp;#&nbsp;访问控制文件<br />realm&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">/</span><span style="color: #000000">opt</span><span style="color: #000000">/</span><span style="color: #000000">svn</span><span style="color: #000000">/</span><span style="color: #000000">repos&nbsp;#&nbsp;认证命名空间，subversion会在认证提示里显示，并且作为凭证缓存的关键字。<br /></span><span style="color: red">采用默认配置. 以上语句都必须顶格写,&nbsp;左侧不能留空格,&nbsp;否则会出错.</span></div><br />好了，通过以上配置，你的svn就可以了。<br /><br /><span style="font-size: 24pt">3、连接</span><br /><br />
<div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="font-size: 12pt; color: #000000">启动svn:&nbsp;svnserve&nbsp;</span><span style="font-size: 12pt; color: #000000">-</span><span style="font-size: 12pt; color: #000000">d&nbsp;</span><span style="font-size: 12pt; color: #000000">-</span><span style="font-size: 12pt; color: #000000">r&nbsp;</span><span style="font-size: 12pt; color: #000000">/</span><span style="font-size: 12pt; color: #000000">opt</span><span style="font-size: 12pt; color: #000000">/</span><span style="font-size: 12pt; color: #000000">svn</span><span style="font-size: 12pt; color: #000000">/</span><span style="font-size: 12pt; color: #000000">repos<br /><br /><div>svn默认端口是3690</div></span><span style="font-size: 12pt; color: #000000">如果已经有svn在运行，可以换一个端口运行<br /></span><span style="font-size: 12pt; color: #000000">svnserve&nbsp;</span><span style="font-size: 12pt; color: #000000">-</span><span style="font-size: 12pt; color: #000000">d&nbsp;</span><span style="font-size: 12pt; color: #000000">-</span><span style="font-size: 12pt; color: #000000">r&nbsp;</span><span style="font-size: 12pt; color: #000000">/</span><span style="font-size: 12pt; color: #000000">opt</span><span style="font-size: 12pt; color: #000000">/</span><span style="font-size: 12pt; color: #000000">svn</span><span style="font-size: 12pt; color: #000000">/</span><span style="font-size: 12pt; color: #000000">repos&nbsp;</span><span style="font-size: 12pt; color: #000000">--</span><span style="font-size: 12pt; color: #000000">listen</span><span style="font-size: 12pt; color: #000000">-</span><span style="font-size: 12pt; color: #000000">port&nbsp;</span><span style="font-size: 12pt; color: #000000">3391</span><span style="color: #000000"><br /><br /></span><span style="font-size: 12pt; color: #000000">这样同一台服务器可以运行多个svnserver<br /><br /></span><span style="font-size: 12pt; color: #000000">好了，启动成功后,就可以使用了。<br /></span><span style="font-size: 12pt; color: #000000">建议采用TortoiseSVN，&nbsp;连接地址为:&nbsp;svn:</span><span style="font-size: 12pt; color: #008000">//</span><span style="font-size: 12pt; color: #008000">your&nbsp;server&nbsp;address&nbsp;（如果指定端口需要添加端口&nbsp;&nbsp;:端口号）</span><span style="color: #008000"><br /></span><span style="color: #000000"><br /></span><span style="font-size: 12pt; color: #000000">连接后可以上传本地的文件，有效的管理你的代码。</span><span style="color: #000000"><br /></span></div><br /><div><h2>svn 端口和常用命令</h2>    <p>有效选项:<br />&nbsp; -d [--daemon]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : 后台模式<br />&nbsp; --listen-port 参数&nbsp;&nbsp;&nbsp;&nbsp; : 监听端口（后台模式）<br />&nbsp; --listen-host 参数&nbsp;&nbsp;&nbsp;&nbsp; : 监听主机名或IP地址（后台模式）<br />&nbsp; --foreground&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : 在前台运行（调试时有用）<br />&nbsp; -h [--help]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : 显示这个帮助<br />&nbsp; --version&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : 显示程序版本信息<br />&nbsp; -i [--inetd]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : inetd 模式<br />&nbsp; -r [--root] 参数&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : 服务根目录<br />&nbsp; -R [--read-only]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : 强制只读成；优先于仓库配置文件<br />&nbsp; -t [--tunnel]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : 隧道模式<br />&nbsp; --tunnel-user 参数&nbsp;&nbsp;&nbsp;&nbsp; : 隧道用户名（模式是当前用户UID的名字）<br />&nbsp; -X [--listen-once]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : 监听一次（调试时有用）<br />&nbsp; --pid-file 参数&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : 将服务进程ID写入文件ARG中<br />&nbsp; --service&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : 作为windows服务运行(仅SCM)[/quote]</p><p>你可以用--listen-port 指定端口</p><p>在httpd.conf中，查找Listen 80，将80修改为你想要的端口,svn默认端口是3690</p><p>为svnserve 加上--listen-port参数，比如svnserve -d -r d:\svn --listen-port 81</p>你可以采用svn＋apache组合搭建，既可以设置你想要的端口，还可以以WEB形式访问代码库</div><br />通过以上三步，可以快速的搭建起svn<br /><br /><div><span style="font-family: 宋体"><strong>SVN数据库迁移方法</strong></span></div><br /><div><span style="font-family: 宋体">版本库数据的移植:svnadmin dump<span style="font-family: 宋体">、</span>svnadmin load</span> <p><span style="font-family: 宋体">导出</span>:</p> <p><span>$svnadmin dump repos &gt; dumpfile //</span><span style="font-family: 宋体">将指定的版本库导出成文件</span>dumpfile</p> <p><span style="font-family: 宋体">新建:</span></p> <p><span style="font-family: 宋体">$svnadmin create newrepos</span></p> <p><span style="font-family: 宋体">导入</span><span>:</span></p> <p><span>$svnadmin load newrepos &lt; dumpfile</span></p></div><img src ="http://www.blogjava.net/Alpha/aggbug/366739.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/Alpha/" target="_blank">Alpha</a> 2011-12-19 11:44 <a href="http://www.blogjava.net/Alpha/archive/2011/12/19/366739.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>windows下架设subversion服务器</title><link>http://www.blogjava.net/Alpha/archive/2007/08/29/141108.html</link><dc:creator>Alpha</dc:creator><author>Alpha</author><pubDate>Wed, 29 Aug 2007 14:13:00 GMT</pubDate><guid>http://www.blogjava.net/Alpha/archive/2007/08/29/141108.html</guid><wfw:comment>http://www.blogjava.net/Alpha/comments/141108.html</wfw:comment><comments>http://www.blogjava.net/Alpha/archive/2007/08/29/141108.html#Feedback</comments><slash:comments>4</slash:comments><wfw:commentRss>http://www.blogjava.net/Alpha/comments/commentRss/141108.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/Alpha/services/trackbacks/141108.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: windows下架设subversion服务器&nbsp;&nbsp;<a href='http://www.blogjava.net/Alpha/archive/2007/08/29/141108.html'>阅读全文</a><img src ="http://www.blogjava.net/Alpha/aggbug/141108.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/Alpha/" target="_blank">Alpha</a> 2007-08-29 22:13 <a href="http://www.blogjava.net/Alpha/archive/2007/08/29/141108.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>