phil has a blog - Solution: Subversion commit failed '502 Bad Gateway' after COPY or MOVE using SSL

Solution: Subversion commit failed '502 Bad Gateway' after COPY or MOVE using SSL

1. Install mod perl (if not already installed)

2. Save the following as ProxyDav.pm, move the file to /usr/lib/perl5 and chown to root
(or any directory that Perl looks for modules, perl -V)

package ProxyDav;

use strict;

use APR::URI ();
use APR::Table ();
use Apache2::RequestRec ();

use Apache2::Const -compile => qw(OK);

sub handler {
  my $r = shift;

  my $method = $r->method();
  if ($method eq 'MOVE' || $method eq 'COPY') {
    my $destination = $r->headers_in()->get('Destination');
    if (defined($destination)) {
      my $new_destination = APR::URI->parse($r->pool, $destination);
      $new_destination->scheme('http');
      $r->headers_in()->set('Destination', $new_destination->unparse());
    }
  }
  return Apache2::Const::OK;
}

1;

__END__

2. Add these two lines to the site conf, where svn is accessed in my case /svn. This will get perl to examine the headers for MOVE or COPY requests and change the scheme to http

<Location /svn>
  SetHandler               perl-script
  PerlHeaderParserHandler  ProxyDav
	
  # ... 

</Location>

3. Now reload apache and you should be able to copy and move without any problems.


All credit goes to Seth Daniel