You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Saulo Soares de Toledo <sa...@gmail.com> on 2010/05/10 19:44:47 UTC

Apache + SVN (+ LDAP) don't works

Hello all!

I've tried this at IRC rooms without results, then I'm here to try the list!
:)

I'm trying enable Apache + LDAP + SVN to enable my SVN server service. All
almost done, but with this config at Apache (I have this VH only to
subversion!):


   1. <VirtualHost *:8012>
   2.
   3.         ServerAdmin me@me.com
   4.         ServerName subversion.myserver
   5.
   6.         DocumentRoot /var/www/
   7.
   8.         ErrorLog /var/log/apache2/subversion.myserver-error_log
   9.         CustomLog /var/log/apache2/subversion.myserver-access_log
   combined
   10.
   11.
   12.         <Location /svn>
   13.                 DAV svn
   14.
   15.                 SVNParentPath /home/files/svn_root
   16.                 SVNListParentPath on
   17.
   18.                 ## Enable WebDAV automatic versioning
   19.                 SVNAutoversioning On
   20.
   21.                 ## Repository Display Name
   22.                 SVNReposName "Subversion Repository"
   23.
   24.                 AuthType Basic
   25.                 AuthName "(Subversion)"
   26.
   27.                 AuthLDAPURL
   ldap://localhost/ou=Users,dc=my,dc=server,dc=net?uid
   28.                 AuthLDAPBindDN cn=admin,dc=my,dc=server,dc=net
   29.                 AuthLDAPBindPassword myPassword
   30.
   31.                 AuthBasicProvider ldap
   32.                 AuthUserFile /dev/null
   33.
   34.                 Require valid-user
   35.
   36.         </Location>
   37.
   38.         <Directory "/home/files/svn_root">
   39.                 Order allow,deny
   40.                 Allow from all
   41.         </Directory>
   42.
   43. </VirtualHost>



<http://pastebin.com/e6cg1Yt2>When I connect from a SVN client I receive the
error "*Repository moved permanently to 'http:...'; please relocate*".

The best info I found is here:
http://subversion.apache.org/faq.html#http-301-error . With the content:

*"It means your httpd.conf is misconfigured. Usually this error happens when
you've defined the Subversion virtual "location" to exist within two
different scopes at the same time.*

*For example, if you've exported a repository as <Location /www/foo>, but
you've also set your DocumentRoot to be /www, then you're in trouble. When
the request comes in for /www/foo/bar, apache doesn't know whether to find a
**real file named /foo/bar within your DocumentRoot, or whether to ask
mod_dav_svn to fetch a file /bar from the /www/foo repository. Usually the
former case wins, and hence the "Moved Permanently" error.*

*The solution is to make sure your repository <Location> does not overlap or
live within any areas already exported as normal web shares.*

*It's also possible that you have an object in the web root which has the
same name as your repository URL. For example, imagine your web server's
document root is /var/www and your Subversion repository is located at
/home/svn/repo. You then configure Apache to serve the repository at
http://localhost/myrepo. If you then create the directory
/var/www/myrepo/this will cause a 301 error to occur."
*


But what's wrong with my config? I don't understood what is happening.
My Apache logs have this (debug mode actived):

[Fri May 07 18:14:19 2010] [error] [client 192.168.254.241] Could not fetch
resource information.  [301, #0]
[Fri May 07 18:14:19 2010] [error] [client 192.168.254.241] (2)No such file
or directory: Requests for a collection must have a trailing slash on the
URI.  [301, #0]
[Fri May 07 18:22:28 2010] [error] [client 192.168.254.241] Could not fetch
resource information.  [301, #0]
[Fri May 07 18:22:28 2010] [error] [client 192.168.254.241] Requests for a
collection must have a trailing slash on the URI.  [301, #0]
[Fri May 07 18:22:28 2010] [error] [client 192.168.254.241] Could not fetch
resource information.  [301, #0]
[Fri May 07 18:22:28 2010] [error] [client 192.168.254.241] (2)No such file
or directory: Requests for a collection must have a trailing slash on the
URI.  [301, #0]
[Fri May 07 18:26:14 2010] [error] [client 192.168.254.241] Could not fetch
resource information.  [301, #0]
[Fri May 07 18:26:14 2010] [error] [client 192.168.254.241] Requests for a
collection must have a trailing slash on the URI.  [301, #0]
[Fri May 07 18:26:14 2010] [error] [client 192.168.254.241] Could not fetch
resource information.  [301, #0]
[Fri May 07 18:26:14 2010] [error] [client 192.168.254.241] (2)No such file
or directory: Requests for a collection must have a trailing slash on the
URI.  [301, #0]
[Fri May 07 18:34:15 2010] [debug] mod_deflate.c(615): [client
192.168.254.241] Zlib: Compressed 484 to 328 : URL /svn
[Fri May 07 18:34:19 2010] [debug] mod_authnz_ldap.c(379): [client
192.168.254.241] [26599] auth_ldap authenticate: using URL
ldap://localhost/ou=Users,dc=my,dc=server,dc=net?uid
[Fri May 07 18:34:19 2010] [debug] mod_authnz_ldap.c(484): [client
192.168.254.241] [26599] auth_ldap authenticate: accepting saulo
[Fri May 07 18:34:19 2010] [debug] mod_authnz_ldap.c(556): [client
192.168.254.241] [26599] auth_ldap authorise: declining to authorise (no
ldap requirements)
[Fri May 07 18:34:19 2010] [error] [client 192.168.254.241] Could not fetch
resource information.  [301, #0]
[Fri May 07 18:34:19 2010] [error] [client 192.168.254.241] Requests for a
collection must have a trailing slash on the URI.  [301, #0]
[Fri May 07 18:34:19 2010] [debug] mod_deflate.c(615): [client
192.168.254.241] Zlib: Compressed 323 to 232 : URL /svn
[Fri May 07 18:34:19 2010] [debug] mod_deflate.c(615): [client
192.168.254.241] Zlib: Compressed 484 to 328 : URL /svn
[Fri May 07 18:34:19 2010] [debug] mod_authnz_ldap.c(379): [client
192.168.254.241] [26600] auth_ldap authenticate: using URL
ldap://localhost/ou=Users,dc=my,dc=server,dc=net?uid
[Fri May 07 18:34:19 2010] [debug] mod_authnz_ldap.c(484): [client
192.168.254.241] [26600] auth_ldap authenticate: accepting saulo
[Fri May 07 18:34:19 2010] [debug] mod_authnz_ldap.c(556): [client
192.168.254.241] [26600] auth_ldap authorise: declining to authorise (no
ldap requirements)
[Fri May 07 18:34:19 2010] [error] [client 192.168.254.241] Could not fetch
resource information.  [301, #0]
[Fri May 07 18:34:19 2010] [error] [client 192.168.254.241] (2)No such file
or directory: Requests for a collection must have a trailing slash on the
URI.  [301, #0]
[Fri May 07 18:34:19 2010] [debug] mod_deflate.c(615): [client
192.168.254.241] Zlib: Compressed 323 to 232 : URL /svn


Waiting your responses, thanks. :)


Saulo

RE: Apache + SVN (+ LDAP) don't works

Posted by Bob Archer <Bo...@amsi.com>.
> 1. <VirtualHost *:8012>
> 2.
> 3.         ServerAdmin me@me.com
> 4.         ServerName my.server.net
> 5.
> 6.         ErrorLog /var/log/apache2/subversion.my.server.net-error_log
> 7.         CustomLog /var/log/apache2/subversion.my.server.net-access_log
> combined
> 8.
> 9.         DocumentRoot /var/www
> 10.
> 11.         LogLevel debug
> 12.
> 13.         <Location /svn/>

What happens if you remove that trailing whack?

BOb



> 14.                 DAV svn
> 15.
> 16.                 SVNParentPath /home/files/svn_root
> 17.                 SVNListParentPath on
> 18.
> 19.                 # Enable WebDAV automatic versioning
> 20.                 SVNAutoversioning On
> 21.
> 22.                 # Repository Display Name
> 23.                 SVNReposName "Subversion Repository"
> 24.         </Location>
> 25.
> 26.         <Directory "/home/files/svn_root">
> 27.                 Order allow,deny
> 28.                 Allow from all
> 29.         </Directory>
> 30.
> 31.         <Directory "/var/www">
> 32.                 Order allow,deny
> 33.                 Allow from all
> 34.         </Directory>
> 35.
> 36. </VirtualHost>

Re: Apache + SVN (+ LDAP) don't works

Posted by Saulo Soares de Toledo <sa...@gmail.com>.
To simplify the thread, I removed the LDAP entries! Now a config without
authentication and returning "client denied by server configuration"
message:




   1. <VirtualHost *:8012>
   2.
   3.         ServerAdmin me@me.com
   4.         ServerName my.server.net
   5.
   6.         ErrorLog /var/log/apache2/subversion.my.server.net-error_log
   7.         CustomLog /var/log/apache2/subversion.my.server.net-access_log
   combined
   8.
   9.         DocumentRoot /var/www
   10.
   11.         LogLevel debug
   12.
   13.         <Location /svn/>
   14.                 DAV svn
   15.
   16.                 SVNParentPath /home/files/svn_root
   17.                 SVNListParentPath on
   18.
   19.                 # Enable WebDAV automatic versioning
   20.                 SVNAutoversioning On
   21.
   22.                 # Repository Display Name
   23.                 SVNReposName "Subversion Repository"
   24.         </Location>
   25.
   26.         <Directory "/home/files/svn_root">
   27.                 Order allow,deny
   28.                 Allow from all
   29.         </Directory>
   30.
   31.         <Directory "/var/www">
   32.                 Order allow,deny
   33.                 Allow from all
   34.         </Directory>
   35.
   36. </VirtualHost>

Re: Apache + SVN (+ LDAP) don't works

Posted by Saulo Soares de Toledo <sa...@gmail.com>.
Some more news! I changed a little and the error changed. I removed the
"DocumentRoot" from configuration too.

The new error is:
[Mon May 10 17:12:10 2010] [error] [client 192.168.254.241] client denied by
server configuration: /etc/apache2/htdocs



But /etc/apache2/htdocs does not exists, and I put "<Directory *>" and
"Allow from all" above. What is going wrong now?
And I'm not certainly if the another error will not happen....



<VirtualHost *:8012>

    ServerAdmin me@me.com
    ServerName subversion.myserver

    ErrorLog /var/log/apache2/subversion.myserver-error_log
    CustomLog /var/log/apache2/subversion.myserver-access_log combined

    LogLevel debug

    <Location />
        DAV svn

        SVNParentPath /home/files/svn_root
        SVNListParentPath on

        # Enable WebDAV automatic versioning
        SVNAutoversioning On

        # Repository Display Name
        SVNReposName "Subversion Repository"

        AuthType Basic
        AuthName "(Subversion)"

        AuthLDAPURL ldap://localhost/ou=Users,dc=my,dc=server,dc=net?uid
        AuthLDAPBindDN cn=admin,dc=my,dc=server,dc=net
        AuthLDAPBindPassword myPassword

        AuthBasicProvider ldap
        AuthUserFile /dev/null

        Require valid-user
    </Location>

    <Directory "/home/files/svn_root">
        Order allow,deny
        Allow from all
    </Directory>

    <Directory *>
        Order allow,deny
        Allow from all
    </Directory>


</VirtualHost>

2010/5/10 Saulo Soares de Toledo <sa...@gmail.com>

> Hello all!
>
> I've tried this at IRC rooms without results, then I'm here to try the
> list! :)
>
> I'm trying enable Apache + LDAP + SVN to enable my SVN server service. All
> almost done, but with this config at Apache (I have this VH only to
> subversion!):
>
>
>    1. <VirtualHost *:8012>
>    2.
>    3.         ServerAdmin me@me.com
>    4.         ServerName subversion.myserver
>    5.
>    6.         DocumentRoot /var/www/
>    7.
>    8.         ErrorLog /var/log/apache2/subversion.myserver-error_log
>    9.         CustomLog /var/log/apache2/subversion.myserver-access_log
>    combined
>    10.
>    11.
>    12.         <Location /svn>
>    13.                 DAV svn
>    14.
>    15.                 SVNParentPath /home/files/svn_root
>    16.                 SVNListParentPath on
>    17.
>    18.                 ## Enable WebDAV automatic versioning
>    19.                 SVNAutoversioning On
>    20.
>    21.                 ## Repository Display Name
>    22.                 SVNReposName "Subversion Repository"
>    23.
>    24.                 AuthType Basic
>    25.                 AuthName "(Subversion)"
>    26.
>    27.                 AuthLDAPURL
>    ldap://localhost/ou=Users,dc=my,dc=server,dc=net?uid
>    28.                 AuthLDAPBindDN cn=admin,dc=my,dc=server,dc=net
>    29.                 AuthLDAPBindPassword myPassword
>    30.
>    31.                 AuthBasicProvider ldap
>    32.                 AuthUserFile /dev/null
>    33.
>    34.                 Require valid-user
>    35.
>    36.         </Location>
>    37.
>    38.         <Directory "/home/files/svn_root">
>    39.                 Order allow,deny
>    40.                 Allow from all
>    41.         </Directory>
>    42.
>    43. </VirtualHost>
>
>
>
> <http://pastebin.com/e6cg1Yt2>When I connect from a SVN client I receive
> the error "*Repository moved permanently to 'http:...'; please relocate*".
>
> The best info I found is here:
> http://subversion.apache.org/faq.html#http-301-error . With the content:
>
> *"It means your httpd.conf is misconfigured. Usually this error happens
> when you've defined the Subversion virtual "location" to exist within two
> different scopes at the same time.*
>
> *For example, if you've exported a repository as <Location /www/foo>, but
> you've also set your DocumentRoot to be /www, then you're in trouble. When
> the request comes in for /www/foo/bar, apache doesn't know whether to find
> a **real file named /foo/bar within your DocumentRoot, or whether to ask
> mod_dav_svn to fetch a file /bar from the /www/foo repository. Usually the
> former case wins, and hence the "Moved Permanently" error.*
>
> *The solution is to make sure your repository <Location> does not overlap
> or live within any areas already exported as normal web shares.*
>
> *It's also possible that you have an object in the web root which has the
> same name as your repository URL. For example, imagine your web server's
> document root is /var/www and your Subversion repository is located at
> /home/svn/repo. You then configure Apache to serve the repository at
> http://localhost/myrepo. If you then create the directory /var/www/myrepo/this will cause a 301 error to occur."
> *
>
>
> But what's wrong with my config? I don't understood what is happening.
> My Apache logs have this (debug mode actived):
>
> [Fri May 07 18:14:19 2010] [error] [client 192.168.254.241] Could not fetch
> resource information.  [301, #0]
> [Fri May 07 18:14:19 2010] [error] [client 192.168.254.241] (2)No such file
> or directory: Requests for a collection must have a trailing slash on the
> URI.  [301, #0]
> [Fri May 07 18:22:28 2010] [error] [client 192.168.254.241] Could not fetch
> resource information.  [301, #0]
> [Fri May 07 18:22:28 2010] [error] [client 192.168.254.241] Requests for a
> collection must have a trailing slash on the URI.  [301, #0]
> [Fri May 07 18:22:28 2010] [error] [client 192.168.254.241] Could not fetch
> resource information.  [301, #0]
> [Fri May 07 18:22:28 2010] [error] [client 192.168.254.241] (2)No such file
> or directory: Requests for a collection must have a trailing slash on the
> URI.  [301, #0]
> [Fri May 07 18:26:14 2010] [error] [client 192.168.254.241] Could not fetch
> resource information.  [301, #0]
> [Fri May 07 18:26:14 2010] [error] [client 192.168.254.241] Requests for a
> collection must have a trailing slash on the URI.  [301, #0]
> [Fri May 07 18:26:14 2010] [error] [client 192.168.254.241] Could not fetch
> resource information.  [301, #0]
> [Fri May 07 18:26:14 2010] [error] [client 192.168.254.241] (2)No such file
> or directory: Requests for a collection must have a trailing slash on the
> URI.  [301, #0]
> [Fri May 07 18:34:15 2010] [debug] mod_deflate.c(615): [client
> 192.168.254.241] Zlib: Compressed 484 to 328 : URL /svn
> [Fri May 07 18:34:19 2010] [debug] mod_authnz_ldap.c(379): [client
> 192.168.254.241] [26599] auth_ldap authenticate: using URL
> ldap://localhost/ou=Users,dc=my,dc=server,dc=net?uid
> [Fri May 07 18:34:19 2010] [debug] mod_authnz_ldap.c(484): [client
> 192.168.254.241] [26599] auth_ldap authenticate: accepting saulo
> [Fri May 07 18:34:19 2010] [debug] mod_authnz_ldap.c(556): [client
> 192.168.254.241] [26599] auth_ldap authorise: declining to authorise (no
> ldap requirements)
> [Fri May 07 18:34:19 2010] [error] [client 192.168.254.241] Could not fetch
> resource information.  [301, #0]
> [Fri May 07 18:34:19 2010] [error] [client 192.168.254.241] Requests for a
> collection must have a trailing slash on the URI.  [301, #0]
> [Fri May 07 18:34:19 2010] [debug] mod_deflate.c(615): [client
> 192.168.254.241] Zlib: Compressed 323 to 232 : URL /svn
> [Fri May 07 18:34:19 2010] [debug] mod_deflate.c(615): [client
> 192.168.254.241] Zlib: Compressed 484 to 328 : URL /svn
> [Fri May 07 18:34:19 2010] [debug] mod_authnz_ldap.c(379): [client
> 192.168.254.241] [26600] auth_ldap authenticate: using URL
> ldap://localhost/ou=Users,dc=my,dc=server,dc=net?uid
> [Fri May 07 18:34:19 2010] [debug] mod_authnz_ldap.c(484): [client
> 192.168.254.241] [26600] auth_ldap authenticate: accepting saulo
> [Fri May 07 18:34:19 2010] [debug] mod_authnz_ldap.c(556): [client
> 192.168.254.241] [26600] auth_ldap authorise: declining to authorise (no
> ldap requirements)
> [Fri May 07 18:34:19 2010] [error] [client 192.168.254.241] Could not fetch
> resource information.  [301, #0]
> [Fri May 07 18:34:19 2010] [error] [client 192.168.254.241] (2)No such file
> or directory: Requests for a collection must have a trailing slash on the
> URI.  [301, #0]
> [Fri May 07 18:34:19 2010] [debug] mod_deflate.c(615): [client
> 192.168.254.241] Zlib: Compressed 323 to 232 : URL /svn
>
>
> Waiting your responses, thanks. :)
>
>
> Saulo
>
>
>