<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html; charset=ISO-8859-1"
 http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#ffffff">
<br>
<br>
On 12/29/2009 08:01 PM, Steven F. LeBrun wrote:
<blockquote cite="mid:4B3AA678.6050304@lebruns.com" type="cite">
  <meta http-equiv="content-type"
 content="text/html; charset=ISO-8859-1">
After upgrading to Fedora 12, I installed and tried to set up a
Subversion repository with mixed success.&nbsp; I have worked out the bulk
of the issues but one still has me stumped.&nbsp; Hopefully, someone on this
list knows the answer or can point me to a URL that does.<br>
  <br>
The problem is that I cannot get Subversion to work with Apache 2.2.&nbsp;
Every time that I try to checkout the repository, I receive a 403
Forbidden Access error.&nbsp; To make matters more frustrating, if I access
the repository using local access (<a moz-do-not-send="true"
 class="moz-txt-link-freetext" href="file:///">file:///</a>...) the
command works.&nbsp; It
is only when I try to use HTTP/WebDAV access (<a moz-do-not-send="true"
 class="moz-txt-link-freetext" href="http://localhost/svn/">http://localhost/svn/</a>...)
does
the access problem occur.<br>
  <br>
Things that I have tried:<br>
  <br>
- SELinux enabled and disabled -- no difference.<br>
  <br>
- Various permissions and ownerships.<br>
&nbsp; -- The repository and Subversion directories are currently owned by
apache.apache.<br>
  <br>
- Various settings in my subversion.conf file for httpd.&nbsp; <br>
&nbsp; -- When the &lt;LimitExcept&gt; section is commented out, the failure
comes on the third<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "PROPFIND /svn/Home/sfbooks/trunk&nbsp; HTTP/1.1" request.&nbsp; The first
two return 207 <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; while the third one returns 403.&nbsp; Using Wireshark, all three
requests are identical<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; barring numbers in the IP headers.<br>
&nbsp; -- When the &lt;LimitExcept&gt; section is active, the failure comes
on the very first request,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "OPTIONS /svn/Home/sfbooks/trunk HTTP/1.1" request with a 403
response.<br>
&nbsp; -- Both 403 responses contain the same reason: "You don't have
permission to access<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /svn/Home/sfbooks/trunk\n on this server."<br>
  <br>
Any suggestions will be appreciated.<br>
  <br>
Setup:<br>
  <br>
Root Subversion Directory:&nbsp;&nbsp;&nbsp; /opt/Subversion<br>
Repository Parent Directory:&nbsp; /opt/Subversion/repos<br>
Password File:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /opt/Subversion/users/passwords
(created using htpasswd)<br>
SVN Authz Config File:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
/opt/Subversion/permissions/svnauthz.conf<br>
  <br>
Repository:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Home&nbsp; (located at
/opt/Subversion/repos/Home)<br>
Project within Home Repo:&nbsp;&nbsp;&nbsp;&nbsp; sfbooks/trunk<br>
  <br>
Content of passwords:<br>
&nbsp;&nbsp;&nbsp; steven:MD5PasswordHash<br>
  <br>
Content of svnauthz.conf<br>
&nbsp;&nbsp;&nbsp; [/]<br>
&nbsp;&nbsp;&nbsp; steven=rw<br>
  <br>
Content of conf.d/subversion.conf<br>
  <br>
&nbsp; LoadModule dav_svn_module&nbsp;&nbsp;&nbsp;&nbsp; modules/mod_dav_svn.so<br>
&nbsp; LoadModule authz_svn_module&nbsp;&nbsp; modules/mod_authz_svn.so<br>
  <br>
&nbsp; Alias&nbsp; /svn&nbsp; /opt/Subversion/repos<br>
  <br>
&nbsp; &lt;Location /svn/&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp; # mod_dav Commands<br>
&nbsp; &nbsp;&nbsp; DAV&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; svn<br>
&nbsp; &nbsp;&nbsp; DavDepthInfinity&nbsp;&nbsp;&nbsp;&nbsp; on<br>
  <br>
&nbsp; &nbsp;&nbsp; # SVN Provider Commands<br>
&nbsp;&nbsp;&nbsp;&nbsp; SVNParentPath&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /opt/Subversion/repos<br>
  <br>
&nbsp;&nbsp;&nbsp;&nbsp; # authz_svn_module Commands<br>
&nbsp;&nbsp;&nbsp;&nbsp; AuthzSVNAccessFile&nbsp;&nbsp; /opt/Subversion/permissions/svnauthz.conf<br>
  <br>
  <br>
&nbsp;&nbsp;&nbsp;&nbsp; &lt;LimitExcept GET PROPFIND OPTIONS REPORT&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; # Authentication Commands<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; AuthType&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Basic<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; AuthName&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "Subversion Repository Login"<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; AuthUserFile&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /opt/Subversion/users/passwords<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Satisfy&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Any<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Require&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; valid-user<br>
&nbsp;&nbsp;&nbsp;&nbsp; &lt;/LimitExcept&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp;&nbsp; #&nbsp;&nbsp; &lt;Limit GET PROPFIND OPTIONS REPORT&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp; #&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Order&nbsp;&nbsp; Allow,Deny<br>
&nbsp;&nbsp;&nbsp;&nbsp; #&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Allow&nbsp;&nbsp; from All<br>
&nbsp;&nbsp;&nbsp;&nbsp; #&nbsp;&nbsp; &lt;/Limit&gt;<br>
  <br>
&nbsp; &lt;/Location&gt;<br>
  <br>
  <br>
  <div class="moz-signature">-- <br>
  <div>&nbsp;&nbsp;Steven F. LeBrun<br>
  <p>
Quote: <em>"Winter meant the coming of the lazy wind, which couldn't
be
bothered to blow around people and blew right through them instead."</em><br>
&nbsp;&nbsp;&nbsp;&nbsp; -- Terry Pratchett, from <em>"Wyrd Sisters"</em></p>
  </div>
  </div>
</blockquote>
<div class="moz-signature"><font color="#000000"><br>
After a lot of searching with google, forums, etc, no solution was
found on the net.&nbsp; There were a lot of forums/mailing lists that listed
the same problem but no solutions were offered.&nbsp; A lot of things were
hinted at nobody had a general solution.<br>
<br>
Most of the suggestions revolved around access permissions of the
actual files in the repository and its path.&nbsp; That did not affect my
problem.<br>
<br>
Two facts lead me to the final solution:<br>
1)&nbsp; "svn checkout <a class="moz-txt-link-freetext" href="file:///">file:///</a>[repo path]&nbsp; [sandbox path]" worked while<br>
&nbsp;&nbsp;&nbsp;&nbsp; "svn checkout <a class="moz-txt-link-freetext" href="http://localhost/">http://localhost/</a>[repo URI] [sandbox path]" did not.<br>
&nbsp;&nbsp;&nbsp;&nbsp; This lead me to believe that I had created my Subversion
repository correctly and that<br>
&nbsp;&nbsp;&nbsp;&nbsp; the problem was probably with my Apache configuration or Linux
filesystem access<br>
&nbsp;&nbsp;&nbsp;&nbsp; permissions.<br>
<br>
2)&nbsp; When I ran the checkout command using the http URL, the Apache
access log showed <br>
&nbsp;&nbsp;&nbsp;&nbsp; multiple requests ran correctly before the 403 Forbidden
occurred.&nbsp; Plus, the request<br>
&nbsp;&nbsp;&nbsp;&nbsp; that received the 403 status was the third request for the same
data.&nbsp; The content of<br>
&nbsp;&nbsp;&nbsp;&nbsp; the all three requests were identical with the exception of IP
headers (counters and <br>
&nbsp;&nbsp;&nbsp;&nbsp; times differ).<br>
<br>
So what could be the problem that allowed the first two PROPFIND
requests to succeed while rejecting the third identical request.<br>
<br>
The answer:&nbsp; mod_evasive (mod_evasive20.so in my case).<br>
<br>
The evasive module is designed to stop denial of service attacks.&nbsp; It
works by tracking how many times the same request comes in from the
same IP address in a configurable interval.&nbsp; In the case of the default
settings the threshold was set to 2 requests/IP Address/1 second
interval.&nbsp; This allowed the first two PROPFIND requests to the same
path to succeed and the third request to fail with a 403 Forbidden
error.<br>
<br>
Increasing the threshold to 5 requests per second per IP address fixed
my WebDav access to my Subversion repository while still providing DOS
attack protection.<br>
<br>
<br>
</font>-- <br>
<div>&nbsp;&nbsp;Steven F. LeBrun<br>
<p>
Quote: <em>
"There are 10 types of people in this world, those that understand
binary and those who don't."
</em><br>
</p>
</div>
</div>
</body>
</html>