Issue #323 resolved

SVN checkout with apache2 ReverseProxy fails

Gerald Schneider
created an issue

I'm trying to move all our code repositories from manual management to SCM-Manager. In this process I'm trying not to break the repository URLs, so after importing the existing repositories I configured the existing apache as a reverse proxy in front of scm-manager. SCM-Manager is reachable under the URL http://projects.igd.fraunhofer.de:9080/scm/ and the checkout works without problems when I access the repositories with this URL:

http://projects.igd.fraunhofer.de:9080/scm/svn/BasicEngine

In order to keep the old URLs I configured apache2 like this:

ProxyRequests         Off
ProxyPreserveHost     On
ProxyPass             / http://projects.igd.fraunhofer.de:9080/scm/
ProxyPassReverse      / http://projects.igd.fraunhofer.de:9080/scm/
ProxyPassReverseCookiePath / http://projects.igd.fraunhofer.de:9080/scm/

Now I can access the SCM-Manager with this URL: https://scm.igd.fraunhofer.de This works fine, after I configured the same URL as Base URL in SCM-Manager.

What does not work is checking out code over this URL:

geschnei@gut:/tmp$ svn checkout https://scm.igd.fraunhofer.de/svn/BasicEngine/
Authentication realm: <https://scm.igd.fraunhofer.de:443> SONIA :: SCM Manager
Password for 'geschnei':
svn: Server sent unexpected return value (501 Method PROPFIND is not defined in RFC 2068 and is not supported by the Servlet API ) in response to PROPFIND request for '/scm/svn/BasicEngine/!svn/vcc/default'

At first I looked into the 501 error, but then I noticed there is a superfluous /scm in the PROPFIND request. When I browse the repository with a web browser it is there as well (compare the url in the address bar and in the status bar, the mouse was hovering over the link). When I click on the link and remove the /scm manually it works.

I suppose this /scm is somewhere hard coded to be added to the url.

Comments (10)

  1. Sebastian Sdorra repo owner
    • changed status to open

    Hi, The /scm is not hardcoded, but svnkit-dav uses the context path of the webapplication to create urls for the svn xml messages. The simplest way to fix this is to change the context path of the scm-server. Do you use the standalone (scm-server) version?

  2. Gerald Schneider reporter

    So, I changed the config according to the post in google groups and restarted the service. The result is nearly the same. Now I get 404 errors for every path and it still tries to use /scm/

    URL in the Browser: http://server/

    HTTP ERROR 404
    
    Problem accessing /scm/. Reason:
    
        Not Found
    

    The same goes for repositories. SCM-Manager always prepends /scm to the path.

    My modified config section;

      <New id="scm-webapp" class="org.eclipse.jetty.webapp.WebAppContext">
        <Set name="contextPath">/</Set>
        <Set name="war"><SystemProperty name="basedir" default="."/>/var/webapp/scm-webapp.war</Set>
      </New>
    
    <!--  <New id="docroot" class="org.eclipse.jetty.webapp.WebAppContext">
        <Set name="contextPath">/</Set>
        <Set name="baseResource">
          <New class="org.eclipse.jetty.util.resource.ResourceCollection">
            <Arg>
              <Array type="java.lang.String">
                <Item><SystemProperty name="basedir" default="."/>/var/webapp/docroot</Item>
              </Array>
            </Arg>
          </New>
        </Set>
      </New> -->
    
      <Set name="handler">
        <New class="org.eclipse.jetty.server.handler.HandlerCollection">
          <Set name="handlers">
            <Array type="org.eclipse.jetty.server.Handler">
              <Item>
                <Ref id="scm-webapp" />
              </Item>
    <!--          <Item>
                <Ref id="docroot" />
              </Item>-->
              <!--
              <Item>
                <New id="RequestLog" class="org.eclipse.jetty.server.handler.RequestLogHandler"/>
              </Item>
              -->
            </Array>
          </Set>
        </New>
      </Set>
    
  3. Gerald Schneider reporter

    Well, I actually forgot to change ProxyPass and ProxyReverse (it hit me the moment you asked about the access via jetty port).

    It works now, thanks for your help.

  4. Log in to comment