初始SVN签出失败:在终端中"access forbidden",在浏览器中"Error 403"



我一直在尝试使用apache2作为服务器在ubuntu 11.04机器上建立svn存储库。我能够构建VirtualHost,启动它,创建svn存储库,设置SSL并在本地访问svn存储池。

然而,在过去的1.5天里,我一直在试图弄清楚如何使用svn与我之前为svn创建的用户进行结账,从另一台机器上结账。当我试图在终端结账时,我得到以下错误:

svn: access to '<Location>' forbidden

另一方面,如果我转到浏览器,我会收到一个403错误,上面写着:

You don't have permission to access /svn/TSAACode on this server.

现在,我搜索了谷歌、stackoverflow、linux论坛和我祖母的阁楼,都没能找到解决方案。我有一种预感,这与权限SVN目录(我将其设置为777)有关,或者可能与服务器不被允许读取文件有关。

以下是一些重要文件:

虚拟主机:

<VirtualHost *:443>
    ServerAdmin webmaster@localhost
    SSLEngine on
    SSLCertificateFile /etc/apache2/ssl/apache.pem
    SSLProtocol all
    SSLCipherSuite HIGH:MEDIUM
    DocumentRoot /svn/Code/
    <Directory />
            Options FollowSymLinks
            AllowOverride None
    </Directory>
    <Directory /svn/Code/>
            Options Indexes FollowSymLinks MultiViews
            AllowOverride None
            Order allow,deny
            allow from all
    </Directory>
    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
    <Directory "/usr/lib/cgi-bin">
            AllowOverride None
            Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
            Order allow,deny
            Allow from all
    </Directory>
    ErrorLog /etc/apache2/logs/papasmurf_error.log
    LogLevel warn
    CustomLog /etc/apache2/logs/papasmurf_access.log combined
Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
    Options Indexes MultiViews FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all
    Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
</VirtualHost>

dav_svn.conf文件:

<Location /svn/Code>
    DAV svn
    SVNParentPath /svn
    AuthType Basic
    AuthName "Code"
    AuthUserFile /etc/svn-auth.htpasswd
    Require valid-user
    SSLRequireSSL
</Location>

我认为这应该是一个呕吐的词了——我希望有人知道发生了什么……我当然不知道。提前谢谢!

我想明白了。一旦我查看了正确的错误文件(/var/log/apache2中的Apache服务器错误文件,而不是站点错误文件),我每次尝试结账时都会发现以下错误:

(2)No such file or directory: The URI does not contain the name of a repository.  [403, #190001]

每次我试图将浏览器指向存储库时,我都会发现这个错误:

Could not fetch resource information.  [403, #0]

事实证明,这是由于dav_svn.conf文件行中的一个错误造成的;它应该读如下:

<Location /svn/>
DAV svn
SVNParentPath /svn
AuthType Basic
AuthName "Code"
AuthUserFile /etc/svn-auth.htpasswd
Require valid-user
SSLRequireSSL
</Location>

通过在SVN父路径中放一个较低的目录,但放一个较高的目录,我实际上创建了一个矛盾的语句,使服务器无法确定我要查看的目录。此外,第二个"/"也很重要。

感谢sarnold为我指出正确的错误文件!

相关内容

最新更新