Apache mod_proxy with tomcat and svn

2019-07-28 15:09发布

问题:

I have tomcat configured to take the root "/" of the webserver

<Location />
    ProxyPass http://localhost:8081/
    ProxyPassReverse http://localhost:8081/
</Location>

I am able to exclude certain path from proxying as follows:

<Location /robots.txt>
    ProxyPass !
</Location>

I want to exclude /svn path from routing to http://localhost:8081/. However the same approach doesn't work for /svn setup

<Location /svn>
    ProxyPass !

    DAV svn

    SVNParentPath /home/svn/repos
    SVNListParentPath On
    SVNMasterURI http://www.domain.com/svn

    AuthType Basic
    AuthBasicProvider file
    AuthName "Subversion server"

    # file setup
    AuthBasicAuthoritative  off
    AuthUserFile /home/svn/conf/svn_passwdfile

    # Limit write permission to list of valid users.
    AuthzSVNAccessFile /home/svn/conf/access

    Require valid-user
</Location>

In this case I get routed to tomcat app's 404 not found page. I have noticed that if I comment out the Require, and AuthType lines I get correct routing, but svn is not functional.

<Location /svn>
    ProxyPass !

    DAV svn

    SVNParentPath /home/svn/repos
    SVNListParentPath On
    SVNMasterURI http://www.domain.com/svn

    #AuthType Basic
    AuthBasicProvider file
    AuthName "Subversion server"

    # file setup
    AuthBasicAuthoritative  off
    AuthUserFile /home/svn/conf/svn_passwdfile

    # Limit write permission to list of valid users.
    AuthzSVNAccessFile /home/svn/conf/access

    #Require valid-user
</Location>

My guess is that if I include Auth* Directives the load order gets messed up. Any help is welcome.