问题
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: http://i.stack.imgur.com/aNKzw.png
回答1:
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
回答2:
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...
来源:https://stackoverflow.com/questions/22973591/svn-405-error-could-not-fetch-resource-information