# WebDAV, apache2, and Windows XP

## grayrest

Good day all, I'm trying to set up a file server using apache2 webdav and mod_auth_digest authentication. It works great under OS X and Windows 2000, but apparently Microsoft made web folders screwy in Windows XP. The problem is known and is solveable using mod_encoding, which is apparently useful to Japanese webmasters. 

There is an ebuild in portage for mod_encoding, but it is for apache 1.x. The writer has apparently updated the module for apache 2.0, but since all the instructions are in Japanese, I can't understand the instructions to compile! Moreover, every mention of Apache 2.x and mod_encoding is a Japanese website, so the problem may be solveable some other way or people are just going with basic authentication and mod_auth_msfix (http://www.luluware.com/mod_auth_msfix.html).

The current workaround of adding host\username as well as usernamein the digest is not working, the username gets matched but the password isn't accepted.

Module webside: http://webdav.todo.gr.jp/download/

MS KB article: http://support.microsoft.com/default.aspx?scid=kb;en-us;315621&Product=winxp

MS fix article: http://www.hss.caltech.edu/help/unix/admin/web/apache-webdav-xp

MS WinXP web folders problem fixes:

```

#

# Broken WebDAV for Windows XP

#

BrowserMatch "^WebDAVFS/1.[012]" redirect-carefully

BrowserMatch "Microsoft Data Access Internet Publishing Provider" redirect-carefully

BrowserMatch "Microsoft-WebDAV-MiniRedir/5.1.2600" redirect-carefully

BrowserMatch "^WebDrive" redirect-carefully

BrowserMatch "^WebDAVFS" redirect-carefully

<IfModule mod_headers.c>

    Header add MS-Author-Via "DAV"

</IfModule>

<IfModule mod_encoding.c>

    EncodingEngine on

    NormalizeUsername on

</IfModule>

```

----------

## mrenoch

Try having your xp users include a port number in their url - i.e. http://my.webdavserver.org:80.

This seems to force xp into sending the proper auth credentials.

I found this solution here - 

http://phantom.byu.edu/pipermail/uug-list/2004-February/010433.html

/jsb

----------

## marder7

Good hint, greyrest, but hard to follow it. On the web page of your third link one can find:

```

  Obtain mod_encoding from http://webdav.todo.gr.jp/download/, compile it up, and put it somewhere Apache can see it.

```

Yeah, "compile it up". To me, that is a typical "solution" given by an arrogant unix guru. "Compile it up". As if it was a simple thing. What the author of that solution *really* wants to say is "I managed to "comple it up" like it was nothing - but do you really think I'll tell you how? You'll never succeed with that. You'll have to fall on your knees and ASK ME." 

The compilation and installation is sort of a tricky hack described on an Japanese web pages - in Japanese.

Here's how I got it tho work:

- Download the mod_encoding_*.tar.gz for apache2 from the Japanese webpage and unpack it into an appropriate directory, e.g.  ~/mod_encoding

- Download the newest version of mod_encoding.c from the same webpage and replace the older version of mod_encoding.c in the mod_encoding source directory with it.

First I had to build an iconv library:

```

cd mod_encoding/lib

./configure --with-apxs=/usr/sbin/apxs2 --prefix=/usr

make && make install

```

Then I could build the mod_encoding module:

```

cd ..

./configure --with-apxs=/usr/sbin/apxs2 --prefix=/usr

make && make install

```

At this point, an error occured. The module "mod_encoding.so" could not be copied to the apache2/lib directory, because it could't be found where it just has been created by the make command. 

So I had to copy it manually:

```

cp .libs/mod_encoding.so /usr/lib/apache2/modules

```

Ok, now I changed the apache2 configuration files as described above an thought that was it. When trying to restart apache2 by 

```

/etc/init.d/apache2 restart

```

apache2 complained about an "unresolved symbol" in the new module and didn't start.

Aha. 

I went to the japanese website again. That error is quoted in english. From within the mod_encoding source directory, I did:

```

./configure --with-apxs=/usr/sbin/apxs2  --with-iconv-hook=/usr/lib --prefix=/usr

make && make install

cp .libs/mod_encoding.so /usr/lib/apache2/modules

/etc/init.d/apache2 restart

```

And there was no more error - apache2 started ok. A quick test with Konqueror shows that teh webdav directory share service is up and running.

Now I have to reboot an test the result with WinXP.

EDIT: It works!! I sucessfully defined a WinXP network drive based on the webdav share of my server.

----------

## waverider202

Have you run into an issue where every DAV operation that XP tries to do takes about 30 seconds.  What makes it worse is XP stat's every file in a directory, cause it to take a few minutes sometimes before I can browse the DAV share.  I've read various places that this problem existed, but I haven't heard anyone solve this.

----------

## marder7

Until today, no, I haven't run into this issue. My XP installation is not very old and after the first fresh install I added the Service Pack 2 before I installed any other program. In particular, there's no software firewall installed on it yet. 

On my son's box though, all explorer operations are awfully slow - not only on DAV directories.  But he mentionend to have stopped a lot of system services in order to get more CPU resources... and since he never uses the explorer (why should he), it doesn't bother him.

Do you have tried a different file manager (like total commander)?

----------

## bwoo

greyrest,

You posted many solutions. Can I simply use the code you posted, or do I have to do ALL the steps you mentioned?

Also, someone mentioned to try adding the port number or #, neither seems to work. I'm running XP Pro SP2.

b

----------

