1

Dear Stackoverflow Community! Recently my svn server broke, and I tried nearly everything but I can't get it to work again.

OS: Raspbian

What I did: installing packages:

apt-get install subversion libapache2-svn apache2 mysql-server

Enabeling dav_svn: a2enmod dav_svn

Creating repositories:

$ mkdir -p /opt/svn/project1
$ mkdir -p /opt/svn/project2

Adding them:

$ svnadmin create --fs-type fsfs /opt/svn/project1
$ svnadmin create --fs-type fsfs /opt/svn/project2`

Setting the owner:

$ chown -R www-data:www-data /opt/svn

Created users:

$ sudo htpasswd /etc/apache2/dav_svn.passwd weini

Created repository files:

mkdir -p /tmp/projet1/trunk
mkdir -p /tmp/projet1/branches
mkdir -p /tmp/projet1/tags
mkdir -p /tmp/projet2/trunk
mkdir -p /tmp/projet2/branches
mkdir -p /tmp/projet2/tags

Created /etc/apache2/mods-enabled/dav_svn.conf file:

<Location /svn/>
        DAV svn
        SVNParentPath /opt/svn/
        SVNListParentPath On
        AuthType Basic
        AuthName "Subversion Repository"
        AuthUserFile /etc/apache2/dav_svn.passwd
        Require valid-user
</Location>

Imported them: Note accessing the repository via http:// does not work; via file:// works

Error: svn import /tmp/project1 http://localhost/svn/project1 -m "initialer Import" 
Error: svn import /tmp/project2 http://localhost/svn/project2 -m "initialer Import" 
Works: svn import /tmp/project1 file://opt/svn/project1 -m "initialer Import" 
Works: svn import /tmp/project2 file://opt/svn/project2 -m "initialer Import"`

Everything else are default settings!

Errormessage:

RA layer request failed
svn: Unable to connect to a repository at URL 'http://server.weini.at/svn/project1'
svn: Server sent unexpected return value (405 Method Not Allowed)  in response to OPTIONS request for 'http://server.weini.at/svn/project1

Syslog:

no errors

Apache2/error.log:

[Wed Apr 09 22:29:29 2014] [error] [client 192.168.0.1] Could not fetch resource  information.  [-2, #0]
[Wed Apr 09 22:29:29 2014] [error] [client 192.168.0.1] (2)No such file or directory:   The URI does not contain the name of a repository.  [405, #190001]

When i try to access the repositories via my webbrowser everything works normal: https://i.stack.imgur.com/aNKzw.png

David W.
  • 105,218
  • 39
  • 216
  • 337
weini37
  • 1,455
  • 3
  • 10
  • 9

2 Answers2

6

Try to comment out this line:

SVNListParentPath On

-->

#SVNListParentPath On

(switching to off should also work).

And restart your apache.

There seems to be an issue with ParentPath since the last apache upgrades.

Thanks to this (german) post: http://forum.ubuntuusers.de/topic/problem-mit-svn-server-nach-apache-update/#post-6513997

The problem is, after this setup, the listing of your parent path in browser is not possible... . So for me this is not a final solution.

Cheers, markus

ynnok
  • 236
  • 3
  • 5
0

A few things I noticed:

Creating repositories:

$ mkdir -p /opt/svn/project1
$ mkdir -p /opt/svn/project2

Adding them:

$ svnadmin create --fs-type fsfs /opt/svn/project1
$ svnadmin create --fs-type fsfs /opt/svn/project2

Your repo directories are created when you create the repo:

$ mkdir -p /opt/svn
$ svnadmin create --fs-type fsfs /opt/svn/project1
$ svnadmin create --fs-type fsfs /opt/svn/project2

You also had this:

Created repository files:

mkdir -p /tmp/projet1/trunk
mkdir -p /tmp/projet1/branches
mkdir -p /tmp/projet1/tags
mkdir -p /tmp/projet2/trunk
mkdir -p /tmp/projet2/branches
mkdir -p /tmp/projet2/tags

You're suppose to use svn mkdir to make these directories. You're just creating a bunch of directories that have nothing to do with your project:

$ svn co http://localhost/svn/project1
$ cd project1
$ svn mkdir trunk branches tags
$ svn commit

Or...

$ REPO=http://localhost/svn/project2
$ svn mkdir $REPO/trunk $REPO/branches $REPO/tags

The fact that file:// works and http:// means you have problems with Apache. Did you restart Apache once you changed the configuration?

$ /etc/init.d/httpd graceful   # Restarts gracefully...
David W.
  • 105,218
  • 39
  • 216
  • 337
  • Thanks for the infos but it still get the 405 error. Thats what i did after the restart: http://pastebin.com/yMw8czwE – weini37 Apr 10 '14 at 15:30
  • One more thing: Looking at my httpd configuration, you may need to remove that final slash from `SVNParentPath /opt/svn/` to make it `SVNParentPath /opt/svn`. Restart Apache, and see if that does it. Otherwise, something is going on with the Subversion DAV setup. – David W. Apr 10 '14 at 16:05
  • Hmmm I removed the / from `SVNParentPath /opt/svn/` and restarted the apache2 server `service apache2 restart`. I tried to check out my project with `svn co http://localhost/svn/project1` and i still get the same error as on my first post. – weini37 Apr 11 '14 at 16:54
  • Also what to mention is that this is a complete clean version of the raspdebian, which means I just have the apache2 server and the svn package running. – weini37 Apr 11 '14 at 16:55
  • It's hard to analyze the situation from a distance. These are native packages which means they were all compiled together. so svn should work. Everything you stated looks right. You don't have `AuthzSVNAccessFile` defined, but I don't believe that's needed. Can you use `svnserve`. You can do multiple repos with `svnserve` by starting `svnserve` in the parent directory of the repos. However, you need to make sure port 3690 open and unblocked. – David W. Apr 11 '14 at 18:18
  • So, `SVNListParentPath` doesn't work in the latest versions of Apache? As I said, it looked like you had everything setup correctly. I had SVNListParentPath in ours, but I guess it isn't the latest Apache version. – David W. Apr 13 '14 at 00:39