<?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>算法交易-Bali &#187; svn</title>
	<atom:link href="http://libaocun.com/tag/svn/feed" rel="self" type="application/rss+xml" />
	<link>http://libaocun.com</link>
	<description>Think globally, act locally.</description>
	<lastBuildDate>Fri, 06 Jan 2012 02:51:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>Fedora12 下配置 SVN 服务器</title>
		<link>http://libaocun.com/fedora12-setup-svn</link>
		<comments>http://libaocun.com/fedora12-setup-svn#comments</comments>
		<pubDate>Thu, 08 Apr 2010 17:46:16 +0000</pubDate>
		<dc:creator>lennydou</dc:creator>
				<category><![CDATA[一些老文章]]></category>
		<category><![CDATA[fedora12]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://balionweb.com/?p=403</guid>
		<description><![CDATA[assume the following dummy IP addresses and port of the server for the rest of the article: (replace these with your own IP, and port values)   external IP: 55.444.444.55   internal lan IP: 192.168.1.200   svn port: 8080 Most of the operations here will require that you have access to the root account, as [...]]]></description>
			<content:encoded><![CDATA[<p>assume the following dummy IP addresses and port of the server for the rest of the article: (replace these with your own IP, and port values)</p>
<p>  <span style="color: #33cccc">external IP: 55.444.444.55<br />
  internal lan IP: 192.168.1.200<br />
  svn port: 8080</span></p>
<p>Most of the operations here will require that you have access to the root account, as always.</p>
<p>I like to use the yum extender and an http gui to manipulate apache&#8217;s settings, so those need to be installed:</p>
<p>  &gt; yum -y install yumex</p>
<p>This installs a gui for yum, which can be found, after a successful install on the desktop at:</p>
<p>  <span style="color: #33cccc">Applications &gt; Yum Extender</span></p>
<p>Using the yum extender, we can see what has already been installed or not, on the linux machine. So, we should make sure that the Apache server is installed, and also install the Apache configuration tool (the http gui):</p>
<p>  <span style="color: #33cccc">httpd<br />
  system-config-httpd</span></p>
<p>We also need to install the Apache server module for the subversion server:</p>
<p><span style="color: #33cccc">  mod_dav_svn</span></p>
<p>Next, to install SVN subversion we can go back to the command line, and install it using yum:</p>
<p>  &gt; <span style="color: #33cccc">yum install subversion</span></p>
<p>With these installations complete we can begin to create the necessary directories and modifying the various configuration files.</p>
<p>As root, create the following directory:</p>
<p>  &gt; <span style="color: #33cccc">mkdir -p /var/www/svn/repository</span></p>
<p>change to that directory,</p>
<p>  &gt; <span style="color: #33cccc">cd /var/www/svn/repository</span></p>
<p>and create a test repository,</p>
<p>  &gt; <span style="color: #33cccc">svnadmin create test_svn</span></p>
<p>Notice: use svnadmin command maybe get an error: SQLite编译为3.6.20,但是运行于3.6.17。然后会发现repository目录下面并没有生成任何东西。此时需要在Yum Extender里面找到两个sqlite开头的包，然后升级这两个包就可以了。</p>
<p>Actually, these SVN directories can be placed anywhere, as long as you keep track of the correct path for the modifications that will need to be added later to the configuration files.</p>
<p>Next, change directory, and set the ownership so that Apache can access the SVN directories.</p>
<p><span style="color: #33cccc">  &gt; cd /var/www<br />
  &gt; chown -R apache.apache svn</span></p>
<p>Next, we modify Apache&#8217;s settings.</p>
<p>Before modifying Apache&#8217;s settings it would be a good idea to make a backup of the configuration file, in case the Apache server won&#8217;t restart, we can always restore the configuration file and try again.</p>
<p> <span style="color: #33cccc"> &gt; cd   /etc/httpd/conf.d<br />
  &gt; cp  system-config-httpd.conf   system-config-httpd.conf.backup</span></p>
<p>Start the httpd configuration gui:</p>
<p><span style="color: #33cccc">  &gt; /usr/bin/system-config-httpd &amp;</span></p>
<p>In this window set the server name to:<br />
<span style="color: #33cccc">  192.168.1.200</span><br />
Add to Available Addresses :</p>
<p><span style="color: #33cccc">  listen to all addresses<br />
  port: 8080</span></p>
<p>Then to save these settings, hit OK. These changes will modify the file:</p>
<p> <span style="color: #33cccc"> /etc/httpd/conf.d/system-config-httpd.conf</span></p>
<p>Restart the Apache server. There are operating system line commands for restarting the http daemon, but a GUI is just as easy, and we can keep the GUI open since we will need to restart Apache a few more times.</p>
<p> <span style="color: #33cccc"> /usr/bin/system-config-services &amp;</span></p>
<p>Scroll down, select the daemon labeled httpd, and hit restart. Hopefully Apache restarts successfully, if not, then you may need to reload the original configuration file and try again.</p>
<p>Next, we will need to modify subversion&#8217;s configuration files.</p>
<p>To modify subversion&#8217;s configuration files we need to edit the following:</p>
<p>  <span style="color: #33cccc">/etc/httpd/conf.d/subversion.conf</span></p>
<p>This file was created with the installation of subversion.</p>
<p>The first two lines of the file should contain:</p>
<p><span style="color: #33cccc">  LoadModule dav_svn_module modules/mod_dav_svn.so<br />
  LoadModule authz_svn_module modules/mod_authz_svn.so</span></p>
<p>&#8230; if not, then those modules need to be installed.</p>
<p>First create a backup of the configuration file:</p>
<p><span style="color: #33cccc">  &gt; cp subversion.conf subversion.conf.backup</span></p>
<p>Modify the Location section of the file to the following:</p>
<p>  n  </p>
<p>Notice here how the directory for the repository we created earlier using the svnadmin command is not listed above. The above settings only point to the root location of the repository, or rather its parent path.</p>
<p>Save these settings, and restart the Apache server.</p>
<p>At this point we can test the SVN server from another PC on the private LAN. We can use our favorite web browser on a windows, linux, or mac PC, and enter the following URL:</p>
<p>  <a href="http://192.168.1.200:8080/svn/test_svn/">http://192.168.1.200:8080/svn/test_svn/</a></p>
<p>We should get a response page that looks like the following:</p>
<p><span style="color: #33cccc">  Revision 0: /</span></p>
<p><span style="color: #33cccc">  &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
  Powered by Subversion version 1.4.4 (r25188).</span></p>
<p>If you can see this, then the SVN server is running.<br />
Next, we need to add some password protection.</p>
<p>Here we add some password protection to the new SVN server.<br />
For this, lets assume a username of trill, and a password of towel42.<br />
Make the password directory:</p>
<p>  &gt; <span style="color: #33cccc">mkdir /etc/httpd/passwd</span></p>
<p>To create the initial password file, and add a user called &#8220;trill&#8221;:</p>
<p>  &gt; <span style="color: #33cccc">htpasswd -c /etc/httpd/passwd/svnpasswords trill</span></p>
<p>When the program asks, enter the password:</p>
<p>  towel42</p>
<p>Other command line options to htpasswd will allow you to add or delete more users.</p>
<p>For example, to add another user, called &#8220;asmith&#8221;:</p>
<p>  &gt; <span style="color: #33cccc">htpasswd /etc/httpd/passwd/svnpasswords asmith</span></p>
<p>When the program asks, enter the password:</p>
<p><span style="color: #33cccc">  neo22</span></p>
<p>This will append the user &#8220;asmith&#8221; to the passwords file, with the above password.</p>
<p>Edit the subversion configuration file to turn on the SVN authorization. We found that commenting out the &lt;LimitExcept lines allowed the SVN password authorization to work. So the final subversion configuration file:</p>
<p><span style="color: #33cccc"> /etc/httpd/conf.d/subversion.conf</span></p>
<p>&#8230; can look like this:<br />
LoadModule dav_svn_module modules/mod_dav_svn.so<br />
LoadModule authz_svn_module modules/mod_authz_svn.so</p>
<p><span style="color: #33cccc">&lt;Location /svn&gt;<br />
   DAV svn<br />
   SVNParentPath /var/www/svn/repository<br />
&lt;/Location&gt;</span></p>
<p><span style="color: #33cccc">&lt;Location /svn&gt;<br />
   DAV svn<br />
   SVNParentPath /var/www/svn/repository</span><br />
<span style="color: #33cccc">   # Limit write permission to list of valid users.<br />
   #&lt;LimitExcept GET PROPFIND OPTIONS REPORT&gt;<br />
      # Require SSL connection for password protection.<br />
      # SSLRequireSSL</span></p>
<p><span style="color: #33cccc">      AuthType Basic<br />
      AuthName &#8220;Authorization Realm&#8221;<br />
      AuthUserFile /etc/httpd/passwd/svnpasswords<br />
      Require valid-user<br />
   #&lt;/LimitExcept&gt;<br />
&lt;/Location&gt;</span></p>
<p>After having made these changes, restart the Apache server as above. Now, if we go back to the PC with the web browser, we can test the password authentication. Restart the web browser and enter into the URL:</p>
<p>  <a href="http://192.168.1.200:8080/svn/test_svn/">http://192.168.1.200:8080/svn/test_svn/</a></p>
<p>We should see a window pop up, prompting for a user&#8217;s name and a corresponding password.</p>
<p>Enter trill for the user name, and towel42 for the password. This should let us see the svn server&#8217;s response page as before.</p>
]]></content:encoded>
			<wfw:commentRss>http://libaocun.com/fedora12-setup-svn/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

