# subversion config problem.

## thecooptoo

Im trying to get  subversion /webDAV to work . Ive disabled any authentication until it actually will work . Its a pths/confgi problem , but  cant se how to change it. 

I think the error messages is that its trying to upload to  /svn/test when it should be /svn/repos/test. 

Ive tried adding trailing slashes to the paths , which didnt work 

```
# emerge -pv apache subversion

These are the packages that would be merged, in order:

Calculating dependencies... done!

[ebuild   R   ] www-servers/apache-2.2.8-r3  USE="doc ssl -debug -ldap (-selinux) -sni -static -suexec -threads" APACHE2_MODULES="actions alias asis auth_basic auth_digest authz_default authz_host autoindex cache dav dav_lock dir env expires headers include info log_config logio mime negotiation proxy rewrite setenvif speling status userdir usertrack -authn_alias -authn_anon -authn_dbd -authn_dbm -authn_default -authn_file -authz_dbm -authz_groupfile -authz_owner -authz_user -cern_meta -charset_lite -dav_fs -dbd -deflate -disk_cache -dumpio -ext_filter -file_cache -filter -ident -imagemap -log_forensic -mem_cache -mime_magic -proxy_ajp -proxy_balancer -proxy_connect -proxy_ftp -proxy_http -substitute -unique_id -version -vhost_alias" APACHE2_MPMS="prefork -event -itk -peruser -worker" 0 kB

[ebuild   R   ] dev-util/subversion-1.4.6  USE="apache2 berkdb doc nls perl python -bash-completion -debug -emacs -extras -java -nowebdav -ruby -svnserve -vim-syntax" 0 kB

```

```
# grep ^[A-Za-z\ ] /etc/conf.d/apache2

APACHE2_OPTS="-D DEFAULT_VHOST -D INFO -D LANGUAGE -D MANUAL -D PHP5 -D PHP -D DAV -D DAV_FS -D SSL"

```

```
grenada modules.d # cat  /etc/apache2/modules.d/47_mod_dav_svn.conf  |grep -v '#'

<IfDefine SVN>

        <IfModule !mod_dav_svn.c>

                LoadModule dav_svn_module       modules/mod_dav_svn.so

        </IfModule>

        <IfDefine SVN_AUTHZ>

                <IfModule !mod_authz_svn.c>

                        LoadModule authz_svn_module     modules/mod_authz_svn.so

                </IfModule>

        </IfDefine>

<Location /svn>

DAV svn

SVNParentPath /var/svn/repos

</Location>

        <Location /svn/repos/test/>

                DAV svn

                SVNPath /var/svn/repos/test

        </Location>

</IfDefine>

#    
```

when i try and upload something I get 

```
# svn  import /home/paul/test.odt http://xxx.org/svn/test/ -m 'test'

svn: PROPFIND request failed on '/svn/test'

svn: PROPFIND of '/svn/test': 405 Method Not Allowed (http://xxx.org)

 #         

      
```

----------

## geforce

Apache need full read/write permisions on that directory, check the permissions

If it doesn't work / it's not the problem, can you show us the apache's error log related to this error ?

----------

## thecooptoo

```
 # ls -la /var/svn/repos  |grep test

drwxr-xr-x 7 apache svnusers 4096 Jun 21 17:07 test

grenada repos # ls -la /var/svn/repos/test/

total 36

drwxr-xr-x 7 apache svnusers 4096 Jun 21 17:07 .

drwxrwxrwx 5 apache svnusers 4096 Jun 21 17:07 ..

-rw-r--r-- 1 apache svnusers  229 Jun 21 17:07 README.txt

drwxr-xr-x 2 apache svnusers 4096 Jun 21 17:07 conf

drwxr-xr-x 2 apache svnusers 4096 Jun 21 17:07 dav

drwxr-sr-x 5 apache svnusers 4096 Jun 21 17:07 db

-r--r--r-- 1 apache svnusers    2 Jun 21 17:07 format

drwxr-xr-x 2 apache svnusers 4096 Jun 21 17:07 hooks

drwxr-xr-x 2 apache svnusers 4096 Jun 21 17:07 locks

grenada repos #                                    

# 
```

if i turn on directory listings in /var/www/my.vhost/htdocs/svn , i get a listing of repos and conf , so apache has access to the directory 

```
grenada repos # tail  /var/log/apache2/access_log |grep PROP

192.168.0.201 - - [21/Jun/2008:17:21:10 +0100] "PROPFIND /svn/test HTTP/1.1" 405 300

grenada repos #   
```

----------

## thecooptoo

i followeed the howtos and the examples , which have changed 47_mod_dav_svn.conf and have ( so far ) left 45_mod_dav.conf 

```
grenada repos # ls -la /etc/apache2/modules.d/ |grep dav

-rw-r--r-- 1 root root 1567 Jun 21 11:24 45_mod_dav.conf

-rw-r--r-- 1 root root  651 Jun 21 12:41 47_mod_dav_svn.conf
```

ive done this 

```

./test:

total 28

-rwxrwxrwx 1 apache svnusers  229 Jun 21 17:07 README.txt

drwxrwxrwx 2 apache svnusers 4096 Jun 21 17:07 conf

drwxrwxrwx 2 apache svnusers 4096 Jun 21 17:07 dav

drwxrwsrwx 5 apache svnusers 4096 Jun 21 17:07 db

-rwxrwxrwx 1 apache svnusers    2 Jun 21 17:07 format

drwxrwxrwx 2 apache svnusers 4096 Jun 21 17:07 hooks

drwxrwxrwx 2 apache svnusers 4096 Jun 21 17:07 locks

./test/conf:

total 12

-rwxrwxrwx 1 apache svnusers  684 Jun 21 17:07 authz

-rwxrwxrwx 1 apache svnusers  309 Jun 21 17:07 passwd

-rwxrwxrwx 1 apache svnusers 1457 Jun 21 17:07 svnserve.conf

./test/dav:

total 0

./test/db:

total 28

-rwxrwxrwx 1 apache svnusers    6 Jun 21 17:07 current

-rwxrwxrwx 1 apache svnusers    2 Jun 21 17:07 format

-rwxrwxrwx 1 apache svnusers    5 Jun 21 17:07 fs-type

drwxrwsrwx 2 apache svnusers 4096 Jun 21 17:07 revprops

drwxrwsrwx 2 apache svnusers 4096 Jun 21 17:07 revs

drwxrwsrwx 2 apache svnusers 4096 Jun 21 17:07 transactions

-rwxrwxrwx 1 apache svnusers   37 Jun 21 17:07 uuid

-rwxrwxrwx 1 apache svnusers    0 Jun 21 17:07 write-lock

./test/db/revprops:

total 4

-rwxrwxrwx 1 apache svnusers 50 Jun 21 17:07 0

./test/db/revs:

total 4

-rwxrwxrwx 1 apache svnusers 115 Jun 21 17:07 0

./test/db/transactions:

total 0

./test/hooks:

total 36

-rwxrwxrwx 1 apache svnusers 2015 Jun 21 17:07 post-commit.tmpl

-rwxrwxrwx 1 apache svnusers 1638 Jun 21 17:07 post-lock.tmpl

-rwxrwxrwx 1 apache svnusers 2255 Jun 21 17:07 post-revprop-change.tmpl

-rwxrwxrwx 1 apache svnusers 1567 Jun 21 17:07 post-unlock.tmpl

-rwxrwxrwx 1 apache svnusers 2934 Jun 21 17:07 pre-commit.tmpl

-rwxrwxrwx 1 apache svnusers 2038 Jun 21 17:07 pre-lock.tmpl

-rwxrwxrwx 1 apache svnusers 2764 Jun 21 17:07 pre-revprop-change.tmpl

-rwxrwxrwx 1 apache svnusers 1979 Jun 21 17:07 pre-unlock.tmpl

-rwxrwxrwx 1 apache svnusers 2137 Jun 21 17:07 start-commit.tmpl

./test/locks:

total 8

-rwxrwxrwx 1 apache svnusers 139 Jun 21 17:07 db-logs.lock

-rwxrwxrwx 1 apache svnusers 139 Jun 21 17:07 db.lock

grenada repos #                                
```

and still get the same error 

```
# svn  import /home/paul/test.doc http://xxx.org/svn/test/  -m 'test'

svn: PROPFIND request failed on '/svn/test'

svn: PROPFIND of '/svn/test': 405 Method Not Allowed (http://xxx.org)
```

its a paths problem  - the repository is /var/www/vhost/htdocs/svn/test

and the error is coming from /svn/test ( should be /svn/repos/test i think)

----------

## geforce

probably  from the Location block ?

----------

## thecooptoo

Ive tried  copying 

http://svnbook.red-bean.com/nightly/en/svn.serverconfig.httpd.html#svn.serverconfig.httpd.basic

and still get the same 301 error

FWIW 

http://server/repos

http://server/svn/repos

http://server/svn

all generate file not found errors in the browser.

----------

## thecooptoo

got some of this fixed now.  ( it doesnt ask for authentication yet , though ) 

The setup was 

svnadmin create /var/svn/repos/documents

The Location directive is relative to the SVNParentPath.

the url for eg rapidsvn  to import/checkout is  http://server.com/svn/document

```
 # cat /etc/apache2/modules.d/47_mod_dav_svn.conf | grep -v '#'

<IfDefine SVN>

 <IfModule !mod_dav_svn.c>

   LoadModule dav_svn_module    modules/mod_dav_svn.so

 </IfModule>

 <IfDefine SVN_AUTHZ>

   <IfModule !mod_authz_svn.c>

        LoadModule authz_svn_module     modules/mod_authz_svn.so

   </IfModule>

 </IfDefine>

<Location /svn>

DAV svn

SVNParentPath /var/svn/repos

</Location>

<Location /documents>

DAV svn

AuthType Basic

AuthName "Subversion repository"

AuthUserFile /var/svn/conf/svnusers

Require valid-user

</location>

```

----------

## geforce

I beleive "AuthType Basic" is for htpasswd-like files

----------

## thecooptoo

the authentication  works if the authentication is in the /svn location but not if ifs in /documents

WTF

it works if it is here 

```

<Location /svn>

DAV svn

SVNParentPath /var/svn/repos

AuthType Basic

  AuthName "Subversion repository"

AuthUserFile /var/svn/conf/svnusers

  Require valid-user

</Location>
```

but doesnt work ( ive got direct access) if it is here 

```

        # example configuration:

<Location /documents>

SVNParentPath /var/svn/repos

DAV svn

AuthType Basic

AuthName "Subversion repository"

AuthUserFile /var/svn/conf/svnusers

Require valid-user

</location>
```

----------

## PaulBain

I like to keep SVN configuration to my vhost config file:

```

<VirtualHost *:80>

        ServerName myexample.org

        ServerAlias *.myexample.org

        DocumentRoot  /var/www/vhosts/myexample.org/htdocs/

         <Directory />

                AllowOverride all

                Options +FollowSymLinks +ExecCGI

        </Directory>

        <Location /svn>

                DAV svn

                SVNPath /var/www/vhosts/myexample.org/svn/repo

                Options FollowSymLinks +ExecCGI

                AuthType Basic

                AuthName "TEST Development"

                AuthUserFile /var/www/vhosts/myexample.org/svn/dev.pass

                Require valid-user

        </Location>

</VirtualHost>

```

----------

## PaulBain

 *thecooptoo wrote:*   

> 
> 
>         # example configuration:
> 
> <Location /documents>
> ...

 

Also just noitced, you have a lowercase 'L' on the '</location>' part. Could well be it too!

----------

