在我进行一些更改后,我的网络服务器上的 SVN 似乎已损坏。它被配置为一个 HTTPS 虚拟主机的一部分,并非普遍可访问。我的 SVN 客户端给出错误“访问(repo)被禁止”,但如果我通过网络界面(SVNListParentPath 已打开),一切都会正常工作,使用相同的 URL。我甚至可以通过浏览器访问文件。当我使用客户端时,我注意到我的 Apache 日志表明客户端正在尝试访问“/var/www/mysite/svn”,而我的 SVN 存储库位于“/home/svn”下。在使用 Elinks 进行故障排除时,我曾经收到过重定向页面,这是否意味着我的服务器正在使用某种重定向,而这种重定向对 SVN 客户端来说失败了?网站的其余部分通过 SSL 正常工作,只是 SVN 不起作用。谢谢。
以下是我为此站点所作的 Apache 配置:
#mydomain.co.uk
NameVirtualHost *:443
<VirtualHost *:80>
ServerAdmin [email protected]
ServerName mydomain.co.uk
DocumentRoot /var/www/mydomain
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/mydomain>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
<Directory /usr/share/ampache>
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
</Directory>
<Directory /var/www/mydomain/opendocman>
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
</Directory>
<Directory /var/www/mydomain/44kg>
Options Indexes FollowSymLinks MultiViews
Order deny,allow
Deny from all
Allow from 192.168.1
</Directory>
<Directory /var/www/mydomain/69td>
Options Indexes FollowSymLinks MultiViews
Order deny,allow
Deny from all
Allow from 192.168.1 127.0.0.1 localhost
SCGIHandler on
SCGIServer 127.0.0.1:5000
</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>
ErrorDocument 404 /fourohfour.html
ErrorLog /var/log/apache2/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog /var/log/apache2/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>
<VirtualHost *:443>
ServerAdmin [email protected]
ServerName mydomain.co.uk
DocumentRoot /var/www/mydomain/
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/mydomain/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
<Directory /var/www/mydomain/44kg>
Order deny,allow
Deny from all
</Directory>
<Location /svn>
DAV svn
SVNParentPath /home/svn
SVNListParentPath on
AuthType Basic
AuthName "Excalibur SVN Repository"
AuthUserFile /etc/apache2/dav_svn.passwd
Require valid-user
</Location>
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 /var/log/apache2/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog /var/log/apache2/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>
SSLEngine on
SSLCertificateFile /etc/ssl/certs/QPR/qpr.pem
SSLCertificateKeyFile /etc/ssl/certs/QPR/ca.key
</VirtualHost>
#SquirrelMail
<VirtualHost *:443>
ServerName webmail.mydomain.co.uk
DocumentRoot /usr/share/squirrelmail
SSLEngine on
SSLCertificateFile /etc/ssl/certs/QPR/qpr.pem
SSLCertificateKeyFile /etc/ssl/certs/QPR/ca.key
</VirtualHost>
上次成功是在我添加网络邮件之前,但禁用它并不能恢复 SVN。我实际上没有看到重定向页面 - 它给了我足够的时间在它发生之前发现它是一个 302 重定向,而且我无法重现它。通过浏览器,我的所有存储库都可以在https://mydomain.co.uk/svn/(存储库),但客户端中的相同 URL 在 SVN CLI 和 Dreamweaver 中都出现此错误:
Pegasus:Uni Gargravarr$ svn update
svn: access to '/svn/Uni' forbidden
答案1
明白了。
我完全忘记我最近在 Apache 中安装了“mod-evasive”。禁用它可以立即恢复 SVN。事实证明,Debian 中有一个与 mod-evasive 和 mod-dav-svn 相关的已知错误。正如这个问题一样:
Apache svn 服务器问题(403 禁止)
愚蠢的是,我在发帖之前也读了这个问题。我想我跳过了最后一篇帖子。
TL;DR: Mod-evasive 和 Apache2/SVN 不兼容 :)