首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用Websvn配置Apache Subversion

使用Websvn配置Apache Subversion
EN

Stack Overflow用户
提问于 2010-10-01 20:06:37
回答 2查看 7.5K关注 0票数 1

平台:

代码语言:javascript
复制
CentOS release 5.5 (Final)
SVN, version 1.4.2 (r22196)
Apache httpd.i386 2.2.3-43.el5.centos.3

我有一个名为subversion.conf的文件,/etc/httpd/conf.d/subversion.conf

代码语言:javascript
复制
LoadModule dav_svn_module     modules/mod_dav_svn.so
LoadModule authz_svn_module   modules/mod_authz_svn.so

# Virtual path for websvn
Alias /wsvn /var/www/websvn/
<Directory /var/www/websvn>
    Options Indexes FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>

# Subversion configuration
<location /wsvn>
    DAV svn
    SVNListParentPath on
    SVNParentPath /var/www/wsvn
    AuthzSVNAccessFile /etc/svn-acl-conf
    AuthType Basic
    AuthUserFile /etc/svn-auth-conf
    Require valid-user
</Location>

在我的svn-acl-conf中,我有以下内容:

代码语言:javascript
复制
[/]
joeblogs = rw

在我的svn-auth-conf中,我使用了# htpasswd -cm svn-auth-conf joeblogs

代码语言:javascript
复制
joeblogs:$apr1$ellT3...$2spAjOJ2W1kFDieAoJJeg

在我的目录/var/www/中,我有:

代码语言:javascript
复制
4 drwxr-xr-x 4 apache apache 4096 Oct  1 20:56 wsvn

和它的wsvn

代码语言:javascript
复制
4 drwxr-xr-x 7 apache apache 4096 Oct  1 20:56 APP
4 drwxr-xr-x 7 apache apache 4096 Oct  1 20:56 DEV

问题是,当我尝试使用以下代码导入项目时:

代码语言:javascript
复制
svn import temp http://x.x.x.x/wsvn/DEV/dev-proj -m"Initial import"
svn: Server sent unexpected return value (500 Internal Server Error) in response to OPTIONS request for 'http://x.x.x.x/wsvn/DEV/dev-proj'

当我尝试在火狐http://x.x.x.x/wsvn中浏览时,我得到了以下信息

代码语言:javascript
复制
The server encountered an internal error or misconfiguration and was unable to complete your request.

但是,如果我注释掉以下内容,我可以毫无问题地浏览到该站点,并且可以看到存储库:

代码语言:javascript
复制
<location /wsvn>
#    DAV svn
#    SVNListParentPath on
#    SVNParentPath /var/www/wsvn
#    AuthzSVNAccessFile /etc/svn-acl-conf
#    AuthType Basic
#    AuthUserFile /etc/svn-auth-conf
#    Require valid-user
</Location>

我如何解决这个问题?

错误日志

代码语言:javascript
复制
[Sat Oct 02 01:58:17 2010] [error] [client x.x.x.x] need AuthName: /wsvn/listing.php, referer: http://x.x.x.x/wsvn/listing.php?repname=DEV
[Sat Oct 02 01:58:28 2010] [error] [client x.x.x.x] need AuthName: /wsvn/DEV/dev-proj
[Sat Oct 02 02:00:59 2010] [notice] caught SIGTERM, shutting down
[Sat Oct 02 02:00:59 2010] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Sat Oct 02 02:00:59 2010] [notice] Digest: generating secret for digest authentication ...
[Sat Oct 02 02:00:59 2010] [notice] Digest: done
[Sat Oct 02 02:00:59 2010] [notice] Apache/2.2.3 (CentOS) configured -- resuming normal operations
[Sat Oct 02 02:01:03 2010] [error] [client x.x.x.x] need AuthName: /wsvn/DEV/dev-proj
[Sat Oct 02 02:02:28 2010] [notice] caught SIGTERM, shutting down
[Sat Oct 02 02:02:28 2010] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Sat Oct 02 02:02:28 2010] [notice] Digest: generating secret for digest authentication ...
[Sat Oct 02 02:02:28 2010] [notice] Digest: done
[Sat Oct 02 02:02:28 2010] [notice] Apache/2.2.3 (CentOS) configured -- resuming normal operations
[Sat Oct 02 02:02:31 2010] [error] [client x.x.x.x] need AuthName: /wsvn/listing.php, referer: http://x.x.x.x/wsvn/listing.php?repname=DEV
[Sat Oct 02 02:02:34 2010] [error] [client x.x.x.x] need AuthName: /wsvn/listing.php, referer: http://x.x.x.x/wsvn/listing.php?repname=DEV
[Sat Oct 02 02:03:03 2010] [notice] caught SIGTERM, shutting down
[Sat Oct 02 02:03:03 2010] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Sat Oct 02 02:03:03 2010] [notice] Digest: generating secret for digest authentication ...
[Sat Oct 02 02:03:03 2010] [notice] Digest: done
[Sat Oct 02 02:03:04 2010] [notice] Apache/2.2.3 (CentOS) configured -- resuming normal operations
[Sat Oct 02 02:03:06 2010] [error] [client x.x.x.x] Error running this command: svn --non-interactive --config-dir /tmp log --xml --verbose -r HEAD:1 &apos;file:////var/www/wsvn/WEB/@HEAD&apos; --limit 2, referer: http://x.x.x.x/wsvn/listing.php?repname=DEV
[Sat Oct 02 02:03:06 2010] [error] [client x.x.x.x] svn: No such revision 1, referer: http://x.x.x.x/wsvn/listing.php?repname=DEV
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2010-10-22 01:13:37

这是SVN中的一个错误。如果您有authz文件,则不能访问根目录并查看存储库列表。

这是真的,至少如果你像我一样在"/“中有SVNRoot。

票数 1
EN

Stack Overflow用户

发布于 2011-01-26 10:10:44

看起来你是想在同一个地方同时提供svn和websvn服务。这就是为什么,当你注释掉其中一个指令时,你会得到一些结果。

将Subversion配置中的路径更改为与websvn使用的路径不同的路径,因此:

代码语言:javascript
复制
Alias /websvn /var/www/websvn/
<Directory /var/www/websvn>
    Options Indexes FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>

# Subversion configuration 
<location /svn>
    DAV svn
    SVNListParentPath on
    SVNParentPath /var/www/svnrepopath
    AuthzSVNAccessFile /etc/svn-acl-conf
    AuthType Basic
    AuthUserFile /etc/svn-auth-conf
    Require valid-user
</Location>

http://www.duchnik.com/tutorials/vc/installing-and-configuring-svn-on-centos

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/3838951

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档