<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>MEMOBALL.info &#187; svn</title>
	<atom:link href="http://www.memoball.info/tag/svn/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.memoball.info</link>
	<description>All of my Memories</description>
	<lastBuildDate>Thu, 22 Jul 2010 06:17:14 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>การติดตั้ง SVN &amp; Trac ร่วมกับ Apache ใน Ubuntu</title>
		<link>http://www.memoball.info/10/%e0%b8%81%e0%b8%b2%e0%b8%a3%e0%b8%95%e0%b8%b4%e0%b8%94%e0%b8%95%e0%b8%b1%e0%b9%89%e0%b8%87-svn-trac-%e0%b8%a3%e0%b9%88%e0%b8%a7%e0%b8%a1%e0%b8%81%e0%b8%b1%e0%b8%9a-apache-%e0%b9%83%e0%b8%99-ubun/</link>
		<comments>http://www.memoball.info/10/%e0%b8%81%e0%b8%b2%e0%b8%a3%e0%b8%95%e0%b8%b4%e0%b8%94%e0%b8%95%e0%b8%b1%e0%b9%89%e0%b8%87-svn-trac-%e0%b8%a3%e0%b9%88%e0%b8%a7%e0%b8%a1%e0%b8%81%e0%b8%b1%e0%b8%9a-apache-%e0%b9%83%e0%b8%99-ubun/#comments</comments>
		<pubDate>Fri, 02 Oct 2009 09:11:46 +0000</pubDate>
		<dc:creator>spnball</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[trac]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.memoball.info/?p=411</guid>
		<description><![CDATA[ช่วงนี้กำลังปรับปรุงระบบ SVN ใหม่อยู่ โดยจะให้การทำ authen ผ่าน .htaccess เดียวกันทั้ง SVN &#38; Trac
จึงได้นำ SVN และ Trac มาผูกรวมกับ Apache ซึ่งเป็นวิธีการติดตั้งที่ง่ายกว่า และสะดวกกว่าการติดตั้งแบบที่นำเสนอครั้งก่อน โดยอาศัย dav_svn กับ mods_python เข้ามาช่วย


จาก WikiBall


			




เนื้อหา


1 ติดตั้ง Program ใน Ubuntu

1.1 SVN + Apache
1.2 Trac + Apache


2 การสร้าง project

2.1 สร้าง repository
2.2 สร้าง Trac


3 Enable apache modules
4 Apache configure

4.1 configuration file สำหรับ trac
4.2 configuration file สำหรับ subversion
4.3 Enable site


5 [...]]]></description>
			<content:encoded><![CDATA[<p>ช่วงนี้กำลังปรับปรุงระบบ SVN ใหม่อยู่ โดยจะให้การทำ authen ผ่าน .htaccess เดียวกันทั้ง SVN &amp; Trac<br />
จึงได้นำ SVN และ Trac มาผูกรวมกับ Apache ซึ่งเป็นวิธีการติดตั้งที่ง่ายกว่า และสะดวกกว่า<a href="http://www.memoball.info/01/%E0%B8%9B%E0%B8%B1%E0%B8%8D%E0%B8%AB%E0%B8%B2%E0%B8%81%E0%B8%B2%E0%B8%A3%E0%B9%83%E0%B8%8A%E0%B9%89-web-interface-%E0%B8%82%E0%B8%AD%E0%B8%87-trac/">การติดตั้งแบบที่นำเสนอครั้งก่อน</a> โดยอาศัย dav_svn กับ mods_python เข้ามาช่วย<br />
<span id="more-411"></span></p>
<div id="bodyContent">
<h3 id="siteSub"><a href="http://wiki.memoball.info/index.php/SVN%2BTrac%2Bapache2">จาก WikiBall</a></h3>
<div id="contentSub"></div>
<div id="jump-to-nav"></div>
<p>			<!-- start content --></p>
<table id="toc" class="toc" summary="เนื้อหา">
<tr>
<td>
<div id="toctitle">
<h2>เนื้อหา</h2>
</div>
<ul>
<li class="toclevel-1"><a href="./#.E0.B8.95.E0.B8.B4.E0.B8.94.E0.B8.95.E0.B8.B1.E0.B9.89.E0.B8.87_Program_.E0.B9.83.E0.B8.99_Ubuntu" ref="toc"><span class="tocnumber">1</span> <span class="toctext">ติดตั้ง Program ใน Ubuntu</span></a>
<ul>
<li class="toclevel-2"><a href="./#SVN_.2B_Apache" ref="toc"><span class="tocnumber">1.1</span> <span class="toctext">SVN + Apache</span></a></li>
<li class="toclevel-2"><a href="./#Trac_.2B_Apache" ref="toc"><span class="tocnumber">1.2</span> <span class="toctext">Trac + Apache</span></a></li>
</ul>
</li>
<li class="toclevel-1"><a href="./#.E0.B8.81.E0.B8.B2.E0.B8.A3.E0.B8.AA.E0.B8.A3.E0.B9.89.E0.B8.B2.E0.B8.87_project" ref="toc"><span class="tocnumber">2</span> <span class="toctext">การสร้าง project</span></a>
<ul>
<li class="toclevel-2"><a href="./#.E0.B8.AA.E0.B8.A3.E0.B9.89.E0.B8.B2.E0.B8.87_repository" ref="toc"><span class="tocnumber">2.1</span> <span class="toctext">สร้าง repository</span></a></li>
<li class="toclevel-2"><a href="./#.E0.B8.AA.E0.B8.A3.E0.B9.89.E0.B8.B2.E0.B8.87_Trac" ref="toc"><span class="tocnumber">2.2</span> <span class="toctext">สร้าง Trac</span></a></li>
</ul>
</li>
<li class="toclevel-1"><a href="./#Enable_apache_modules" ref="toc"><span class="tocnumber">3</span> <span class="toctext">Enable apache modules</span></a></li>
<li class="toclevel-1"><a href="./#Apache_configure" ref="toc"><span class="tocnumber">4</span> <span class="toctext">Apache configure</span></a>
<ul>
<li class="toclevel-2"><a href="./#configuration_file_.E0.B8.AA.E0.B8.B3.E0.B8.AB.E0.B8.A3.E0.B8.B1.E0.B8.9A_trac" ref="toc"><span class="tocnumber">4.1</span> <span class="toctext">configuration file สำหรับ trac</span></a></li>
<li class="toclevel-2"><a href="./#configuration_file_.E0.B8.AA.E0.B8.B3.E0.B8.AB.E0.B8.A3.E0.B8.B1.E0.B8.9A_subversion" ref="toc"><span class="tocnumber">4.2</span> <span class="toctext">configuration file สำหรับ subversion</span></a></li>
<li class="toclevel-2"><a href="./#Enable_site" ref="toc"><span class="tocnumber">4.3</span> <span class="toctext">Enable site</span></a></li>
</ul>
</li>
<li class="toclevel-1"><a href="./#.E0.B8.A7.E0.B8.B4.E0.B8.98.E0.B8.B5.E0.B8.AA.E0.B8.A3.E0.B9.89.E0.B8.B2.E0.B8.87_.htaccess" ref="toc"><span class="tocnumber">5</span> <span class="toctext">วิธีสร้าง .htaccess</span></a></li>
<li class="toclevel-1"><a href="./#Restart_apache" ref="toc"><span class="tocnumber">6</span> <span class="toctext">Restart apache</span></a></li>
<li class="toclevel-1"><a href="./#.E0.B8.81.E0.B8.B2.E0.B8.A3.E0.B9.83.E0.B8.8A.E0.B9.89.E0.B8.87.E0.B8.B2.E0.B8.99" ref="toc"><span class="tocnumber">7</span> <span class="toctext">การใช้งาน</span></a></li>
</ul>
</td>
</tr>
</table>
<p><script type="text/javascript"> if (window.showTocToggle) { var tocShowText = "แสดง"; var tocHideText = "ซ่อน"; showTocToggle(); } </script><br />
<a name=".E0.B8.95.E0.B8.B4.E0.B8.94.E0.B8.95.E0.B8.B1.E0.B9.89.E0.B8.87_Program_.E0.B9.83.E0.B8.99_Ubuntu" href="http://wiki.memoball.info/"></a><br />
<h2> <span class="mw-headline">ติดตั้ง Program ใน Ubuntu</span></h2>
<p><a name="SVN_.2B_Apache" href="http://wiki.memoball.info/"></a><br />
<h3> <span class="mw-headline"> SVN + Apache </span></h3>
<p>ติดตั้ง apache
</p>
<pre>
$ sudo apt-get install apache2
</pre>
<p>ติดตั้ง svn
</p>
<pre>
$ sudo apt-get install subversion
</pre>
<p>ติดตั้งโมดูล svn ของ apache
</p>
<pre>
$ sudo apt-get install libapache2-svn
</pre>
<p><a name="Trac_.2B_Apache" href="http://wiki.memoball.info/"></a><br />
<h3> <span class="mw-headline"> Trac + Apache </span></h3>
<p>การติดตั้ง Trac จำเป็นต้องมี SVN อยู่ก่อนแล้ว<br />
จึงทำการติดตั้ง Trac ดังนี้<br />
ดาวโหลด trac มาใส่ไว้ในที่ไดที่หนึ่งอาจเป็น /home/user ก็ได้ หรืออาจให้ wget ดึงมาเลย
</p>
<pre>
wget http://ftp.edgewall.com/pub/trac/Trac-0.11.5.tar.gz
</pre>
<p>ระเบิดมัน
</p>
<pre>tar -xzf Trac-0.11.5.tar.gz</pre>
<p>ลง Python setup
</p>
<pre>$ sudo apt-get install python-setuptools</pre>
<p>เข้าไปที่ directory ดังกล่าว  Trac-0.11.5 แล้วทำการ install
</p>
<pre>$ sudo python ./setup.py install</pre>
<p><a name=".E0.B8.81.E0.B8.B2.E0.B8.A3.E0.B8.AA.E0.B8.A3.E0.B9.89.E0.B8.B2.E0.B8.87_project" href="http://wiki.memoball.info/"></a><br />
<h2> <span class="mw-headline"> การสร้าง project </span></h2>
<p><a name=".E0.B8.AA.E0.B8.A3.E0.B9.89.E0.B8.B2.E0.B8.87_repository" href="http://wiki.memoball.info/"></a><br />
<h3> <span class="mw-headline"> สร้าง repository </span></h3>
<p>ตัวอย่างการสร้าง
</p>
<pre>$ svnadmin create /var/svn/repository/example</pre>
<p>นำเข้า (import) project
</p>
<pre>$ svn import /path/to/projectexample file:///var/svn/repository/example/examplev1 -m&quot;initial import&quot; </pre>
<p><a name=".E0.B8.AA.E0.B8.A3.E0.B9.89.E0.B8.B2.E0.B8.87_Trac" href="http://wiki.memoball.info/"></a><br />
<h3> <span class="mw-headline"> สร้าง Trac </span></h3>
<p>การสร้าง project enviroment รันคำสั่ง
</p>
<pre>$ trac-admin /path/to/myproject initenv</pre>
<p>ดู option ต่างๆ ได้ที่ <a href="http://wiki.memoball.info//index.php/%E0%B8%81%E0%B8%B2%E0%B8%A3%E0%B9%83%E0%B8%8A%E0%B9%89%E0%B8%87%E0%B8%B2%E0%B8%99_trac" title="การใช้งาน trac">การใช้งาน trac</a>
</p>
<p><a name="Enable_apache_modules" href="http://wiki.memoball.info/"></a><br />
<h2> <span class="mw-headline"> Enable apache modules </span></h2>
<p>เราต้องทำการ enable apache modules โดยการทำ soft link ใน /etc/apache2/mods-enabled ไปยัง /etc/apache2/mods-available/
</p>
<pre>
$ cd /etc/apache2/mods-enabled
$ sudo ln -s ../mods-available/dav_svn.conf
$ sudo ln -s ../mods-available/dav_svn.load
$ sudo ln -s ../mods-available/mod_python.load
</pre>
<p><a name="Apache_configure" href="http://wiki.memoball.info/"></a><br />
<h2> <span class="mw-headline"> Apache configure </span></h2>
<p>หลังจากลงโปรแกรม แล้ว เราก็จะมากทำการ config เจ้าตัว apache ของเราให้สามารถทำงานได้กัน โดยก่อนอื่นต้องเข้าไปที่ /etc/apache2/sites-available/
</p>
<p><a name="configuration_file_.E0.B8.AA.E0.B8.B3.E0.B8.AB.E0.B8.A3.E0.B8.B1.E0.B8.9A_trac" href="http://wiki.memoball.info/"></a><br />
<h3> <span class="mw-headline"> configuration file สำหรับ trac </span></h3>
<p>สร้าง config file ใหม่
</p>
<pre>
$sudo vim trac
</pre>
<pre>
&lt;Location /uri/path/to/trac/project&gt;
        SetHandler mod_python
        PythonInterpreter main_interpreter
        PythonHandler trac.web.modpython_frontend
        PythonOption TracEnv /path/to/project/environment
        PythonOption TracUriRoot /uri/path/to/trac/project
&lt;/Location&gt;
</pre>
<p>ถ้าต้องการทำ authentication ผ่าน .htaccess ของ apache ให้เพิ่มโค้ดด้านล่าง ลงใน Location
</p>
<pre>
        AuthType Basic
        AuthName &quot;Project name&quot;
        AuthUserFile /path/to/.htaccess
        Require valid-user
</pre>
<p><a name="configuration_file_.E0.B8.AA.E0.B8.B3.E0.B8.AB.E0.B8.A3.E0.B8.B1.E0.B8.9A_subversion" href="http://wiki.memoball.info/"></a><br />
<h3> <span class="mw-headline"> configuration file สำหรับ subversion </span></h3>
<p>สร้าง config file ใหม่
</p>
<pre>
$sudo vim svn
</pre>
<pre>
&lt;Location /uri/path/to/svn/project&gt;
        DAV svn
        SVNPath /var/svn/repository/rddi/mailgoth/
&lt;/Location
</pre>
<p>ถ้าต้องการทำ authentication ผ่าน .htaccess ของ apache ให้เพิ่มโค้ดด้านล่าง ลงใน Location
</p>
<pre>
        AuthType Basic
        AuthName Foo
        AuthUserFile /var/svn/repository/rddi/mailgoth/.htaccess

        require valid-user
        Order deny,allow
</pre>
<p><a name="Enable_site" href="http://wiki.memoball.info/"></a><br />
<h3> <span class="mw-headline"> Enable site </span></h3>
<p>ทำการ Enable site
</p>
<pre>
$ cd /etc/apache2/sites-enabled/
$ sudo ln -s ../sites-available/svn 002-svn
$ sudo ln -s ../sites-available/trac 002-trac
</pre>
<p><a name=".E0.B8.A7.E0.B8.B4.E0.B8.98.E0.B8.B5.E0.B8.AA.E0.B8.A3.E0.B9.89.E0.B8.B2.E0.B8.87_.htaccess" href="http://wiki.memoball.info/"></a><br />
<h2> <span class="mw-headline"> วิธีสร้าง .htaccess </span></h2>
<pre>htpasswd -c .htaccess username</pre>
<p><a name="Restart_apache" href="http://wiki.memoball.info/"></a><br />
<h2> <span class="mw-headline"> Restart apache </span></h2>
<p>สั่ง restart apache
</p>
<pre> $ sudo apache2ctl restart</pre>
<p>ถ้าเข้าแล้วยังมี error อยู่ ให้ไปดูที่ /var/log/apache/error.log ว่ามี Error อะไรเกิดขึ้น
</p>
<p><a name=".E0.B8.81.E0.B8.B2.E0.B8.A3.E0.B9.83.E0.B8.8A.E0.B9.89.E0.B8.87.E0.B8.B2.E0.B8.99" href="http://wiki.memoball.info/"></a><br />
<h2> <span class="mw-headline"> การใช้งาน </span></h2>
<ul>
<li>เข้าใช้งาน Trac&nbsp;: http:/site.name/uri/path/to/trac/project
</li>
<li>เข้าใช้งาน SVN&nbsp;: http:/site.name/uri/path/to/svn/project
</li>
</ul>
<p><!--<br />
NewPP limit report<br />
Preprocessor node count: 75/1000000<br />
Post-expand include size: 0/2097152 bytes<br />
Template argument size: 0/2097152 bytes<br />
Expensive parser function count: 0/100<br />
--></p>
<p><!-- Saved in parser cache with key memoball_wiki:pcache:idhash:73-0!1!0!!th!2!edit=0 and timestamp 20091002091041 --></p>
<div class="printfooter">
<h5>รับข้อมูลจาก (Reference) : </h5>
<p>จาก WikiBall : <a href="http://wiki.memoball.info/index.php/SVN%2BTrac%2Bapache2">http://wiki.memoball.info/index.php/SVN+Trac+apache2</a></div>
<div id='catlinks' class='catlinks'>
<div id="mw-normal-catlinks"><a href="http://wiki.memoball.info//index.php/%E0%B8%9E%E0%B8%B4%E0%B9%80%E0%B8%A8%E0%B8%A9:Categories" title="พิเศษ:Categories">หมวดหมู่</a>:&#32;<span dir='ltr'><a href="http://wiki.memoball.info//index.php?title=%E0%B8%AB%E0%B8%A1%E0%B8%A7%E0%B8%94%E0%B8%AB%E0%B8%A1%E0%B8%B9%E0%B9%88:SVN&amp;action=edit&amp;redlink=1" class="new" title="หมวดหมู่:SVN (ยังไม่ได้สร้าง)">SVN</a></span> | <span dir='ltr'><a href="http://wiki.memoball.info//index.php?title=%E0%B8%AB%E0%B8%A1%E0%B8%A7%E0%B8%94%E0%B8%AB%E0%B8%A1%E0%B8%B9%E0%B9%88:Apache&amp;action=edit&amp;redlink=1" class="new" title="หมวดหมู่:Apache (ยังไม่ได้สร้าง)">Apache</a></span> | <span dir='ltr'><a href="http://wiki.memoball.info//index.php?title=%E0%B8%AB%E0%B8%A1%E0%B8%A7%E0%B8%94%E0%B8%AB%E0%B8%A1%E0%B8%B9%E0%B9%88:Trac&amp;action=edit&amp;redlink=1" class="new" title="หมวดหมู่:Trac (ยังไม่ได้สร้าง)">Trac</a></span> | <span dir='ltr'><a href="http://wiki.memoball.info//index.php?title=%E0%B8%AB%E0%B8%A1%E0%B8%A7%E0%B8%94%E0%B8%AB%E0%B8%A1%E0%B8%B9%E0%B9%88:Ubuntu&amp;action=edit&amp;redlink=1" class="new" title="หมวดหมู่:Ubuntu (ยังไม่ได้สร้าง)">Ubuntu</a></span></div>
</div>
<p>			<!-- end content --></p>
<div class="visualClear"></div>
</p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.memoball.info/10/%e0%b8%81%e0%b8%b2%e0%b8%a3%e0%b8%95%e0%b8%b4%e0%b8%94%e0%b8%95%e0%b8%b1%e0%b9%89%e0%b8%87-svn-trac-%e0%b8%a3%e0%b9%88%e0%b8%a7%e0%b8%a1%e0%b8%81%e0%b8%b1%e0%b8%9a-apache-%e0%b9%83%e0%b8%99-ubun/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>SVN Keywords และการใช้คำสั่ง set properties (setprops)</title>
		<link>http://www.memoball.info/02/svn-keywords/</link>
		<comments>http://www.memoball.info/02/svn-keywords/#comments</comments>
		<pubDate>Mon, 23 Feb 2009 10:09:21 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Trac & SVN]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://memoball.nabzer.com/?p=180</guid>
		<description><![CDATA[วันนี้นั่งเขียน auto-props ของ svn อยู่  ก็เลยเอา keywords ของ svn มาใส่เก็บไว้ใน wiki จะได้ง่ายต่อการค้นหา 
มาอัพเดตในส่วนของ keywords (Tue Aug 18,2009) ใหม่ โดยจะเพิ่มส่วนของการใช้งานคำสั่ง เพราะเพิ่งค้นพบว่าตัวเองชอบการใช้ command line มากกว่าการใช้ UI ซึ่งอาจเป็นเพราะใช้ Ubuntu Destop/Server เสียจนชิน อีกทั้งการใช้คำสั่งบางอย่าง สามารถทำงานได้สะดวกกว่าการใช้ UI ดังนั้นในที่นี้ จึงจะกล่างถึงแต่เฉพาะการใช้งาน Set proporties ใน svn เท่านั้น


จาก WikiBall


			




เนื้อหา


1 Command

1.1 propset
1.2 propedit
1.3 proplist


2 Keywords

2.1 Date
2.2 Revision
2.3 Author
2.4 HeadURL
2.5 Id


3 ขอบคุณข้อมูลดีๆ จาก ref




 if (window.showTocToggle) [...]]]></description>
			<content:encoded><![CDATA[<p>วันนี้นั่งเขียน auto-props ของ svn อยู่  ก็เลยเอา keywords ของ svn มาใส่เก็บไว้ใน wiki จะได้ง่ายต่อการค้นหา </p>
<p>มาอัพเดตในส่วนของ keywords (Tue Aug 18,2009) ใหม่ โดยจะเพิ่มส่วนของการใช้งานคำสั่ง เพราะเพิ่งค้นพบว่าตัวเองชอบการใช้ command line มากกว่าการใช้ UI ซึ่งอาจเป็นเพราะใช้ Ubuntu Destop/Server เสียจนชิน อีกทั้งการใช้คำสั่งบางอย่าง สามารถทำงานได้สะดวกกว่าการใช้ UI ดังนั้นในที่นี้ จึงจะกล่างถึงแต่เฉพาะการใช้งาน Set proporties ใน svn เท่านั้น<br />
<span id="more-180"></span></p>
<div id="bodyContent">
<h3 id="siteSub"><a href="http://wiki.memoball.info/index.php/Svn_keyword_and_setprops">จาก WikiBall</a></h3>
<div id="contentSub"></div>
<div id="jump-to-nav"></div>
<p>			<!-- start content --></p>
<table id="toc" class="toc" summary="เนื้อหา">
<tr>
<td>
<div id="toctitle">
<h2>เนื้อหา</h2>
</div>
<ul>
<li class="toclevel-1"><a href="./#Command" ref="toc"><span class="tocnumber">1</span> <span class="toctext">Command</span></a>
<ul>
<li class="toclevel-2"><a href="./#propset" ref="toc"><span class="tocnumber">1.1</span> <span class="toctext">propset</span></a></li>
<li class="toclevel-2"><a href="./#propedit" ref="toc"><span class="tocnumber">1.2</span> <span class="toctext">propedit</span></a></li>
<li class="toclevel-2"><a href="./#proplist" ref="toc"><span class="tocnumber">1.3</span> <span class="toctext">proplist</span></a></li>
</ul>
</li>
<li class="toclevel-1"><a href="./#Keywords" ref="toc"><span class="tocnumber">2</span> <span class="toctext">Keywords</span></a>
<ul>
<li class="toclevel-2"><a href="./#Date" ref="toc"><span class="tocnumber">2.1</span> <span class="toctext">Date</span></a></li>
<li class="toclevel-2"><a href="./#Revision" ref="toc"><span class="tocnumber">2.2</span> <span class="toctext">Revision</span></a></li>
<li class="toclevel-2"><a href="./#Author" ref="toc"><span class="tocnumber">2.3</span> <span class="toctext">Author</span></a></li>
<li class="toclevel-2"><a href="./#HeadURL" ref="toc"><span class="tocnumber">2.4</span> <span class="toctext">HeadURL</span></a></li>
<li class="toclevel-2"><a href="./#Id" ref="toc"><span class="tocnumber">2.5</span> <span class="toctext">Id</span></a></li>
</ul>
</li>
<li class="toclevel-1"><a href="./#.E0.B8.82.E0.B8.AD.E0.B8.9A.E0.B8.84.E0.B8.B8.E0.B8.93.E0.B8.82.E0.B9.89.E0.B8.AD.E0.B8.A1.E0.B8.B9.E0.B8.A5.E0.B8.94.E0.B8.B5.E0.B9.86_.E0.B8.88.E0.B8.B2.E0.B8.81_ref" ref="toc"><span class="tocnumber">3</span> <span class="toctext">ขอบคุณข้อมูลดีๆ จาก ref</span></a></li>
</ul>
</td>
</tr>
</table>
<p><script type="text/javascript"> if (window.showTocToggle) { var tocShowText = "แสดง"; var tocHideText = "ซ่อน"; showTocToggle(); } </script><br />
<a name="Command" href="http://wiki.memoball.info/"></a><br />
<h2> <span class="mw-headline"> Command </span></h2>
<p><a name="propset" href="http://wiki.memoball.info/"></a><br />
<h3> <span class="mw-headline"> propset </span></h3>
<p>ใช้คำสั่ง propset เพื่อทำการสร้างค่า properties ใหม่ให้กับ file ตังตัวอย่างการ set ในส่วนของ copyright โดยชื่อ file สามารถใช้ regular expression ได้ด้วย ซึ่งการใช้ regular expression ใน svn แบบ UI เป็นเรื่องที่ทำยากมาก
</p>
<pre>
$ svn propset copyright '(c) 2003 Red-Bean Software' calc/button.c
property 'copyright' set on 'calc/button.c'
</pre>
<p>ด้วอย่างด้านล่าง จะเป็นการเปลี่ยนหมดทุกไฟล์ ใน directory
</p>
<pre>
$ svn propset svn:keywords 'Author Date Id Revision HeadURL' *
</pre>
<p><a name="propedit" href="http://wiki.memoball.info/"></a><br />
<h3> <span class="mw-headline"> propedit </span></h3>
<p><a name="proplist" href="http://wiki.memoball.info/"></a><br />
<h3> <span class="mw-headline"> proplist </span></h3>
<p>proplist ใช้สำหรับแสดง properties ใน file ในตัวอย่างต้านล่างเป็นการดู properties ทีละหลายๆ ไฟล์ โดยสามารถเลือกดูทีละ file โดยเปลี่ยนจาก * เป็นชื่อ<br />
เราใช้ &#8211;verbose สำหรับแสดง value ใน properties ต่างๆ ซึ่งถ้าเราไม่ใส่ เอาพุตที่ออกมานั้นจะเป็นเฉพาะชื่อ properties ที่ทำการตั้งไว้เท่านั้น
</p>
<pre>
$ svn proplist --verbose *
Properties on 'gcp_addressbook.ext.php':
  svn:keywords&nbsp;: Author Date Id Revision HeadURL
Properties on 'gcp_all.ext.php':
  svn:keywords&nbsp;: Author Date Id Revision HeadURL
Properties on 'gcp_compose.ext.php':
  svn:keywords&nbsp;: Author Date Id Revision HeadURL
Properties on 'gcp_list.ext.php':
  svn:keywords&nbsp;: Author Date Id Revision HeadURL
Properties on 'gcp_login.ext.php':
  svn:keywords&nbsp;: Author Date Id Revision HeadURL
Properties on 'gcp_mail.ext.php':
  svn:keywords&nbsp;: Author Date Id Revision HeadURL
Properties on 'gcp_settings.ext.php':
  svn:keywords&nbsp;: Author Date Id Revision HeadURL
</pre>
<p><a name="Keywords" href="http://wiki.memoball.info/"></a><br />
<h2> <span class="mw-headline"> Keywords </span></h2>
<p>การใส่ keyword ใน file นั้น สามารถทำได้โดยการใส่ข้อความตามรูปแบบ ชื่อ keyword ที่ต้องการระหว่าง $ ดังต่อไปนี้
</p>
<pre>
$Revision$
$Id$
</pre>
<p>ไม่ต้องใส่ค่าสงไป เพราะค่าที่ได้จะถูกใส่โดยอัตโนมัติ
</p>
<p><a name="Date" href="http://wiki.memoball.info/"></a><br />
<h3> <span class="mw-headline">Date</span></h3>
<p>สำหรับใส่วันที่ที่การเปลี่ยนแปลงไฟล์ ใน revision นั้นๆ หรือใช้ LastChangedDate. แทนก็ได้ ซึ่งจะให้ผลดังตัวอย่าง
</p>
<pre>$Date: 2002-07-22 21:42:37 -0700 (Mon, 22 Jul 2002) $ </pre>
<p><a name="Revision" href="http://wiki.memoball.info/"></a><br />
<h3> <span class="mw-headline">Revision</span></h3>
<p>สำหรับใส่เลข revision หรือใช้  LastChangedRevision หรือ Rev แทนก็ได้
</p>
<pre>$Revision: 144 $</pre>
<p><a name="Author" href="http://wiki.memoball.info/"></a><br />
<h3> <span class="mw-headline">Author</span></h3>
<p>สำหรับใส่ชื่อผู้เขียนข้อมูลนี้ขึ้น หรือใช้ LastChangedBy แทนก็ได้
</p>
<pre>$Author: harry $</pre>
<p><a name="HeadURL" href="http://wiki.memoball.info/"></a><br />
<h3> <span class="mw-headline">HeadURL</span></h3>
<p>สำหรับใส่ URL หรือที่อยู่ไฟล์ (ในตำแหน่งสุดท้าย ไม่ขึ้นอยู่กับว่าจะย้ายหรือคัดลอกมาจากไหน) หรือใช้ URL แทนก็ได้
</p>
<pre>$HeadURL: http://svn.collab.net/repos/trunk/README $</pre>
<p><a name="Id" href="http://wiki.memoball.info/"></a><br />
<h3> <span class="mw-headline">Id</span></h3>
<p>ใส่ทุกอย่างที่จำเป็นต้องมี ดูได้ดังตัวอย่าง คือ ชื่อไฟล์ Revision วันที่และเวลาที่ทำการเปลี่ยนแปลง และผู้เขียน ตามลำดับ
</p>
<pre>$Id: calc.c 148 2002-07-28 21:30:43Z sally $</pre>
<p>
</p>
<p><a name=".E0.B8.82.E0.B8.AD.E0.B8.9A.E0.B8.84.E0.B8.B8.E0.B8.93.E0.B8.82.E0.B9.89.E0.B8.AD.E0.B8.A1.E0.B8.B9.E0.B8.A5.E0.B8.94.E0.B8.B5.E0.B9.86_.E0.B8.88.E0.B8.B2.E0.B8.81_ref" href="http://wiki.memoball.info/"></a><br />
<h2> <span class="mw-headline"> ขอบคุณข้อมูลดีๆ จาก ref </span></h2>
<ul>
<li> <a href="http://svnbook.red-bean.com/en/1.1/ch07s02.html#svn-ch-7-sect-2.3.4" class="external free" title="http://svnbook.red-bean.com/en/1.1/ch07s02.html#svn-ch-7-sect-2.3.4" rel="nofollow">http://svnbook.red-bean.com/en/1.1/ch07s02.html#svn-ch-7-sect-2.3.4</a>
</li>
</ul>
<p><!--<br />
NewPP limit report<br />
Preprocessor node count: 39/1000000<br />
Post-expand include size: 0/2097152 bytes<br />
Template argument size: 0/2097152 bytes<br />
Expensive parser function count: 0/100<br />
--></p>
<p><!-- Saved in parser cache with key memoball_wiki:pcache:idhash:21-0!1!0!!th!2!edit=0 and timestamp 20090825115816 --></p>
<div class="printfooter">
<h5>รับข้อมูลจาก (Reference) : </h5>
<p>จาก WikiBall : <a href="http://wiki.memoball.info/index.php/Svn_keyword_and_setprops">http://wiki.memoball.info/index.php/Svn_keyword_and_setprops</a></div>
<div id='catlinks' class='catlinks'>
<div id="mw-normal-catlinks"><a href="http://wiki.memoball.info//index.php/%E0%B8%9E%E0%B8%B4%E0%B9%80%E0%B8%A8%E0%B8%A9:Categories" title="พิเศษ:Categories">หมวดหมู่</a>:&#32;<span dir='ltr'><a href="http://wiki.memoball.info//index.php?title=%E0%B8%AB%E0%B8%A1%E0%B8%A7%E0%B8%94%E0%B8%AB%E0%B8%A1%E0%B8%B9%E0%B9%88:SVN&amp;action=edit&amp;redlink=1" class="new" title="หมวดหมู่:SVN (ยังไม่ได้สร้าง)">SVN</a></span></div>
</div>
<p>			<!-- end content --></p>
<div class="visualClear"></div>
</p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.memoball.info/02/svn-keywords/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>การติดตั้ง svn</title>
		<link>http://www.memoball.info/01/%e0%b8%81%e0%b8%b2%e0%b8%a3%e0%b8%95%e0%b8%b4%e0%b8%94%e0%b8%95%e0%b8%b1%e0%b9%89%e0%b8%87-svn/</link>
		<comments>http://www.memoball.info/01/%e0%b8%81%e0%b8%b2%e0%b8%a3%e0%b8%95%e0%b8%b4%e0%b8%94%e0%b8%95%e0%b8%b1%e0%b9%89%e0%b8%87-svn/#comments</comments>
		<pubDate>Fri, 30 Jan 2009 12:28:05 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Trac & SVN]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[trac]]></category>

		<guid isPermaLink="false">http://memoball.nabzer.com/?p=169</guid>
		<description><![CDATA[หลังจากหัวหมุนกับการใช้งานและการติดตั้ง svn&#038;trac อยู่ซะตั้งนาน แต่ตอนนี้ก็ใช้งานได้แล้วครับ ก้เลยเอาไปเขียนใส่ไว้ใน wiki ของตัวเองซะ ที่นี่ครับ 

จาก WikiBall


			
Subversion เป็นโปรแกรมที่ใชัสร้าง และจัดการ version ของ source code ของเรา





เนื้อหา


1 การติดตั้ง

1.1 การใช้งานร่วมกับ apache2


2 การใช้งาน

2.1 สร้าง repository
2.2 นำเข้า (import) project
2.3 การเข้าผ่าน apache
2.4 คู่มือการใช้งาน
2.5 การ config svnserve
2.6 SVN Client


3 svn service file
4 Troubleshooting
5 อื่นๆ ที่เกี่ยวข้อง




 if (window.showTocToggle) { var tocShowText = "แสดง"; var tocHideText = "ซ่อน"; showTocToggle(); } 

  [...]]]></description>
			<content:encoded><![CDATA[<p>หลังจากหัวหมุนกับการใช้งานและการติดตั้ง svn&#038;trac อยู่ซะตั้งนาน แต่ตอนนี้ก็ใช้งานได้แล้วครับ ก้เลยเอาไปเขียนใส่ไว้ใน wiki ของตัวเองซะ ที่นี่ครับ <span id="more-169"></span></p>
<div id="bodyContent">
<h3 id="siteSub"><a href="http://wiki.memoball.info/index.php/Subversion">จาก WikiBall</a></h3>
<div id="contentSub"></div>
<div id="jump-to-nav"></div>
<p>			<!-- start content --></p>
<p>Subversion เป็นโปรแกรมที่ใชัสร้าง และจัดการ version ของ source code ของเรา
</p>
<table id="toc" class="toc" summary="เนื้อหา">
<tr>
<td>
<div id="toctitle">
<h2>เนื้อหา</h2>
</div>
<ul>
<li class="toclevel-1"><a href="./#.E0.B8.81.E0.B8.B2.E0.B8.A3.E0.B8.95.E0.B8.B4.E0.B8.94.E0.B8.95.E0.B8.B1.E0.B9.89.E0.B8.87" ref="toc"><span class="tocnumber">1</span> <span class="toctext">การติดตั้ง</span></a>
<ul>
<li class="toclevel-2"><a href="./#.E0.B8.81.E0.B8.B2.E0.B8.A3.E0.B9.83.E0.B8.8A.E0.B9.89.E0.B8.87.E0.B8.B2.E0.B8.99.E0.B8.A3.E0.B9.88.E0.B8.A7.E0.B8.A1.E0.B8.81.E0.B8.B1.E0.B8.9A_apache2" ref="toc"><span class="tocnumber">1.1</span> <span class="toctext">การใช้งานร่วมกับ apache2</span></a></li>
</ul>
</li>
<li class="toclevel-1"><a href="./#.E0.B8.81.E0.B8.B2.E0.B8.A3.E0.B9.83.E0.B8.8A.E0.B9.89.E0.B8.87.E0.B8.B2.E0.B8.99" ref="toc"><span class="tocnumber">2</span> <span class="toctext">การใช้งาน</span></a>
<ul>
<li class="toclevel-2"><a href="./#.E0.B8.AA.E0.B8.A3.E0.B9.89.E0.B8.B2.E0.B8.87_repository" ref="toc"><span class="tocnumber">2.1</span> <span class="toctext">สร้าง repository</span></a></li>
<li class="toclevel-2"><a href="./#.E0.B8.99.E0.B8.B3.E0.B9.80.E0.B8.82.E0.B9.89.E0.B8.B2_.28import.29_project" ref="toc"><span class="tocnumber">2.2</span> <span class="toctext">นำเข้า (import) project</span></a></li>
<li class="toclevel-2"><a href="./#.E0.B8.81.E0.B8.B2.E0.B8.A3.E0.B9.80.E0.B8.82.E0.B9.89.E0.B8.B2.E0.B8.9C.E0.B9.88.E0.B8.B2.E0.B8.99_apache" ref="toc"><span class="tocnumber">2.3</span> <span class="toctext">การเข้าผ่าน apache</span></a></li>
<li class="toclevel-2"><a href="./#.E0.B8.84.E0.B8.B9.E0.B9.88.E0.B8.A1.E0.B8.B7.E0.B8.AD.E0.B8.81.E0.B8.B2.E0.B8.A3.E0.B9.83.E0.B8.8A.E0.B9.89.E0.B8.87.E0.B8.B2.E0.B8.99" ref="toc"><span class="tocnumber">2.4</span> <span class="toctext">คู่มือการใช้งาน</span></a></li>
<li class="toclevel-2"><a href="./#.E0.B8.81.E0.B8.B2.E0.B8.A3_config_svnserve" ref="toc"><span class="tocnumber">2.5</span> <span class="toctext">การ config svnserve</span></a></li>
<li class="toclevel-2"><a href="./#SVN_Client" ref="toc"><span class="tocnumber">2.6</span> <span class="toctext">SVN Client</span></a></li>
</ul>
</li>
<li class="toclevel-1"><a href="./#svn_service_file" ref="toc"><span class="tocnumber">3</span> <span class="toctext">svn service file</span></a></li>
<li class="toclevel-1"><a href="./#Troubleshooting" ref="toc"><span class="tocnumber">4</span> <span class="toctext">Troubleshooting</span></a></li>
<li class="toclevel-1"><a href="./#.E0.B8.AD.E0.B8.B7.E0.B9.88.E0.B8.99.E0.B9.86_.E0.B8.97.E0.B8.B5.E0.B9.88.E0.B9.80.E0.B8.81.E0.B8.B5.E0.B9.88.E0.B8.A2.E0.B8.A7.E0.B8.82.E0.B9.89.E0.B8.AD.E0.B8.87" ref="toc"><span class="tocnumber">5</span> <span class="toctext">อื่นๆ ที่เกี่ยวข้อง</span></a></li>
</ul>
</td>
</tr>
</table>
<p><script type="text/javascript"> if (window.showTocToggle) { var tocShowText = "แสดง"; var tocHideText = "ซ่อน"; showTocToggle(); } </script><br />
<a name=".E0.B8.81.E0.B8.B2.E0.B8.A3.E0.B8.95.E0.B8.B4.E0.B8.94.E0.B8.95.E0.B8.B1.E0.B9.89.E0.B8.87" href="http://wiki.memoball.info/"></a><br />
<h2> <span class="mw-headline"> การติดตั้ง </span></h2>
<p>สำหรับ Ubuntu
</p>
<pre>$ sudo apt-get install apt-get install subversion</pre>
<p><a name=".E0.B8.81.E0.B8.B2.E0.B8.A3.E0.B9.83.E0.B8.8A.E0.B9.89.E0.B8.87.E0.B8.B2.E0.B8.99.E0.B8.A3.E0.B9.88.E0.B8.A7.E0.B8.A1.E0.B8.81.E0.B8.B1.E0.B8.9A_apache2" href="http://wiki.memoball.info/"></a><br />
<h3> <span class="mw-headline"> การใช้งานร่วมกับ apache2 </span></h3>
<p>ติดตั้ง apache module
</p>
<pre>$ sudo apt-get install libapache2-svn</pre>
<p>สร้าง diretory ดังตัวอย่าง หรืออย่างอื่นก็ได้
</p>
<pre>
mkdir /var/svn
mkdir /var/svn/repository
</pre>
<p>แก้ไขค่า permission
</p>
<pre>
chown www-data:www-data -R /var/svn/repository
chmod 770 -R /var/svn/repository
</pre>
<p>แก้ไข apache svn module configuration file&nbsp;: <b>/etc/apache2/mods-available/dav_svn.conf</b>
</p>
<pre>
...
SVNParentPath /var/svn/repository
#SVNPath /var/svn/repository
.....
AuthType Basic
AuthName &quot;Subversion Repository&quot;
AuthUserFile /etc/apache2/dav_svn.passwd
Require valid-user
...
</pre>
<p>สร้าง htaccess
</p>
<pre>
htpasswd2 -c /etc/apache2/dav_svn.passwd tester
</pre>
<p>ref&nbsp;: <a href="http://www.debuntu.org/2006/05/20/54-how-to-subversion-svn-with-apache2-and-dav" class="external free" title="http://www.debuntu.org/2006/05/20/54-how-to-subversion-svn-with-apache2-and-dav" rel="nofollow">http://www.debuntu.org/2006/05/20/54-how-to-subversion-svn-with-apache2-and-dav</a>
</p>
<p><a name=".E0.B8.81.E0.B8.B2.E0.B8.A3.E0.B9.83.E0.B8.8A.E0.B9.89.E0.B8.87.E0.B8.B2.E0.B8.99" href="http://wiki.memoball.info/"></a><br />
<h2> <span class="mw-headline"> การใช้งาน </span></h2>
<p><a name=".E0.B8.AA.E0.B8.A3.E0.B9.89.E0.B8.B2.E0.B8.87_repository" href="http://wiki.memoball.info/"></a><br />
<h3> <span class="mw-headline"> สร้าง repository </span></h3>
<p>ตัวอย่างการสร้าง
</p>
<pre>$ svnadmin create /var/svn/repository/example</pre>
<p><a name=".E0.B8.99.E0.B8.B3.E0.B9.80.E0.B8.82.E0.B9.89.E0.B8.B2_.28import.29_project" href="http://wiki.memoball.info/"></a><br />
<h3> <span class="mw-headline"> นำเข้า (import) project </span></h3>
<pre>$ svn import /path/to/projectexample file:///var/svn/repository/example/examplev1 -m&quot;initial import&quot; </pre>
<p><a name=".E0.B8.81.E0.B8.B2.E0.B8.A3.E0.B9.80.E0.B8.82.E0.B9.89.E0.B8.B2.E0.B8.9C.E0.B9.88.E0.B8.B2.E0.B8.99_apache" href="http://wiki.memoball.info/"></a><br />
<h3> <span class="mw-headline"> การเข้าผ่าน apache </span></h3>
<pre>http://servername/svn/project</pre>
<p><a name=".E0.B8.84.E0.B8.B9.E0.B9.88.E0.B8.A1.E0.B8.B7.E0.B8.AD.E0.B8.81.E0.B8.B2.E0.B8.A3.E0.B9.83.E0.B8.8A.E0.B9.89.E0.B8.87.E0.B8.B2.E0.B8.99" href="http://wiki.memoball.info/"></a><br />
<h3> <span class="mw-headline"> คู่มือการใช้งาน </span></h3>
<ol>
<li><a href="http://svnbook.red-bean.com/" class="external text" title="http://svnbook.red-bean.com/" rel="nofollow">SVN Command line 1</a>
</li>
<li><a href="http://www.yolinux.com/TUTORIALS/Subversion.html#COMMAND" class="external text" title="http://www.yolinux.com/TUTORIALS/Subversion.html#COMMAND" rel="nofollow">SVN Command line 2</a>
</li>
<li><a href="http://home.thep.lu.se/~jari/documents/subversion_guidelines/subversion_guidelines.pdf" class="external text" title="http://home.thep.lu.se/~jari/documents/subversion_guidelines/subversion_guidelines.pdf" rel="nofollow">คู่มือการใช้งาน Subversion</a>
</li>
<li><a href="http://www.rapidsvn.org/index.php/Documentation#Linux.2FUnix" class="external text" title="http://www.rapidsvn.org/index.php/Documentation#Linux.2FUnix" rel="nofollow">คู่มือการใช้งาน RapidSVN</a>
</li>
</ol>
<p><a name=".E0.B8.81.E0.B8.B2.E0.B8.A3_config_svnserve" href="http://wiki.memoball.info/"></a><br />
<h3> <span class="mw-headline"> การ config svnserve </span></h3>
<p>svnserve คือ daemon สำหรับ svn โดยที่เราสามารถ login ผ่านทาง <a href="http://wiki.memoball.info//index.php/Subversion#SVN_Client" title="Subversion">SVN client</a> ต่างๆ โดยผ่านโปรโตคอล svn
</p>
<pre>
svn://hostname:port/repos
</pre>
<p>ทดสอบรับ daemon แบบ forground โดยใช้คำสั่ง
</p>
<pre>
$ sudo svnserve -d --listen-port=port --foreground -r  root/path
</pre>
<p>เรียกเป็น http ใน browser ถ้าขึ้นในลักษณะนี้แสดงว่ารันได้แล้ว
</p>
<pre>
( success ( 1 2 ( ANONYMOUS ) ( edit-pipeline svndiff1 absent-entries ) ) )
</pre>
<p>ตัว svnserve นี้จะไม่มี file ใน init.d มาให้เราจะต้องสร้างเองดังนี้<br />
<a href="http://wiki.memoball.info//images/8/88/Svnserve.tar.gz" class="internal" title="Svnserve.tar.gz">สื่อ:svnserve.tar.gz</a>
</p>
<p>อย่าลืมตั้งค่า authentication ใน <i>/path/to/repository/conf</i>
</p>
<p><a name="SVN_Client" href="http://wiki.memoball.info/"></a><br />
<h3> <span class="mw-headline"> SVN Client </span></h3>
<p>สำหรับที่ผู้ที่ไม่อยากใช้ SVN แบบ command line ใช้แบบ command line ไม่เป็น(เช่นเดียวกับผม) จะมี GUI กระต่ายกับเต่า ให้เลือกใช้ได้ดังนี้
</p>
<ol>
<li><a href="http://tortoisesvn.tigris.org/" class="external text" title="http://tortoisesvn.tigris.org/" rel="nofollow">TortoiseSVN-(Windows)</a>
</li>
<li><a href="http://rapidsvn.tigris.org/" class="external text" title="http://rapidsvn.tigris.org/" rel="nofollow">RapidSVN-(Ubuntu+Mac+Windows)</a>
</li>
</ol>
<p>ref&nbsp;: <a href="http://agaricdesign.com/note/subversion-client-ubuntu-anything-tortoisesvn" class="external free" title="http://agaricdesign.com/note/subversion-client-ubuntu-anything-tortoisesvn" rel="nofollow">http://agaricdesign.com/note/subversion-client-ubuntu-anything-tortoisesvn</a>
</p>
<p><a name="svn_service_file" href="http://wiki.memoball.info/"></a><br />
<h2> <span class="mw-headline"> svn service file </span></h2>
<pre>
#!/bin/sh -e
#
# svnserve - brings up the svn server so anonymous users
# can access svn
#

# Get LSB functions
. /lib/lsb/init-functions
. /etc/default/rcS

SVNSERVE=/usr/bin/svnserve
SVN_USER=svn
SVN_GROUP=svn
SVN_REPO_PATH=/var/svn/repository/
SVN_PORT=8000

# Check that the package is still installed
[ -x $SVNSERVE ] || exit 0;

case &quot;$1&quot; in
	start)
		log_begin_msg &quot;Starting svnserve...&quot;
		umask 002
		if start-stop-daemon --start \
		--chuid $SVN_USER:$SVN_GROUP \
		--exec $SVNSERVE \
		-- -d --listen-port=$SVN_PORT -r $SVN_REPO_PATH; then
			log_end_msg 0
		else
			log_end_msg $?
		fi
	;;

	stop)
		log_begin_msg &quot;Stopping svnserve...&quot;
		if start-stop-daemon --stop --exec $SVNSERVE; then
		log_end_msg 0
		else
		log_end_msg $?
		fi
	;;

	restart|force-reload)
		&quot;$0&quot; stop &amp;&amp; &quot;$0&quot; start
	;;

	*)
	echo &quot;Usage: /etc/init.d/svnserve {start|stop|restart|force-reload}&quot;
		exit 1
	;;
esac

exit 0
</pre>
<p><a name="Troubleshooting" href="http://wiki.memoball.info/"></a><br />
<h2> <span class="mw-headline"> Troubleshooting </span></h2>
<ul>
<li>import ไม่ได้
</li>
</ul>
<pre>
svn: Unable to open an ra_local session to URL
svn: Unable to open repository 'file:///Development/subversion/foo'
</pre>
<p>เหตุการณ์ดังกล่าวเกิดขึ้นได้ 2 กรณี คือ
</p>
<pre> #path ดังกล่าวไม่สามารถเข้าไปได้ เช่น ติด permission
 #ใส่ path กับ URL สรับกัน
</pre>
<p><a name=".E0.B8.AD.E0.B8.B7.E0.B9.88.E0.B8.99.E0.B9.86_.E0.B8.97.E0.B8.B5.E0.B9.88.E0.B9.80.E0.B8.81.E0.B8.B5.E0.B9.88.E0.B8.A2.E0.B8.A7.E0.B8.82.E0.B9.89.E0.B8.AD.E0.B8.87" href="http://wiki.memoball.info/"></a><br />
<h2> <span class="mw-headline"> อื่นๆ ที่เกี่ยวข้อง </span></h2>
<p><!--<br />
NewPP limit report<br />
Preprocessor node count: 55/1000000<br />
Post-expand include size: 0/2097152 bytes<br />
Template argument size: 0/2097152 bytes<br />
Expensive parser function count: 0/100<br />
--></p>
<p><!-- Saved in parser cache with key memoball_wiki:pcache:idhash:6-0!1!0!!th!2!edit=0 and timestamp 20090825100730 --></p>
<div class="printfooter">
<h5>รับข้อมูลจาก (Reference) : </h5>
<p>จาก WikiBall : <a href="http://wiki.memoball.info/index.php/Subversion">http://wiki.memoball.info/index.php/Subversion</a></div>
<div id='catlinks' class='catlinks'>
<div id="mw-normal-catlinks"><a href="http://wiki.memoball.info//index.php/%E0%B8%9E%E0%B8%B4%E0%B9%80%E0%B8%A8%E0%B8%A9:Categories" title="พิเศษ:Categories">หมวดหมู่</a>:&#32;<span dir='ltr'><a href="http://wiki.memoball.info//index.php?title=%E0%B8%AB%E0%B8%A1%E0%B8%A7%E0%B8%94%E0%B8%AB%E0%B8%A1%E0%B8%B9%E0%B9%88:SVN&amp;action=edit&amp;redlink=1" class="new" title="หมวดหมู่:SVN (ยังไม่ได้สร้าง)">SVN</a></span></div>
</div>
<p>			<!-- end content --></p>
<div class="visualClear"></div>
</p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.memoball.info/01/%e0%b8%81%e0%b8%b2%e0%b8%a3%e0%b8%95%e0%b8%b4%e0%b8%94%e0%b8%95%e0%b8%b1%e0%b9%89%e0%b8%87-svn/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>การติดตั้ง subversion เพื่อใช้กับ trac</title>
		<link>http://www.memoball.info/01/%e0%b8%81%e0%b8%b2%e0%b8%a3%e0%b8%95%e0%b8%b4%e0%b8%94%e0%b8%95%e0%b8%b1%e0%b9%89%e0%b8%87-subversion-%e0%b9%80%e0%b8%9e%e0%b8%b7%e0%b9%88%e0%b8%ad%e0%b9%83%e0%b8%8a%e0%b9%89%e0%b8%81%e0%b8%b1/</link>
		<comments>http://www.memoball.info/01/%e0%b8%81%e0%b8%b2%e0%b8%a3%e0%b8%95%e0%b8%b4%e0%b8%94%e0%b8%95%e0%b8%b1%e0%b9%89%e0%b8%87-subversion-%e0%b9%80%e0%b8%9e%e0%b8%b7%e0%b9%88%e0%b8%ad%e0%b9%83%e0%b8%8a%e0%b9%89%e0%b8%81%e0%b8%b1/#comments</comments>
		<pubDate>Wed, 21 Jan 2009 07:34:33 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[Trac & SVN]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[trac]]></category>

		<guid isPermaLink="false">http://memoball.nabzer.com/?p=165</guid>
		<description><![CDATA[เนื่องจากเมื่อลง trac แล้วกลับยังใช้ browse source ไม่ได้ จึงได้หาข้อมูลในส่วนนี้ จึงทำให้รู้ว่า trac นั้น จะ run ตรงส่วนของ browse source เป็นเพียงหน้ากากเท่านั้น แต่จะเพิ่มบางส่วนเท่านั้นคือ mileston และ ticket ซึ่งตัวที่รันจริงๆ จะเป็นตัวจัดการโค้ด Subversion (จะเป็นตัวอื่นก็ได้ ไม่จำกัด) ซึ่งการติดตั้ง Subversion จะอยู่ใน


จาก WikiBall


			
Subversion เป็นโปรแกรมที่ใชัสร้าง และจัดการ version ของ source code ของเรา





เนื้อหา


1 การติดตั้ง

1.1 การใช้งานร่วมกับ apache2


2 การใช้งาน

2.1 สร้าง repository
2.2 นำเข้า (import) project
2.3 การเข้าผ่าน apache
2.4 คู่มือการใช้งาน
2.5 การ config svnserve
2.6 SVN Client


3 svn service [...]]]></description>
			<content:encoded><![CDATA[<p>เนื่องจากเมื่อลง trac แล้วกลับยังใช้ browse source ไม่ได้ จึงได้หาข้อมูลในส่วนนี้ จึงทำให้รู้ว่า trac นั้น จะ run ตรงส่วนของ browse source เป็นเพียงหน้ากากเท่านั้น แต่จะเพิ่มบางส่วนเท่านั้นคือ mileston และ ticket ซึ่งตัวที่รันจริงๆ จะเป็นตัวจัดการโค้ด Subversion (จะเป็นตัวอื่นก็ได้ ไม่จำกัด) ซึ่งการติดตั้ง Subversion จะอยู่ใน<br />
<span id="more-165"></span></p>
<div id="bodyContent">
<h3 id="siteSub"><a href="http://wiki.memoball.info/index.php/Subversion">จาก WikiBall</a></h3>
<div id="contentSub"></div>
<div id="jump-to-nav"></div>
<p>			<!-- start content --></p>
<p>Subversion เป็นโปรแกรมที่ใชัสร้าง และจัดการ version ของ source code ของเรา
</p>
<table id="toc" class="toc" summary="เนื้อหา">
<tr>
<td>
<div id="toctitle">
<h2>เนื้อหา</h2>
</div>
<ul>
<li class="toclevel-1"><a href="./#.E0.B8.81.E0.B8.B2.E0.B8.A3.E0.B8.95.E0.B8.B4.E0.B8.94.E0.B8.95.E0.B8.B1.E0.B9.89.E0.B8.87" ref="toc"><span class="tocnumber">1</span> <span class="toctext">การติดตั้ง</span></a>
<ul>
<li class="toclevel-2"><a href="./#.E0.B8.81.E0.B8.B2.E0.B8.A3.E0.B9.83.E0.B8.8A.E0.B9.89.E0.B8.87.E0.B8.B2.E0.B8.99.E0.B8.A3.E0.B9.88.E0.B8.A7.E0.B8.A1.E0.B8.81.E0.B8.B1.E0.B8.9A_apache2" ref="toc"><span class="tocnumber">1.1</span> <span class="toctext">การใช้งานร่วมกับ apache2</span></a></li>
</ul>
</li>
<li class="toclevel-1"><a href="./#.E0.B8.81.E0.B8.B2.E0.B8.A3.E0.B9.83.E0.B8.8A.E0.B9.89.E0.B8.87.E0.B8.B2.E0.B8.99" ref="toc"><span class="tocnumber">2</span> <span class="toctext">การใช้งาน</span></a>
<ul>
<li class="toclevel-2"><a href="./#.E0.B8.AA.E0.B8.A3.E0.B9.89.E0.B8.B2.E0.B8.87_repository" ref="toc"><span class="tocnumber">2.1</span> <span class="toctext">สร้าง repository</span></a></li>
<li class="toclevel-2"><a href="./#.E0.B8.99.E0.B8.B3.E0.B9.80.E0.B8.82.E0.B9.89.E0.B8.B2_.28import.29_project" ref="toc"><span class="tocnumber">2.2</span> <span class="toctext">นำเข้า (import) project</span></a></li>
<li class="toclevel-2"><a href="./#.E0.B8.81.E0.B8.B2.E0.B8.A3.E0.B9.80.E0.B8.82.E0.B9.89.E0.B8.B2.E0.B8.9C.E0.B9.88.E0.B8.B2.E0.B8.99_apache" ref="toc"><span class="tocnumber">2.3</span> <span class="toctext">การเข้าผ่าน apache</span></a></li>
<li class="toclevel-2"><a href="./#.E0.B8.84.E0.B8.B9.E0.B9.88.E0.B8.A1.E0.B8.B7.E0.B8.AD.E0.B8.81.E0.B8.B2.E0.B8.A3.E0.B9.83.E0.B8.8A.E0.B9.89.E0.B8.87.E0.B8.B2.E0.B8.99" ref="toc"><span class="tocnumber">2.4</span> <span class="toctext">คู่มือการใช้งาน</span></a></li>
<li class="toclevel-2"><a href="./#.E0.B8.81.E0.B8.B2.E0.B8.A3_config_svnserve" ref="toc"><span class="tocnumber">2.5</span> <span class="toctext">การ config svnserve</span></a></li>
<li class="toclevel-2"><a href="./#SVN_Client" ref="toc"><span class="tocnumber">2.6</span> <span class="toctext">SVN Client</span></a></li>
</ul>
</li>
<li class="toclevel-1"><a href="./#svn_service_file" ref="toc"><span class="tocnumber">3</span> <span class="toctext">svn service file</span></a></li>
<li class="toclevel-1"><a href="./#Troubleshooting" ref="toc"><span class="tocnumber">4</span> <span class="toctext">Troubleshooting</span></a></li>
<li class="toclevel-1"><a href="./#.E0.B8.AD.E0.B8.B7.E0.B9.88.E0.B8.99.E0.B9.86_.E0.B8.97.E0.B8.B5.E0.B9.88.E0.B9.80.E0.B8.81.E0.B8.B5.E0.B9.88.E0.B8.A2.E0.B8.A7.E0.B8.82.E0.B9.89.E0.B8.AD.E0.B8.87" ref="toc"><span class="tocnumber">5</span> <span class="toctext">อื่นๆ ที่เกี่ยวข้อง</span></a></li>
</ul>
</td>
</tr>
</table>
<p><script type="text/javascript"> if (window.showTocToggle) { var tocShowText = "แสดง"; var tocHideText = "ซ่อน"; showTocToggle(); } </script><br />
<a name=".E0.B8.81.E0.B8.B2.E0.B8.A3.E0.B8.95.E0.B8.B4.E0.B8.94.E0.B8.95.E0.B8.B1.E0.B9.89.E0.B8.87" href="http://wiki.memoball.info/"></a><br />
<h2> <span class="mw-headline"> การติดตั้ง </span></h2>
<p>สำหรับ Ubuntu
</p>
<pre>$ sudo apt-get install apt-get install subversion</pre>
<p><a name=".E0.B8.81.E0.B8.B2.E0.B8.A3.E0.B9.83.E0.B8.8A.E0.B9.89.E0.B8.87.E0.B8.B2.E0.B8.99.E0.B8.A3.E0.B9.88.E0.B8.A7.E0.B8.A1.E0.B8.81.E0.B8.B1.E0.B8.9A_apache2" href="http://wiki.memoball.info/"></a><br />
<h3> <span class="mw-headline"> การใช้งานร่วมกับ apache2 </span></h3>
<p>ติดตั้ง apache module
</p>
<pre>$ sudo apt-get install libapache2-svn</pre>
<p>สร้าง diretory ดังตัวอย่าง หรืออย่างอื่นก็ได้
</p>
<pre>
mkdir /var/svn
mkdir /var/svn/repository
</pre>
<p>แก้ไขค่า permission
</p>
<pre>
chown www-data:www-data -R /var/svn/repository
chmod 770 -R /var/svn/repository
</pre>
<p>แก้ไข apache svn module configuration file&nbsp;: <b>/etc/apache2/mods-available/dav_svn.conf</b>
</p>
<pre>
...
SVNParentPath /var/svn/repository
#SVNPath /var/svn/repository
.....
AuthType Basic
AuthName &quot;Subversion Repository&quot;
AuthUserFile /etc/apache2/dav_svn.passwd
Require valid-user
...
</pre>
<p>สร้าง htaccess
</p>
<pre>
htpasswd2 -c /etc/apache2/dav_svn.passwd tester
</pre>
<p>ref&nbsp;: <a href="http://www.debuntu.org/2006/05/20/54-how-to-subversion-svn-with-apache2-and-dav" class="external free" title="http://www.debuntu.org/2006/05/20/54-how-to-subversion-svn-with-apache2-and-dav" rel="nofollow">http://www.debuntu.org/2006/05/20/54-how-to-subversion-svn-with-apache2-and-dav</a>
</p>
<p><a name=".E0.B8.81.E0.B8.B2.E0.B8.A3.E0.B9.83.E0.B8.8A.E0.B9.89.E0.B8.87.E0.B8.B2.E0.B8.99" href="http://wiki.memoball.info/"></a><br />
<h2> <span class="mw-headline"> การใช้งาน </span></h2>
<p><a name=".E0.B8.AA.E0.B8.A3.E0.B9.89.E0.B8.B2.E0.B8.87_repository" href="http://wiki.memoball.info/"></a><br />
<h3> <span class="mw-headline"> สร้าง repository </span></h3>
<p>ตัวอย่างการสร้าง
</p>
<pre>$ svnadmin create /var/svn/repository/example</pre>
<p><a name=".E0.B8.99.E0.B8.B3.E0.B9.80.E0.B8.82.E0.B9.89.E0.B8.B2_.28import.29_project" href="http://wiki.memoball.info/"></a><br />
<h3> <span class="mw-headline"> นำเข้า (import) project </span></h3>
<pre>$ svn import /path/to/projectexample file:///var/svn/repository/example/examplev1 -m&quot;initial import&quot; </pre>
<p><a name=".E0.B8.81.E0.B8.B2.E0.B8.A3.E0.B9.80.E0.B8.82.E0.B9.89.E0.B8.B2.E0.B8.9C.E0.B9.88.E0.B8.B2.E0.B8.99_apache" href="http://wiki.memoball.info/"></a><br />
<h3> <span class="mw-headline"> การเข้าผ่าน apache </span></h3>
<pre>http://servername/svn/project</pre>
<p><a name=".E0.B8.84.E0.B8.B9.E0.B9.88.E0.B8.A1.E0.B8.B7.E0.B8.AD.E0.B8.81.E0.B8.B2.E0.B8.A3.E0.B9.83.E0.B8.8A.E0.B9.89.E0.B8.87.E0.B8.B2.E0.B8.99" href="http://wiki.memoball.info/"></a><br />
<h3> <span class="mw-headline"> คู่มือการใช้งาน </span></h3>
<ol>
<li><a href="http://svnbook.red-bean.com/" class="external text" title="http://svnbook.red-bean.com/" rel="nofollow">SVN Command line 1</a>
</li>
<li><a href="http://www.yolinux.com/TUTORIALS/Subversion.html#COMMAND" class="external text" title="http://www.yolinux.com/TUTORIALS/Subversion.html#COMMAND" rel="nofollow">SVN Command line 2</a>
</li>
<li><a href="http://home.thep.lu.se/~jari/documents/subversion_guidelines/subversion_guidelines.pdf" class="external text" title="http://home.thep.lu.se/~jari/documents/subversion_guidelines/subversion_guidelines.pdf" rel="nofollow">คู่มือการใช้งาน Subversion</a>
</li>
<li><a href="http://www.rapidsvn.org/index.php/Documentation#Linux.2FUnix" class="external text" title="http://www.rapidsvn.org/index.php/Documentation#Linux.2FUnix" rel="nofollow">คู่มือการใช้งาน RapidSVN</a>
</li>
</ol>
<p><a name=".E0.B8.81.E0.B8.B2.E0.B8.A3_config_svnserve" href="http://wiki.memoball.info/"></a><br />
<h3> <span class="mw-headline"> การ config svnserve </span></h3>
<p>svnserve คือ daemon สำหรับ svn โดยที่เราสามารถ login ผ่านทาง <a href="http://wiki.memoball.info//index.php/Subversion#SVN_Client" title="Subversion">SVN client</a> ต่างๆ โดยผ่านโปรโตคอล svn
</p>
<pre>
svn://hostname:port/repos
</pre>
<p>ทดสอบรับ daemon แบบ forground โดยใช้คำสั่ง
</p>
<pre>
$ sudo svnserve -d --listen-port=port --foreground -r  root/path
</pre>
<p>เรียกเป็น http ใน browser ถ้าขึ้นในลักษณะนี้แสดงว่ารันได้แล้ว
</p>
<pre>
( success ( 1 2 ( ANONYMOUS ) ( edit-pipeline svndiff1 absent-entries ) ) )
</pre>
<p>ตัว svnserve นี้จะไม่มี file ใน init.d มาให้เราจะต้องสร้างเองดังนี้<br />
<a href="http://wiki.memoball.info//images/8/88/Svnserve.tar.gz" class="internal" title="Svnserve.tar.gz">สื่อ:svnserve.tar.gz</a>
</p>
<p>อย่าลืมตั้งค่า authentication ใน <i>/path/to/repository/conf</i>
</p>
<p><a name="SVN_Client" href="http://wiki.memoball.info/"></a><br />
<h3> <span class="mw-headline"> SVN Client </span></h3>
<p>สำหรับที่ผู้ที่ไม่อยากใช้ SVN แบบ command line ใช้แบบ command line ไม่เป็น(เช่นเดียวกับผม) จะมี GUI กระต่ายกับเต่า ให้เลือกใช้ได้ดังนี้
</p>
<ol>
<li><a href="http://tortoisesvn.tigris.org/" class="external text" title="http://tortoisesvn.tigris.org/" rel="nofollow">TortoiseSVN-(Windows)</a>
</li>
<li><a href="http://rapidsvn.tigris.org/" class="external text" title="http://rapidsvn.tigris.org/" rel="nofollow">RapidSVN-(Ubuntu+Mac+Windows)</a>
</li>
</ol>
<p>ref&nbsp;: <a href="http://agaricdesign.com/note/subversion-client-ubuntu-anything-tortoisesvn" class="external free" title="http://agaricdesign.com/note/subversion-client-ubuntu-anything-tortoisesvn" rel="nofollow">http://agaricdesign.com/note/subversion-client-ubuntu-anything-tortoisesvn</a>
</p>
<p><a name="svn_service_file" href="http://wiki.memoball.info/"></a><br />
<h2> <span class="mw-headline"> svn service file </span></h2>
<pre>
#!/bin/sh -e
#
# svnserve - brings up the svn server so anonymous users
# can access svn
#

# Get LSB functions
. /lib/lsb/init-functions
. /etc/default/rcS

SVNSERVE=/usr/bin/svnserve
SVN_USER=svn
SVN_GROUP=svn
SVN_REPO_PATH=/var/svn/repository/
SVN_PORT=8000

# Check that the package is still installed
[ -x $SVNSERVE ] || exit 0;

case &quot;$1&quot; in
	start)
		log_begin_msg &quot;Starting svnserve...&quot;
		umask 002
		if start-stop-daemon --start \
		--chuid $SVN_USER:$SVN_GROUP \
		--exec $SVNSERVE \
		-- -d --listen-port=$SVN_PORT -r $SVN_REPO_PATH; then
			log_end_msg 0
		else
			log_end_msg $?
		fi
	;;

	stop)
		log_begin_msg &quot;Stopping svnserve...&quot;
		if start-stop-daemon --stop --exec $SVNSERVE; then
		log_end_msg 0
		else
		log_end_msg $?
		fi
	;;

	restart|force-reload)
		&quot;$0&quot; stop &amp;&amp; &quot;$0&quot; start
	;;

	*)
	echo &quot;Usage: /etc/init.d/svnserve {start|stop|restart|force-reload}&quot;
		exit 1
	;;
esac

exit 0
</pre>
<p><a name="Troubleshooting" href="http://wiki.memoball.info/"></a><br />
<h2> <span class="mw-headline"> Troubleshooting </span></h2>
<ul>
<li>import ไม่ได้
</li>
</ul>
<pre>
svn: Unable to open an ra_local session to URL
svn: Unable to open repository 'file:///Development/subversion/foo'
</pre>
<p>เหตุการณ์ดังกล่าวเกิดขึ้นได้ 2 กรณี คือ
</p>
<pre> #path ดังกล่าวไม่สามารถเข้าไปได้ เช่น ติด permission
 #ใส่ path กับ URL สรับกัน
</pre>
<p><a name=".E0.B8.AD.E0.B8.B7.E0.B9.88.E0.B8.99.E0.B9.86_.E0.B8.97.E0.B8.B5.E0.B9.88.E0.B9.80.E0.B8.81.E0.B8.B5.E0.B9.88.E0.B8.A2.E0.B8.A7.E0.B8.82.E0.B9.89.E0.B8.AD.E0.B8.87" href="http://wiki.memoball.info/"></a><br />
<h2> <span class="mw-headline"> อื่นๆ ที่เกี่ยวข้อง </span></h2>
<p><!--<br />
NewPP limit report<br />
Preprocessor node count: 55/1000000<br />
Post-expand include size: 0/2097152 bytes<br />
Template argument size: 0/2097152 bytes<br />
Expensive parser function count: 0/100<br />
--></p>
<p><!-- Saved in parser cache with key memoball_wiki:pcache:idhash:6-0!1!0!!th!2!edit=0 and timestamp 20090825100730 --></p>
<div class="printfooter">
<h5>รับข้อมูลจาก (Reference) : </h5>
<p>จาก WikiBall : <a href="http://wiki.memoball.info/index.php/Subversion">http://wiki.memoball.info/index.php/Subversion</a></div>
<div id='catlinks' class='catlinks'>
<div id="mw-normal-catlinks"><a href="http://wiki.memoball.info//index.php/%E0%B8%9E%E0%B8%B4%E0%B9%80%E0%B8%A8%E0%B8%A9:Categories" title="พิเศษ:Categories">หมวดหมู่</a>:&#32;<span dir='ltr'><a href="http://wiki.memoball.info//index.php?title=%E0%B8%AB%E0%B8%A1%E0%B8%A7%E0%B8%94%E0%B8%AB%E0%B8%A1%E0%B8%B9%E0%B9%88:SVN&amp;action=edit&amp;redlink=1" class="new" title="หมวดหมู่:SVN (ยังไม่ได้สร้าง)">SVN</a></span></div>
</div>
<p>			<!-- end content --></p>
<div class="visualClear"></div>
</p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.memoball.info/01/%e0%b8%81%e0%b8%b2%e0%b8%a3%e0%b8%95%e0%b8%b4%e0%b8%94%e0%b8%95%e0%b8%b1%e0%b9%89%e0%b8%87-subversion-%e0%b9%80%e0%b8%9e%e0%b8%b7%e0%b9%88%e0%b8%ad%e0%b9%83%e0%b8%8a%e0%b9%89%e0%b8%81%e0%b8%b1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
