VisualSVN服务器的缩短URL会破坏对存储库的浏览器访问

时间:2022-01-08 13:47:49

I recently setup VisualSVN Server. Rather than have the server accessible at:

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

http://server/svn/repo/

I wanted to have it at a nicer URL:

我想要一个更好的URL:

http://server/repo/

To achieve this, I changed the Location parameter in C:\Program Files (x86)\VisualSVN Server\conf\httpd.conf from:

为了达到这个目标,我改变了位置参数在C:\Program Files (x86)\VisualSVN服务器\ conf \ httpd。配置:

<Location /svn/>

to instead read:

而不是读:

<Location />

This works fine when using TortoiseSVN to access the repo, but viewing the repo with a browser is now broken. The webpage authenticates fine, but the browser only gets an empty page.

这在使用龟甲esvn访问repo时工作得很好,但是使用浏览器查看repo现在被破坏了。网页认证良好,但浏览器只有一个空页面。

Windows Server event viewer shows this error when web browsing is attempted:

当尝试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.

This seems to have something to do with the server looking in D:\Repositories\ rather than in C:\Program Files (x86)\VisualSVN Server\htdocs\ for authentication files.

这似乎与服务器在D:\ \存储库,而不是在服务器\根\ C:\Program Files (x86)\VisualSVN认证文件。

Is there a way to have both the shortened URL and the repo accessible by browser?

有没有一种方法可以让缩短的URL和repo同时被浏览器访问?

If it helps, here is the httpd.conf file:

如果有用,这里是httpd。配置文件:

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

1 个解决方案

#1


1  

Beginning with VisualSVN Server 3.5 it is possible to customize the repository URL prefix. In other words, now you can change the repo URL from http://server/svn/repo/ to http://server/repo/ in a few clicks.

从VisualSVN Server 3.5开始,可以定制存储库URL前缀。换句话说,现在您可以通过单击将repo URL从http://server/svn/repo/更改为http://server/repo/。

In order to customize the URL prefix, follow these steps:

要定制URL前缀,请执行以下步骤:

  1. Start VisualSVN Server Manager.
  2. 启动VisualSVN服务器管理器。
  3. Go to Action | Properties.
  4. 转到动作|属性。
  5. Select Network tab.
  6. 选择网络选项卡。
  7. Select Customize under Repositories URL:
  8. 在储存库URL下选择定制:

You can select "Empty URL prefix" option to remove the "/svn" prefix completely or select "Custom URL prefix" and specify the prefix you'd like to use in the URL (for example, "repos").

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

#1


1  

Beginning with VisualSVN Server 3.5 it is possible to customize the repository URL prefix. In other words, now you can change the repo URL from http://server/svn/repo/ to http://server/repo/ in a few clicks.

从VisualSVN Server 3.5开始,可以定制存储库URL前缀。换句话说,现在您可以通过单击将repo URL从http://server/svn/repo/更改为http://server/repo/。

In order to customize the URL prefix, follow these steps:

要定制URL前缀,请执行以下步骤:

  1. Start VisualSVN Server Manager.
  2. 启动VisualSVN服务器管理器。
  3. Go to Action | Properties.
  4. 转到动作|属性。
  5. Select Network tab.
  6. 选择网络选项卡。
  7. Select Customize under Repositories URL:
  8. 在储存库URL下选择定制:

You can select "Empty URL prefix" option to remove the "/svn" prefix completely or select "Custom URL prefix" and specify the prefix you'd like to use in the URL (for example, "repos").

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