WEBDAV Archives - Justin Silver https://www.justinsilver.com/tag/webdav/ Technology, Travel, and Pictures Thu, 27 Feb 2014 00:18:12 +0000 en-US hourly 1 https://wordpress.org/?v=6.0.1 https://www.justinsilver.com/wp-content/uploads/2013/06/cropped-apple-touch-icon-160x160.png WEBDAV Archives - Justin Silver https://www.justinsilver.com/tag/webdav/ 32 32 SVN COPY 502 Bad Gateway Error https://www.justinsilver.com/technology/svn-copy-502-bad-gateway-error/?utm_source=rss&utm_medium=rss&utm_campaign=svn-copy-502-bad-gateway-error https://www.justinsilver.com/technology/svn-copy-502-bad-gateway-error/#respond Fri, 02 Nov 2012 19:01:06 +0000 http://justin.ag/?p=2700 There is a lot of info to be found on the Internet about the “502 Bad Gateway Error” when trying trying to move a directory or files when your repository is hosted on Apache...

The post SVN COPY 502 Bad Gateway Error appeared first on Justin Silver.

]]>
AmpedSense.OptimizeAdSpot('AP'); AmpedSense.OptimizeAdSpot('IL'); AmpedSense.OptimizeAdSpot('IR');

There is a lot of info to be found on the Internet about the “502 Bad Gateway Error” when trying trying to move a directory or files when your repository is hosted on Apache using SSL and WEBDAV. In a nutshell Apache is confused by the COPY command and things you are trying to make a move between HTTP and HTTPS, or in other words, a different host. You can read up on the problem here: http://www.science.uva.nl/research/air/wiki/Subversion502BadGateway

The problem that I ran into was with my HTTP server on the same host. Why do I need an HTTP server you may ask? Well, mainly to redirect requests from http://svn.example.com to https://svn.example.com. Most of the documentation I was able to find on this suggested simply adding a line to the VirtualHost to update the header, like so:

RequestHeader edit Destination ^https http early

In my case, this just wasn’t working. What did fix it is a bit counter-intuitive – I had to enable the SSLEngine on my HTTP VirtualHost, as well as my HTTPS VirtualHost. My configuration now looks like the following, and I am able to move files again.

SSLCertificateFile /etc/httpd/ssl/self-signed.crt
SSLCertificateKeyFile /etc/httpd/ssl/self-signed.key

<VirtualHost *:80>
        ServerName svn.example.com
        RequestHeader edit Destination ^https http early

        # Turn mod_ssl on even though we are on 80
        SSLEngine on

        # Rewrite HTTP to HTTPS
        RewriteEngine On
        RewriteCond %{HTTPS} off
        RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
</VirtualHost>

<VirtualHost *:443>
        ServerName svn.example.com

        # Turn mod_ssl on
        SSLEngine on

        <Location "/">
                DAV svn
                SVNPath /var/svn/repository
                AuthzSVNAccessFile /var/svn/repository/conf/authz

                AuthType Basic
                AuthName "example.com"
                AuthUserFile /var/svn/.htauthfile
                Require valid-user
        </Location>
</VirtualHost>

The post SVN COPY 502 Bad Gateway Error appeared first on Justin Silver.

]]>
https://www.justinsilver.com/technology/svn-copy-502-bad-gateway-error/feed/ 0