Reverse Proxy Server 2: SVN2

From The Uniform Server Wiki
Revision as of 14:29, 22 August 2009 by Ric (talk | contribs) (New page: {{Nav reverse proxy server}} '''''How to configure proxy server to run a subversion server over http''.''' On the previous I digressed a little and ended up creating a portable subversi...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

 

Uniform Server 5.0-Nano
Reverse Proxy.

How to configure proxy server to run a subversion server over http.

On the previous I digressed a little and ended up creating a portable subversion server. This page describes how to access that server behind a proxy server.

Methods

Subversion uses more methods than standard HTTP these must be passed to the back-end server for processing.

These methods would allow all clients to brows a repository: GET PROPFIND OPTIONS REPORT

To do any real work with a repository allow the following methods:
OPTIONS PROPFIND GET REPORT MKACTIVITY PROPPATCH PUT CHECKOUT MKCOL MOVE COPY DELETE LOCK UNLOCK MERGE

Basic Block Format

The only addition to proxy directives is a limit block as shown below:

ProxyPass /svn/ http://realsvnserver/svn/
<Location /svn/ >
  ProxyPassReverse /svn/
    <Limit OPTIONS PROPFIND GET REPORT MKACTIVITY PROPPATCH PUT CHECKOUT MKCOL MOVE COPY DELETE LOCK UNLOCK MERGE>
      Order Deny,Allow
      Allow from all
      Satisfy Any
    </Limit>
</Location>
  • The ProxyPass directive informs Apache to redirect requests for folder /svn to the subversion server http://realsvnserver/svn.
  • The Limit directive contains a list of DAV methods that Apache proxy should work with.
  • Allow from all: Informs Apache to let all DAV method requests from all clients through.
  • Satisfy Any: Let the subversion server handle authentication.

Note: Generally proxy and back-end server folder names can be different however for DAV folder names must be identical (that includes any sub-folders) this example uses folder svn

Top

Proxy Server Configuration

Edit C:\server_a\UniServer\usr\local\apache2\conf\httpd.conf

Add the above code just below the last proxy server as shown below, (Note: realsvnserver is localhost:83)

<VirtualHost *>
  ServerName localhost:80
  DocumentRoot C:/server_a1/UniServer/www

ProxyRequests off
<Proxy *>
  Order deny,allow
  Deny from all
  Allow from 127.0.0.1
</Proxy>

ProxyPass /info/ http://localhost:82/
ProxyHTMLURLMap http://localhost:82 /info
<Location /info/>
  ProxyPassReverse  http://localhost:82/
  #SetOutputFilter proxy-html
  SetOutputFilter DEFLATE;proxy-html;INFLATE
  ProxyHTMLURLMap /          /info/
  ProxyHTMLURLMap /info      /info
</Location>

ProxyPass /svn/ http://localhost:83/svn/
<Location /svn/ >
  ProxyPassReverse /svn/
   <Limit OPTIONS PROPFIND GET REPORT MKACTIVITY PROPPATCH PUT CHECKOUT MKCOL MOVE COPY DELETE LOCK UNLOCK MERGE>
     Order Deny,Allow
     Allow from all
     Satisfy Any
   </Limit>
</Location>

</VirtualHost>

Top

Test

To quickly check the configuration:

  • Start server_a
  • Start server_c
  • Type http://localhost/svn/

Result: Collection of Repositories page displayed, click the link myproject or whatever you named your repository and have a browse.

Use your SVN client, confirm you can checkout a working copy, make a few changes and confirm you can commit these to the repository.

Top

Summary

The above shows how to proxy an SVN server over http, there are no restrictions this allows all users access with the ability to manipulate repositories.

Before adding any restrictions the next page looks at proxying SVN over https.

This is a prerequisite to securing SVN. Proxy SVN over https

Top


Ric