<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title>百里挑一</title> 
<link>http://www.admin99.net/index.php</link> 
<description>linux命令 &#124; seo优化技术 &#124; linux系统管理员指南 --我的学习园地</description> 
<language>zh-cn</language> 
<copyright>Powered by Bo-blog 2.0.2 sp2</copyright>
<item>
<link>http://www.admin99.net/read.php?459</link>
<title>svn: Valid UTF-8 data 错误的解决</title> 
<author>real &lt;real@admin99.net&gt;</author>
<category>svn</category>
<pubDate>Tue, 19 Jan 2010 02:49:17 +0000</pubDate> 
<guid>http://www.admin99.net/read.php?459</guid> 
<description>
<![CDATA[ 
	有时候，我们在项目svn提交时会出现这样的错误，<br/>svn: Valid UTF-8 data<br/>(hex: 47 64 20 53 63)<br/>followed by invalid UTF-8 sequence<br/>(hex: e9 6e 69 63)<br/><br/>这样的错误的原因是所提交的文件中包含非utf8的编码， 假如你知道该非utf8编码是什么编码类型的话（例如 ：iso-8859-15），可以这样解决这个错误：<br/><br/>convmv -r -f iso-8859-15 -t utf8 --notest -i /my/project/path<br/><br/>convmv命令可通过 yum -y install convmv来安装<br/>Tags - <a href="http://www.admin99.net/tag.php?tag=svn" rel="tag">svn</a>
  ]]> 
</description>
</item><item>
<link>http://www.admin99.net/read.php?458</link>
<title>svn: Unrecognized URL scheme 问题的解决 </title> 
<author>real &lt;real@admin99.net&gt;</author>
<category>svn</category>
<pubDate>Tue, 19 Jan 2010 02:48:02 +0000</pubDate> 
<guid>http://www.admin99.net/read.php?458</guid> 
<description>
<![CDATA[ 
	默认安装的svn会支持两种导入导出方式 ra_svn ra_local分别是svn协议和本地文件导入导出<br/>如果要通过http协议导入导出，比如<br/><br/><div class="quote"><div class="quote-title">引用</div><div class="quote-content">svn import /data/htdocs/admin99 http://192.168.1.100:519/svn/admin99/ -m "initial import" --username='admin99' --password='admin99'</div></div><br/>就会报上面的错误<br/>解决的办法是安装neon<br/><br/><div class="quote"><div class="quote-title">引用</div><div class="quote-content">cd /usr/src<br/>wget http://www.webdav.org/neon/neon-0.25.5.tar.gz<br/>tar -xvzf neon-0.25.5.tar.gz<br/>mv neon-0.25.5 neon</div></div><br/>将neon移到subversion的源文件的根目录中，重新编译安装subversion即可<br/>然后运行 svn --version 能看到已经多了一个模块ra_neon出来<br/><br/>svn, version 1.5.4 (r33841)<br/> &nbsp; compiled Jan 19 2010, 09:52:57<br/><br/>Copyright (C) 2000-2008 CollabNet.<br/>Subversion is open source software, see http://subversion.tigris.org/<br/>This product includes software developed by CollabNet (http://www.Collab.Net/).<br/><br/>The following repository access (RA) modules are available:<br/><br/>* ra_neon : Module for accessing a repository via WebDAV protocol using Neon.<br/> &nbsp;- handles 'http' scheme<br/>* ra_svn : Module for accessing a repository using the svn network protocol.<br/> &nbsp;- handles 'svn' scheme<br/>* ra_local : Module for accessing a repository on local disk.<br/> &nbsp;- handles 'file' scheme<br/>Tags - <a href="http://www.admin99.net/tag.php?tag=svn" rel="tag">svn</a>
  ]]> 
</description>
</item><item>
<link>http://www.admin99.net/read.php?457</link>
<title>向svn中导入项目</title> 
<author>real &lt;real@admin99.net&gt;</author>
<category>svn</category>
<pubDate>Tue, 19 Jan 2010 02:41:02 +0000</pubDate> 
<guid>http://www.admin99.net/read.php?457</guid> 
<description>
<![CDATA[ 
	导入本地项目<br/>svn import /data/htdocs/admin99 file:///data/svn/repos/admin99/ -m "initial import" --username='admin99' --password='admin99'<br/>导入异地项目<br/>svn import /data/htdocs/admin99 http://192.168.1.100:519/svn/admin99/ -m "initial import" --username='admin99' --password='admin99'<br/>Tags - <a href="http://www.admin99.net/tag.php?tag=svn" rel="tag">svn</a>
  ]]> 
</description>
</item><item>
<link>http://www.admin99.net/read.php?447</link>
<title>svn: Unrecognized URL scheme for</title> 
<author>real &lt;real@admin99.net&gt;</author>
<category>svn</category>
<pubDate>Wed, 26 Aug 2009 09:12:07 +0000</pubDate> 
<guid>http://www.admin99.net/read.php?447</guid> 
<description>
<![CDATA[ 
	svn安装的时候需要neon的插件<br/>cd /usr/src<br/>wget http://www.webdav.org/neon/neon-0.25.5.tar.gz<br/>tar xzvf neon-0.25.5.tar.gz<br/>cd neon-0.25.5<br/>./configure --prefix=/usr/local/neon<br/>make<br/>make install<br/><br/>便宜svn的时候加上参数 --with-neon=/usr/local/neon<br/>Tags - <a href="http://www.admin99.net/tag.php?tag=svn" rel="tag">svn</a>
  ]]> 
</description>
</item><item>
<link>http://www.admin99.net/read.php?346</link>
<title>安装subversion并与apache集成</title> 
<author>real &lt;real@admin99.net&gt;</author>
<category>svn</category>
<pubDate>Sun, 24 Aug 2008 09:59:41 +0000</pubDate> 
<guid>http://www.admin99.net/read.php?346</guid> 
<description>
<![CDATA[ 
	subversion版本 1.5.1<br/>apache版本 2.0.63<br/><br/>1。安装apache<br/>./configure --prefix=/usr/local/apache --enable-dav --enable-so --enable-maintainer-mode<br/>make<br/>make install<br/><br/>ps: 若是64位系统 编译参数中加上一条 --with-expat=builtin 否则make时会出错<br/><br/>2。安装subversion<br/>./configure --with-apxs=/usr/local/apache/bin/apxs --with-apr=/usr/local/apache/bin/apr-config --with-apr-util=/usr/local/apache/bin/apu-config<br/>make<br/>make install<br/><br/>3。检查apache配置文件，确认有下面两行<br/>LoadModule dav_svn_module &nbsp; &nbsp; modules/mod_dav_svn.so<br/>LoadModule authz_svn_module &nbsp; modules/mod_authz_svn.so<br/><br/>4。配置apache<br/> &nbsp; &nbsp;&lt;Location /svn&gt;<br/> &nbsp; &nbsp; &nbsp; &nbsp;DAV svn<br/> &nbsp; &nbsp; &nbsp; &nbsp;SVNParentPath /data/svn/repos<br/> &nbsp; &nbsp; &nbsp; &nbsp;AuthType Basic<br/> &nbsp; &nbsp; &nbsp; &nbsp;AuthName &quot;Subversion repository&quot;<br/> &nbsp; &nbsp; &nbsp; &nbsp;AuthUserFile /data/svn/passwd<br/> &nbsp; &nbsp; &nbsp; &nbsp;Require valid-user<br/> &nbsp; &nbsp;&lt;/Location&gt;<br/><br/>5。建立SVN存储仓库<br/>mkdir -p /data/svn/repos<br/>svnadmin create /data/svn/repos/admin99<br/><br/>6。建立本地访问控制文件<br/>/usr/local/apache/bin/htpasswd -c /data/svn/passwd real<br/>会提示输入密码，默认是MD5加密<br/><br/>7。注意将repos目录设置为apache可读写，不然提交的时候会报权限错误<br/>至此已配置完毕<br/>通过浏览器访问 http://your-server-ip/svn/admin99 即可访问svn<br/>Tags - <a href="http://www.admin99.net/tag.php?tag=svn" rel="tag">svn</a> , <a href="http://www.admin99.net/tag.php?tag=apache" rel="tag">apache</a>
  ]]> 
</description>
</item><item>
<link>http://www.admin99.net/read.php?267</link>
<title>配置subversion 自动邮件通知</title> 
<author>real &lt;real@admin99.net&gt;</author>
<category>svn</category>
<pubDate>Wed, 24 Oct 2007 08:28:58 +0000</pubDate> 
<guid>http://www.admin99.net/read.php?267</guid> 
<description>
<![CDATA[ 
	别的地方转来存档滴<br/><br/>一。安装Active Perl<br/># wget http://downloads.activestate.com ... 4-gcc-267479.tar.gz<br/># chmod a+x ActivePerl-5.8.8.819-i686-linux-glibc-2.2.4-gcc-267479.tar.gz<br/># tar zxvf ActivePerl-5.8.8.819-i686-linux-glibc-2.2.4-gcc-267479.tar.gz<br/># cd ActivePerl-5.8.8.819-i686-linux-glibc-2.2.4-gcc-267479<br/># ./install.sh<br/><br/>二。安装Perl模块Module::Build<br/># wget http://search.cpan.org/CPAN/auth ... Build-0.2805.tar.gz<br/># chmod a+x Module-Build-0.2805.tar.gz<br/># tar zxvf &nbsp;Module-Build-0.2805.tar.gz<br/># cd Module-Build-0.2805<br/># perl Build.PL<br/># ./Build<br/># ./Build test<br/># ./Build install<br/><br/>三。安装Perl模块Authen::SASL (optional Perl module for SVN::Notify)<br/># wget http://search.cpan.org/CPAN/auth ... en-SASL-2.10.tar.gz<br/># chmod a+x Authen-SASL-2.10.tar.gz<br/># tar zxvf Authen-SASL-2.10.tar.gz<br/># cd Authen-SASL-2.10<br/># perl Makefile.pl<br/>==> Auto-install the 1 optional module(s) from CPAN? [n] y<br/>==> Auto-install the 1 optional module(s) from CPAN? [n] y &nbsp; //之后一路按回车<br/># make test<br/># make install &nbsp; //安装完成<br/><br/>这里遇到一个小问题，提示说没有/root/.cpan/sources/MIRRORED.BY 这个文件，然后安装程序自己去下载这个文件了，这个地方卡住了的，第一次装的时候不知道怎么过去的，反正没成功，也忘了有什么提示了。建议在安装 Authen::SASL模块的时候，先把这个文件给下载下来，放到/root/.cpan/sources/下<br/><br/>四。安装Perl模块Net::SMTP_auth (optional Perl module for SVN::Notify)<br/># wget http://search.cpan.org/CPAN/auth ... TP_auth-0.08.tar.gz<br/># chmod a+x Net-SMTP_auth-0.08.tar.gz<br/># cd Net-SMTP_auth-0.08<br/># perl Makefile.pl<br/># make test<br/># make install <br/><br/>五。安装Perl模块SVN::Notify (Perl module)<br/># wget http://search.cpan.org/CPAN/auth ... -Notify-2.64.tar.gz<br/># chmod a+x SVN-Notify-2.64.tar.gz<br/># cd SVN-Notify-2.64<br/># perl Build.PL<br/># ./Build<br/># ./Build test<br/># ./Build install <br/><br/>六。自动发邮件脚本<br/>配置post-commit文件 &nbsp; //此文件在commit时会运用到这个脚本<br/># cd /yoursvndata/yourproject/hooks<br/># cp post-commit.tmpl post-commit<br/># vi post-commit<br/>在末尾删除原来的，添加上以下参数<br/>REPOS="$1"<br/>REV="$2"<br/><br/>/usr/bin/svnnotify --repos-path "$1" --revision "$2" --to real@admin.net --from real@admin99.net --handler "HTML::ColorDiff" &nbsp;--with-diff --smtp mail.admin99.net --charset zh_CN:GB2312 &nbsp;-g zh_CN --svnlook /usr/local/subversion/bin/svnlook --subject-prefix '[SVN更新]'<br/>这里要注意svnnotify和svnlook的绝对路径<br/>给文件加上可执行权限<br/><br/>七。可修改log脚本<br/>配置pre-revprop-change文件 &nbsp; <br/># cd /yoursvndata/yourproject/hooks<br/># cp pre-revprop-change.tmpl pre-revprop-change<br/># vi pre-revprop-change<br/>在末尾删除原来的，添加上以下参数<br/>EPOS="$1"<br/>REV="$2"<br/>USER="$3"<br/>PROPNAME="$4"<br/><br/>if [ "$PROPNAME" = "svn:log" ]; then exit 0; fi<br/>exit 1<br/>给文件加上可执行权限<br/><br/>八。强制写log脚本<br/>配置pre-commit文件 &nbsp; //此文件在用户每次更新库中都必须要求写log，此文以log最低5个字符为例<br/># cd /yoursvndata/yourproject/hooks<br/># cp pre-commit.tmpl pre-commit<br/># vi pre-commit<br/>在末尾删除原来的，添加上以下参数<br/>REPOS="$1"<br/>TXN="$2"<br/>SVNLOOK=/usr/bin/svnlook<br/># check that logmessage contains at least 5 alphanumeric characters<br/>LOGMSG=`$SVNLOOK log -t "$TXN" "$REPOS" &#124; grep "[a-zA-Z0-9]" &#124; wc -c`<br/>if [ "$LOGMSG" -lt 5 ];<br/>then<br/> &nbsp;echo -e "&#92;nEmpty log message not allowed. Commit aborted!" 1>&2<br/> &nbsp;exit 1<br/>fi<br/>给文件加上可执行权限<br/>Tags - <a href="http://www.admin99.net/tag.php?tag=svn" rel="tag">svn</a>
  ]]> 
</description>
</item><item>
<link>http://www.admin99.net/read.php?266</link>
<title>SVN 自动邮件通知 的两种方式以及中文解决方案</title> 
<author>real &lt;real@admin99.net&gt;</author>
<category>svn</category>
<pubDate>Wed, 24 Oct 2007 02:49:16 +0000</pubDate> 
<guid>http://www.admin99.net/read.php?266</guid> 
<description>
<![CDATA[ 
	互联网上有很多相关的文章，但是说明的不够明了，我参考这些文章来配置的时候，走了不少弯路。现在将这两种方式整理一下。<br/><br/>第一种方式 通过svnnotify来发送邮件<br/><br/>/usr/bin/svnnotify --repos-path "$1" --revision "$2" --to real@admin.net --from real@admin99.net --handler "HTML::ColorDiff" &nbsp;--with-diff --smtp mail.admin99.net --charset zh_CN:GB2312 &nbsp;-g zh_CN --svnlook /usr/local/subversion/bin/svnlook --subject-prefix '[SVN更新]'<br/><br/>svnnotify有很多参数，可以通过svnnotify --help 或者man svnnotify 查看<br/><br/>好多文章中在介绍这种方式的时候，没有加上svnlook的绝对路径，我实在是很纳闷，可能是他们的subversiong在安装的时候没有加上 --prefix=/yourpath 参数，把subversion安装在了默认路径，我的subversion是安装在/usr/local/subversion之下的，svnnotify在默认的/usr/bin下找不到svnlook，所以，在邮件通知中无法出现log信息，diff信息等等。加上这个参数之后，问题解决。<br/><br/>还有更搞笑的是，很多关于这个的文章把 -l 参数当作svn 记录日志文件的参数，寒~~ -_-!! 可能是把svnnotify和commit-email.pl搞混了，在svnnotify中，这个参数是 --language 。<br/><br/>这种方式还有另外一个问题，中文转码的问题，经过N次尝试之后，log信息中的中文，diff信息中的中文仍然显示的是乱码，最后因为时间紧迫，不得不先放弃这种方式。<br/><br/>第二种方式 通过commit-email.pl 来发送邮件<br/><br/>/usr/local/subversion/bin/commit-email.pl "$1" "$2" --from real@admin99.net -h admin99.net &nbsp;-s "[SVN 更新]" --diff y svnhejia@51hejia.com<br/><br/>默认情况下，在subversion的bin目录下，没有commit-email.pl这个文件，是我从src中copy过来的。<br/><br/>关于commit-email.pl所能用的参数，可以通过直接执行/usr/local/subversion/bin/commit-email.pl 来查看，当然这个时候是执行不了了，提示错误是参数太少，然后给你列出来一些参数。参数不多。<br/><br/>--diff y 是表示在邮件中加入diff信息，这个当然是要的<br/><br/>后面跟的邮件地址，是接收邮件的地址，有人说可以在后面写上N个地址，用空格分开就行，事实上我测试的时候，这种方式根本就收不到邮件了，时间紧迫，不能详细测试。最后不得不在邮件服务器上做了一个组邮件地址。<br/><br/>关于中文问题，通过在commit-email.pl中更改字符集，基本上可以很完美的解决diff信息中的中文问题。<br/><br/>但是对于log信息中的中文，至今尚未找到合适的解决办法。<br/><br/>这个问题的关键应该是在于，svn客户端在提交更新的时候，输入的log信息，使用的是非ascii编码(应该是unicode) ，commit-email.pl(还不缺认问题是不是出在commit-email.pl还是出在svn本身)在处理非ascii编码时，将其转换成了诸如 ?&#92;230?&#92;181?&#92;139?&#92;232?&#92;175?&#92;149?&#92;228?&#92;186?&#92;140 这样的不可读的数字形式。<br/>在互联网上找到一篇文章，是06年写的，提到了一种解决这个的办法，不过我测试下来没有成功，还是贴出来吧，不定谁的就可以成功了<br/><br/>my @difflines; (行487) 的前面加上：<br/><br/>for (my $i=0; $i<@body; ++$i){<br/> &nbsp; &nbsp;my @rsa = split( /&#92;?&#92;&#92;/, $body[$i] );<br/> &nbsp; &nbsp;$body[$i] = "";<br/> &nbsp; &nbsp;foreach my $val (@rsa) {<br/> &nbsp; &nbsp; &nbsp; &nbsp;$val =~ /(^[0-9]{3})(.*)/;<br/> &nbsp; &nbsp; &nbsp; &nbsp;if(defined $1 and $1 gt 0){<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;#print "&#92;n[".$1 . "," . $2."]";<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$body[$i] .= chr($1) . $2;<br/> &nbsp; &nbsp; &nbsp; &nbsp;}<br/> &nbsp; &nbsp; &nbsp; &nbsp;else{<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$body[$i] .= $val;<br/> &nbsp; &nbsp; &nbsp; &nbsp;}<br/> &nbsp; &nbsp;}<br/>}<br/><br/>把之前 push 到 @body 变量的所有内容重新进行处理，发现 ?&#92; 后面跟三个数字就替换为相应的字符。<br/>Tags - <a href="http://www.admin99.net/tag.php?tag=svn" rel="tag">svn</a>
  ]]> 
</description>
</item>
</channel>
</rss>