svn - VisualSVN Server 的缩短 URL 会破坏浏览器对存储库的访问

标签 svn httpd.conf visualsvn-server

我最近安装了 VisualSVN 服务器。而不是让服务器可以访问:

http://server/svn/repo/

我想把它放在一个更好的 URL 上:

http://server/repo/

为了实现此目的,我将 C:\Program Files (x86)\VisualSVN Server\conf\httpd.conf 中的位置参数更改为:

<Location /svn/>

改为阅读:

<Location />

使用 TortoiseSVN 访问存储库时效果很好,但使用浏览器查看存储库现在无法正常工作。网页验证正常,但浏览器只得到一个空页面。

尝试 Web 浏览时,Windows Server 事件查看器显示此错误:

Failed to load the AuthzVisualSVNReposRelativeAccessFile:
Can't open file 'D:\\Repositories\\svnindex.xsl\\conf\\VisualSVN-WinAuthz.ini':
The system cannot find the path specified.

这似乎与服务器在 D:\Repositories\而不是在 C:\Program Files (x86)\VisualSVN Server\htdocs\中查找身份验证文件有关。

有没有办法让浏览器访问缩短的 URL 和存储库?

如果有帮助,这里是 httpd.conf 文件:

ThreadsPerChild 128
MaxMemFree 64
MaxRequestsPerChild  0
MaxKeepAliveRequests 2000
KeepAliveTimeout 5
Win32DisableAcceptEx
LimitXMLRequestBody 0
LimitRequestFieldSize 16384
SendBufferSize 131072

ServerRoot "C:/Program Files (x86)/VisualSVN Server"
ServerName "server.domain.local:80"
ServerSignature Off
ServerTokens Prod
DocumentRoot "htdocs"
FileETag MTime Size

PidFile "${TEMP}\VisualSVNServer.pid"

Listen "192.168.0.11:80"

LoadModule auth_basic_module bin/mod_auth_basic.so
LoadModule authn_file_module bin/mod_authn_file.so
LoadModule authn_visualsvn_module bin/mod_authn_visualsvn.so
LoadModule authz_visualsvn_module bin/mod_authz_visualsvn.so
LoadModule alias_module bin/mod_alias.so
LoadModule dir_module bin/mod_dir.so
LoadModule mime_module bin/mod_mime.so
LoadModule setenvif_module bin/mod_setenvif.so
LoadModule rewrite_module bin/mod_rewrite.so
LoadModule expires_module bin/mod_expires.so

LoadModule dav_module bin/mod_dav.so
LoadModule dav_svn_module bin/mod_dav_svn.so
    # LoadModule ssl_module bin/mod_ssl.so

<Directory />
  Options FollowSymLinks
  AllowOverride None

  RewriteEngine on
  RewriteCond %{REQUEST_URI} ^/svn$
  RewriteCond %{HTTP_USER_AGENT} !^SVN/
  RewriteRule ^(.*/svn)$ %0/ [R=301,L]
</Directory>

SVNInMemoryCacheSize 16384

<Location />
  DAV svn

  SVNListParentPath on
  SVNParentPath "D:/Repositories/"
  SVNIndexXSLT "/svnindex.xsl"

  SVNPathAuthz short_circuit

  SVNCacheTextDeltas off
  SVNCacheFullTexts off

  SVNAllowBulkUpdates prefer

  AuthName "VisualSVN Server"
  AuthType VisualSVN
  AuthzVisualSVNReposRelativeAccessFile "VisualSVN-WinAuthz.ini"
  AuthzVisualSVNGlobalAccessFile "D:/Repositories/VisualSVN-GlobalWinAuthz.ini"
  AuthnVisualSVNBasic on
  AuthnVisualSVNIntegrated off
  AuthnVisualSVNUPN On

  require valid-user

  # Add Expires/Cache-Control header explictly
  ExpiresActive on
  ExpiresDefault access
</Location>

BrowserMatch "(\s|^)neon/\d+.\d+.\d+(\s|$)" AuthnVisualSVNIgnoreReauth
BrowserMatch "(\s|^)neon/\d+.\d+.\d+(\s|$)" AuthnVisualSVNDisableNegotiate

Alias /web-ui-static htdocs/web-ui-static

<IfModule dir_module>
    DirectoryIndex index.html
</IfModule>

ErrorLog nul

LogLevel error

TraceEnable off

DefaultType text/plain

<IfModule mime_module>
    TypesConfig conf/mime.types
    AddType application/x-compress .Z
    AddType application/x-gzip .gz .tgz
    AddType application/x-x509-ca-cert .crt
    AddType application/x-pkcs7-crl    .crl
</IfModule>

<IfModule ssl_module>
SSLEngine on

SSLRandomSeed startup   builtin
SSLRandomSeed connect   builtin
SSLPassPhraseDialog     builtin
SSLSessionCache         "shm:D:/Repositories/ssl_scache"
SSLSessionCacheTimeout  300
SSLMutex                default
SSLCertificateFile      certs/server.pem
SSLCertificateKeyFile   certs/server.pem
SSLProtocol             -ALL +SSLv3 +TLSv1
SSLCipherSuite          ALL:!aNULL:!ADH:!eNULL:!LOW:!EXP:RC4+RSA:+HIGH:+MEDIUM

SetEnvIf User-Agent ".*MSIE.*" ssl-unclean-shutdown

</IfModule>

Include conf/httpd-custom.conf

最佳答案

从 VisualSVN Server 3.5 开始 it is possible to customize the repository URL prefix 。换句话说,现在您只需点击几下即可将存储库 URL 从 http://server/svn/repo/ 更改为 http://server/repo/

要自定义 URL 前缀,请按照下列步骤操作:

  1. 启动VisualSVN 服务器管理器
  2. 转到操作 |属性
  3. 选择网络标签。
  4. 在存储库 URL 下选择自定义:

您可以选择“空 URL 前缀”选项来完全删除“/svn”前缀,或者选择“自定义 URL 前缀”并指定您要在 URL 中使用的前缀(例如“repos”)。

关于svn - VisualSVN Server 的缩短 URL 会破坏浏览器对存储库的访问,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24648655/

相关文章:

asp.net - 在 Subversion 中存储 ASP.NET 网站的最佳实践?

svn - 在版本控制中开发和使用通用库的最佳实践?

linux - 为什么我用 putty 无法连接 eth0?

linux - 在 AWS 上托管多个网站 - Amazon Linux EC2

windows - 安装服务器(在 Windows 上)和客户端工具(在 Windows、Linux 和 Apple 上)以进行版本控制

svn - 将 svn 仓库添加到现有的 git 仓库?

python - 如何在Python中使用pyfig模块?

apache - 如何在 apache httpd.conf 中添加注释而不是完整的行?

SVN 提交未完成

version-control - 文件名中的 TortoiseSVN/VisualSVN 服务器版本号