问题
I have installed svn, version 1.6.17 (r1128011) on to Ubuntu 12-04
I made my repo here:
$ sudo mkdir /home/2nd-disk/svn
Set up my /etc/apache2/mods-enabled/dav_svn.conf
<Location /svn>
DAV svn
SVNParentPath /home/2nd-disk/svn
AuthType Basic
AuthName "Subversion Repository"
AuthUserFile /etc/apache2/dav_svn.passwd
Require valid-user
</Location>
Created an account:
sudo htpasswd -cm /etc/apache2/dav_svn.passwd myusername
Created a test repo
$ cd /home/2nd-disk/svn
$ sudo svnadmin create test_repo
Ran a chown:
$ sudo chown -R www-data:www-data /home/2nd-disk/svn
Insured a2enmod & dav_svn are loaded and restarted apache2:
$ sudo a2enmod dav_svn && sudo service apache2 restart
Considering dependency dav for dav_svn:
Module dav already enabled
Module dav_svn already enabled
* Restarting web server apache2
... waiting
I then try to browse to http://mydomain.com/svn/test_repo and I get a 404 not found.
The same happens with http://mydomain.com/svn/test_repo
Going to http://mydomain.com shows the default 'It Works!' apache page.
Do I need to change virtual hosts here? I followed this tutorial below to the T and so assumed not:
http://rbgeek.wordpress.com/2012/05/01/svn-server-on-ubuntu-12-04-lts-with-web-access/
回答1:
add the reference to your vhost instead of dav_svn.conf:
<Location /svn>
DAV svn
SVNPath /var/local/svn
AuthType Basic
AuthName "Subversion repository"
AuthUserFile /etc/apache2/dav_svn.passwd
<LimitExcept GET PROPFIND OPTIONS REPORT>
Require valid-user
</LimitExcept>
</Location>
good tutorial is here: http://wiki.ubuntuusers.de/Subversion
don't forget to restart apache to apply changes:
sudo /etc/init.d/apache2 restart
回答2:
I have this problem sovled just now . prep. I set up my /etc/apache2/http.conf
LoadModule dav_module /usr/lib/apache2/mod_dav.so
LoadModule dav_svn_module /usr/lib/apache2/mod_dav_svn.so
LoadModule authz_svn_module /usr/lib/apache2/mod_authz_svn.so
It works for a period without 404 while I then try to browse to http://mydomain.com/svn/test_repo .But after I reboot my Linux, I get a 404 not found. Try to add the lines to /etc/apache2/conf.d.subversion.conf
LoadModule dav_module /usr/lib/apache2/mod_dav.so
LoadModule dav_svn_module /usr/lib/apache2/mod_dav_svn.so
LoadModule authz_svn_module /usr/lib/apache2/mod_authz_svn.so
My SVN works well now! I wish these recommendations can help you.
来源:https://stackoverflow.com/questions/17212363/svn-repo-gives-404-not-found