# [SOLVED] WebDAV - not working - Embarresing!

## alonbl

Hello,

I give up! WebDAV is not working for me, all I see in apache logs even in debug:

```

Thu Sep 15 00:24:02 2011] [error] [client 192.168.252.22] Attempt to serve directory: /var/lib/git/

```

It should be simple!

Any help appreciated!

Following apache configuration:

```

Alias /git/ "/var/lib/git/"

<Directory "/var/lib/git/">

        DAV filesystem

        Options Indexes MultiViews

        Order allow,deny

        Allow from all

        AllowOverride all

</Directory>

```

I have the following apache settings, maybe some module is missing:

```

* Found these USE flags for www-servers/apache-2.2.20:

 U I

 + + apache2_modules_actions         : Provides for executing CGI scripts based on media type or

                                       request method

 + + apache2_modules_alias           : Provides for mapping different parts of the host filesystem in

                                       the document tree and for URL redirection

 - - apache2_modules_asis            : Sends files that contain their own HTTP headers

 + + apache2_modules_auth_basic      : Basic authentication

 - - apache2_modules_auth_digest     : User authentication using MD5 Digest Authentication

 - - apache2_modules_authn_alias     : Provides the ability to create extended authentication

                                       providers based on actual providers

 + + apache2_modules_authn_anon      : Allows "anonymous" user access to authenticated areas

 - - apache2_modules_authn_dbd       : User authentication using an SQL database

 - - apache2_modules_authn_dbm       : User authentication using DBM files

 + + apache2_modules_authn_default   : Authentication fallback module

 + + apache2_modules_authn_file      : User authentication using text files

 - - apache2_modules_authz_dbm       : Group authorization using DBM files

 + + apache2_modules_authz_default   : Authorization fallback module

 + + apache2_modules_authz_groupfile : Group authorization using plaintext files

 + + apache2_modules_authz_host      : Group authorizations based on host (name or IP address)

 - - apache2_modules_authz_owner     : Authorization based on file ownership

 + + apache2_modules_authz_user      : User Authorization

 - - apache2_modules_autoindex       : Generates directory indexes, automatically, similar to the Unix

                                       ls command

 - - apache2_modules_cache           : Content cache keyed to URIs

 - - apache2_modules_cern_meta       : CERN httpd metafile semantics

 + + apache2_modules_cgi             : Enable CGI module (used by non-multithreaded MPMs, for eg.

                                       prefork)

 - - apache2_modules_cgid            : Enable CGI module (used by multithreaded MPMs, for eg. worker)

 - - apache2_modules_charset_lite    : Specify character set translation or recoding

 + + apache2_modules_dav             : Distributed Authoring and Versioning (WebDAV) functionality

 + + apache2_modules_dav_fs          : filesystem provider for mod_dav

 + + apache2_modules_dav_lock        : generic locking module for mod_dav

 - - apache2_modules_dbd             : Manages SQL database connections

 - - apache2_modules_deflate         : Compress content before it is delivered to the client

 + + apache2_modules_dir             : Provides for "trailing slash" redirects and serving directory

                                       index files

 - - apache2_modules_disk_cache      : Content cache storage manager keyed to URIs

 - - apache2_modules_dumpio          : Dumps all I/O to error log as desired

 + + apache2_modules_env             : Modifies the environment which is passed to CGI scripts and SSI

                                       pages

 + + apache2_modules_expires         : Generation of Expires and Cache-Control HTTP headers according

                                       to user-specified criteria

 - - apache2_modules_ext_filter      : Pass the response body through an external program before

                                       delivery to the client

 - - apache2_modules_file_cache      : Caches a static list of files in memory

 - - apache2_modules_filter          : Context-sensitive smart filter configuration module

 - - apache2_modules_headers         : Customization of HTTP request and response headers

 - - apache2_modules_ident           : RFC 1413 ident lookups

 - - apache2_modules_imagemap        : Server-side imagemap processing

 - - apache2_modules_include         : Server-parsed html documents (Server Side Includes)

 - - apache2_modules_info            : Provides a comprehensive overview of the server configuration

 - - apache2_modules_log_config      : Logging of the requests made to the server

 - - apache2_modules_log_forensic    : Forensic Logging of the requests made to the server

 - - apache2_modules_logio           : Logging of input and output bytes per request

 - - apache2_modules_mem_cache       : Content cache keyed to URIs

 + + apache2_modules_mime            : Associates the requested filename's extensions with the file's

                                       behavior (handlers and filters) and content (mime-type,

                                       language, character set and encoding)

 - - apache2_modules_mime_magic      : Determines the MIME type of a file by looking at a few bytes of

                                       its contents

 - - apache2_modules_negotiation     : Provides for content negotiation

 + + apache2_modules_proxy           : HTTP/1.1 proxy/gateway server

 + + apache2_modules_proxy_ajp       : AJP support module for mod_proxy

 - - apache2_modules_proxy_balancer  : mod_proxy extension for load balancing

 - - apache2_modules_proxy_connect   : mod_proxy extension for CONNECT request handling

 - - apache2_modules_proxy_ftp       : FTP support module for mod_proxy

 - - apache2_modules_proxy_http      : HTTP support module for mod_proxy

 - - apache2_modules_proxy_scgi      : SCGI gateway module for mod_proxy

 - - apache2_modules_reqtimeout      : Set timeout and minimum data rate for receiving requests

 + + apache2_modules_rewrite         : Provides a rule-based rewriting engine to rewrite requested

                                       URLs on the fly

 - - apache2_modules_setenvif        : Allows the setting of environment variables based on

                                       characteristics of the request

 - - apache2_modules_speling         : Attempts to correct mistaken URLs that users might have entered

                                       by ignoring capitalization and by allowing up to one

                                       misspelling

 - - apache2_modules_status          : Provides information on server activity and performance

 - - apache2_modules_substitute      : Perform search and replace operations on response bodies

 - - apache2_modules_unique_id       : Provides an environment variable with a unique identifier for

                                       each request

 - - apache2_modules_userdir         : User-specific directories

 - - apache2_modules_usertrack       : Clickstream logging of user activity on a site

 - - apache2_modules_version         : Version dependent configuration

 - - apache2_modules_vhost_alias     : Provides for dynamically configured mass virtual hosting

 - - apache2_mpms_event              : An experimental variant of the standard worker MPM

 - - apache2_mpms_itk                : Allows to run each virtual host under a separate uid and gid

 - - apache2_mpms_peruser            : Peruser is a working implementation of the perchild MPM

                                       allowing to run each apache child process as its own user and

                                       group, each handling its own set of virtual hosts

 + + apache2_mpms_prefork            : Implements a non-threaded, pre-forking web server

 - - apache2_mpms_worker             : Multi-Processing Module implementing a hybrid multi-threaded

                                       multi-process web server

 - - debug                           : Enable extra debug codepaths, like asserts and extra output. If

                                       you want to get meaningful backtraces see

                                       http://www.gentoo.org/proj/en/qa/backtraces.xml

 - - doc                             : Adds extra documentation (API, Javadoc, etc)

 - - ldap                            : Adds LDAP support (Lightweight Directory Access Protocol)

 + + ssl                             : Adds support for Secure Socket Layer connections

 - - static                          : !!do not set this during bootstrap!! Causes binaries to be

                                       statically linked instead of dynamically

 - - suexec                          : Install suexec with apache

 - - threads                         : Adds threads support for various packages. Usually pthreads

```

/etc/conf.d/apache2

```

APACHE2_OPTS="-D DEFAULT_VHOST -D INFO -D SSL -D SSL_DEFAULT_VHOST"

APACHE2_OPTS="${APACHE2_OPTS} -D PYTHON -D DAV -D SVN"

```

Dav destination:

```

# ls -la /var/lib/git/

total 16

drwxr-xr-x  4 apache apache 4096 Sep 14 23:44 .

drwxr-xr-x 21 root   root   4096 Sep 14 15:26 ..

drwxr-xr-x  7 apache apache 4096 Sep  5 23:24 jredis.git

drwxr-xr-x  7 apache apache 4096 Sep  6 00:42 linenoise.git

```

Last edited by alonbl on Fri Sep 16, 2011 4:53 pm; edited 1 time in total

----------

## alonbl

Anyone? This should be simple, I probably miss something small.

Thanks!

----------

## DaggyStyle

can you make sure the permissions of the directory is correct?

----------

## alonbl

Thanks!

 *DaggyStyle wrote:*   

> can you make sure the permissions of the directory is correct?

 

Which directory?

This one? What is "correct"?

 *alonbl wrote:*   

> 
> 
> Dav destination:
> 
> ```
> ...

 

Thanks!

----------

## DaggyStyle

```
ls -la /var/lib/git
```

----------

## alonbl

 *DaggyStyle wrote:*   

> 
> 
> ```
> ls -la /var/lib/git
> ```
> ...

 

Isn't this what I specified to times?

Thanks!

----------

## DaggyStyle

I didn't expressed my self correctly, what are the permissions of /var/lib/git? not the content, the actual folder

----------

## alonbl

 *DaggyStyle wrote:*   

> I didn't expressed my self correctly, what are the permissions of /var/lib/git? not the content, the actual folder

 

You can always look at '.'.

----------

## DaggyStyle

 *alonbl wrote:*   

>  *DaggyStyle wrote:*   I didn't expressed my self correctly, what are the permissions of /var/lib/git? not the content, the actual folder 
> 
> You can always look at '.'.

 

check just in case

----------

## alonbl

 *DaggyStyle wrote:*   

>  *alonbl wrote:*    *DaggyStyle wrote:*   I didn't expressed my self correctly, what are the permissions of /var/lib/git? not the content, the actual folder 
> 
> You can always look at '.'. 
> 
> check just in case

 

I fail to understand.

In POSIX file systems there are two references from the directory index to the directory inode.

One is from the parent directory using the "name" and the other is from the own directory using "." name.

So if you do:

```

# ls -lia /tmp

1048577 drwxrwxrwt 14 root   root       4096 Sep 16 14:55 .

      2 drwxr-xr-x 20 root   root       4096 Sep  8 10:31 ..

1075207 -rw-r--r--  1 root   root       3688 Sep 15 18:38 a

1060478 -rw-r--r--  1 root   root          0 Sep 15 20:02 a1

#ls -laid /tmp

1048577 drwxrwxrwt 14 root root 4096 Sep 16 14:55 /tmp

```

As you can see the inode of both tmp and "." are 14, so the meta data you see are the same.

This why "ls -la" is enough as you can always see the metadata of "." which is the metadata of the directory it-self in its parent.

Is anything missing?

Do you have a working configuration?

Can you please send me relevant httpd.conf /etc/conf.d/apache2 and the output of:

```

# equery uses apache

```

Thanks!

----------

## DaggyStyle

nope, I don't used it I thought it might be that the permissions or the gid/uid was wrong.

----------

## chiefbag

Do you not need to include the "dav_fs" module.?

Also just chown apache on the repository

----------

## alonbl

Solved!

autoindex module was missing.

----------

