Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Discussion & Documentation Documentation, Tips & Tricks
  • Search

HOWTO (v1.06): Creating a WebDAV server with apache2

Unofficial documentation for various parts of Gentoo Linux. Note: This is not a support forum.
Post Reply
Advanced search
49 posts
  • Previous
  • 1
  • 2
Author
Message
autarkeia
n00b
n00b
Posts: 7
Joined: Fri Dec 19, 2003 9:35 pm

Adding :80 did it for me

  • Quote

Post by autarkeia » Wed Jun 29, 2005 5:09 am

I was wrestling with all of these options and Windows XP's totally wonky Web Folders WebDAV client, and someone here suggested putting the ":80" into the URL so that it looks like this: http://www.domain.com:80/davdirectory . I toyed around with changing configs for hours before I finally tried this, and it worked. FYI the authentication dialog box that pops up when using this method looks different than the standard authentication dialog box. Actually, I had a weird sequence of events:
  1. I put in :80 into the URL and entered into the New Network Place dialog box
  2. A different authentication dialog box than normal popped up. I entered my username and password and it connected successfully.
  3. The drive mounted, and I was asked if I wanted to view it immediately. I said "Yes."
  4. The "normal" authentication dialog box popped up. I clicked cancel.
  5. The "other" authentication dialog box (exactly like in step 2) popped up again, with none of my data filled in, even though I had selected "Save my data..." in the previous attempt
  6. I entered in my login and password a second time, and then everything just worked right.
It sounds wonky, and it is, but it worked. I have attempted to get Windows XP to work with WebDAV many times, and there are just tons of reports all over the Net about how M$ screwd up the client in some weird way. This worked for me.

YMMV.
Top
arkepp
n00b
n00b
Posts: 74
Joined: Tue Jul 23, 2002 9:35 am
Location: NYC / USA (or Norway)
Contact:
Contact arkepp
Website

  • Quote

Post by arkepp » Tue Aug 02, 2005 12:50 pm

Hi,

I also got

Code: Select all

[Tue Aug 02 14:21:21 2005] [error] [client 192.168.1.60] client denied by server configuration: /var/dav/svn
but Pergamon's suggestion

Code: Select all

AllowOverride None
Order allow,deny
Allow from all 
(in the Directory section) worked beautifully.

I suggest making it standard in the tutorial. I had just moved everything onto a new server and started with "fresh" configuration files, so I think almost everyone will need it. I wonder how long it would have taken me to figure this one out ;) thanks again
Top
Pergamon
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 117
Joined: Sun Feb 01, 2004 1:27 pm

added to howto

  • Quote

Post by Pergamon » Wed Aug 03, 2005 8:26 am

I added both the XP port 80 trick (autarkeia) and the permission inheritence thing (arkepp) to the trouble shooting section of the how-to. Normaly, this (AllowOverride None | Order allow,deny | Allow from all) should be the standard permissions already present in httpd.conf.
Top
niltonvolpato
n00b
n00b
User avatar
Posts: 68
Joined: Wed May 28, 2003 5:52 pm
Location: Campinas, Brazil

  • Quote

Post by niltonvolpato » Tue Aug 09, 2005 12:09 am

Is there any way to permit only secure webdav connection and deny non secure connections in the webdav directories? But, of course, still permit non-secure http for the others sites on the same apache server.

This is for security reasons, so an user will not type his/her password in clear text.

Thanks,
-- Nilton
Top
Pergamon
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 117
Joined: Sun Feb 01, 2004 1:27 pm

SSL only for WebDAV

  • Quote

Post by Pergamon » Tue Aug 09, 2005 8:48 am

Just a pointer:

I found a hint here. (See chapter "Set up access rules to the WebDAV directory". )

It seems that one can move the WebDAV directory defintions (<location> .. </location>) from 45_mod_dav.conf into the
SSL only vhost configuration.

If you figure out how to do this with Gentoo, I would add this to the howto.

Update: It seems that /etc/apache2/modules.d/41_mod_ssl.default-vhost.conf is the place to define locations that should be accessed only via SSL. Can somebody confirm that?
Top
niltonvolpato
n00b
n00b
User avatar
Posts: 68
Joined: Wed May 28, 2003 5:52 pm
Location: Campinas, Brazil

  • Quote

Post by niltonvolpato » Tue Aug 09, 2005 1:38 pm

niltonvolpato wrote:Is there any way to permit only secure webdav connection and deny non secure connections in the webdav directories? But, of course, still permit non-secure http for the others sites on the same apache server.
I found it! It suffices to put SSLRequireSSL inside Location, this way:

Code: Select all

<Location /mydavserver>
    SSLRequireSSL
    ...
</Location>
This way connections through http will be forbidden, only https connection will work. One thing that is important to note is that mod_ssl is loaded before mod_dav, in my modules.d directory 40_mod_ssl.conf comes earlier than 45_mod_dav.conf (the numbers indicate the loading order). But I think this should be a default for gentoo installations.

Thanks Pergamon,

-- Nilton
Top
Pergamon
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 117
Joined: Sun Feb 01, 2004 1:27 pm

  • Quote

Post by Pergamon » Thu Aug 11, 2005 11:57 am

Thanks niltonvolpato, added the SSLRequireSSL tip into the howto.
Top
spil
n00b
n00b
Posts: 1
Joined: Sun Sep 18, 2005 10:32 am

  • Quote

Post by spil » Sun Sep 18, 2005 10:41 am

Tip for Windows compatibility:
don't use a slash to terminate the alias, e.g.

Code: Select all

Alias /dav /var/dav
not
Alias /dav/ /var/dav/
Windows XP SP2 will strip the trailing slash of the path making your connection fail, e.g.

Code: Select all

http://gentoo/dav/
returns
x.x.x.x - - [18/Sep/2005:12:25:19 +0200] "OPTIONS /dav HTTP/1.1" 401 521 "-" "Microsoft Data Access Internet Publishing Provider Protocol Discovery"
Top
stillman
Apprentice
Apprentice
User avatar
Posts: 223
Joined: Sat Dec 07, 2002 6:01 pm
Location: Vienna, Austria

  • Quote

Post by stillman » Mon Sep 19, 2005 9:30 pm

thank you for this nice intro to webdav, much better than the documentation on the mod_dav-website. one thing i noticed at my fresh installation of apache is the location of modules.d, in my case it is /etc/apache2/conf/modules.d
Top
jlongs2
n00b
n00b
Posts: 15
Joined: Tue Jul 12, 2005 8:28 pm

  • Quote

Post by jlongs2 » Thu Oct 06, 2005 4:47 pm

My access_log has entries like these:

Code: Select all

127.0.0.1 - - [06/Oct/2005:11:29:25 -0500] "PROPFIND /dav HTTP/1.1" 405 293
127.0.0.1 - - [06/Oct/2005:11:29:25 -0500] "HEAD /dav HTTP/1.1" 301 -
127.0.0.1 - - [06/Oct/2005:11:29:25 -0500] "HEAD /dav/ HTTP/1.1" 200 -
Nautilus says "Couldn't display "dav://csdept@acm.cs.uic.edu/dav". The location is not a folder."

45_mod_dav.conf:

Code: Select all

<IfDefine DAV>
  <IfModule !mod_dav.c>
    LoadModule dav_module    modules/mod_dav.so
  </IfModule>
</IfDefine>

<IfDefine DAV_FS>
  <IfModule !mod_dav_fs.c>
    LoadModule dav_fs_module   modules/mod_dav_fs.so
  </IfModule>
</IfDefine>

<IfModule mod_dav.c>

    DavMinTimeout 600
        <Location /dav>
                Dav On
                <Limit PUT POST DELETE PROPFIND PROPPATCH MKCOL COPY MOVE LOCK UNLOCK>
                        AuthType Basic
                        AuthName "WebDAV Restricted"
                        AuthUserFile /var/www/localhost/DAV/.htdavpasswd
                        Require user csdept
                </Limit>
                AllowOverride None
                Order allow,deny
                Allow from all
        </Location>

</IfModule>

<IfModule mod_dav_fs.c>

    # Location of the WebDAV lock database.
    DavLockDB /var/lib/dav/lockdb

</IfModule>
edit: I was editing /etc/apache2/conf/modules.d/45_mod_dav.conf, not /etc/apache2/modules.d/45_mod_dav.conf. Fixed.
---
ACM @ UIC
http://acm.cs.uic.edu -- running on gentoo
Top
olt
n00b
n00b
Posts: 10
Joined: Tue Feb 22, 2005 7:02 pm

  • Quote

Post by olt » Sun Jan 01, 2006 1:48 pm

great how-to. thanks.
Top
wayt
n00b
n00b
User avatar
Posts: 22
Joined: Mon Jan 26, 2004 10:54 pm

Using iCal with WebDAV

  • Quote

Post by wayt » Thu Jan 26, 2006 10:41 pm

Thanks for a nice How-To. It allowed me to get a WebDAV repository up and working in about 15 minutes.
Windows Explorer and Mac OS X Finder both login fine and can save and copy files to and from the repository.

But for some reason, Apple's iCal program refuses to publish a calendar to the site. That's the primary reason I created the repository, so this is frustrating.

When I select iCal's "Publish..." menu option, enter a base URL of "http://gentoo/private" (same as I do to connect in Explorer or Finder), my login and password, then click the Publish button, iCal responds:

Publish failed for calendar "WWG"
Connection to gentoo failed because it is unreachable or down.

Neither of which is true, of course. Both the server and the client are on the same LAN, BTW.

Has anyone got iCal successfully uploading its calendar to a gentoo-based WebDAV server? Any tips to make this work?
Top
ptfoof
n00b
n00b
User avatar
Posts: 17
Joined: Mon Aug 09, 2004 12:06 am
Location: Indiana, USA
Contact:
Contact ptfoof
Website

Very well written

  • Quote

Post by ptfoof » Sun Feb 12, 2006 1:12 am

Pergamon,

Good job. This is a pretty well written HOWTO. I had a few problems, but they were minor and my fault.

ptfoof
Pete,
"I will persist until I succeed" - Og Mandino
Top
quantum0726
n00b
n00b
Posts: 26
Joined: Fri Mar 25, 2005 10:32 pm
Location: Milwaukee, WI
Contact:
Contact quantum0726
Website

  • Quote

Post by quantum0726 » Thu Feb 23, 2006 7:56 am

Thanks for the great HowTo!

With exception of taking a good hour to realize that not adding 'AllowOverride All' to the conf file for web_dav, I couldn't add Indexes with a .htaccess file, I got it up and working in short time.

I have one question though, is there a way to give different users different access?

For example, let's say I want no anonymous connections (i.e. GET requires even a user); I want user 'foo' to be able to GET and PROPFIND, but not write in any way; I want user 'bar' to have full access, read and write. Using the 'require user foo' and 'require user bar' I should be able to set up two separate <Limit> statements, but I'm too sure how to set the requirements to ensure that anonymous users get no access.
--Jayson

When Microsoft asks you, "Where do you want to go today?", tell them "*nix!"
Top
quantum0726
n00b
n00b
Posts: 26
Joined: Fri Mar 25, 2005 10:32 pm
Location: Milwaukee, WI
Contact:
Contact quantum0726
Website

Re: Using iCal with WebDAV

  • Quote

Post by quantum0726 » Thu Feb 23, 2006 7:58 am

wayt wrote:Has anyone got iCal successfully uploading its calendar to a gentoo-based WebDAV server? Any tips to make this work?
I am able to get iCal working fine, but so far no https access. My guess is that since my server has an invalid cert. (going to try to follow the link in this HowTo to get that fixed...it's been busted for some time now) it's rejecting the connection and not prompting as Finder does. If I disable SSL on the WebDAV share it publishes fine. Which version of iCal/OS X are you using?
--Jayson

When Microsoft asks you, "Where do you want to go today?", tell them "*nix!"
Top
M1Sports20
Apprentice
Apprentice
Posts: 194
Joined: Thu Mar 25, 2004 6:21 pm
Location: Chicago, IL
Contact:
Contact M1Sports20
Website

  • Quote

Post by M1Sports20 » Tue Apr 25, 2006 8:27 pm

How would you do this with userdirs

I like how each user has a public_html dir right now. could I do webdav with this
Top
dkaplowitz
Guru
Guru
User avatar
Posts: 596
Joined: Sat Nov 22, 2003 2:16 pm
Location: Philadelphia, PA
Contact:
Contact dkaplowitz
Website

  • Quote

Post by dkaplowitz » Tue Jul 11, 2006 3:45 pm

Great guide. Worked like a charm. Thanks!
http://dkap.info
Top
zbindere
Guru
Guru
User avatar
Posts: 356
Joined: Thu May 27, 2004 12:54 pm
Location: Switzerland

  • Quote

Post by zbindere » Mon Jul 17, 2006 2:16 pm

Is it possible to setup different subfolders for different users, so that only a user with the right permission can access his folder?
Top
superczar
n00b
n00b
User avatar
Posts: 33
Joined: Sun May 29, 2005 3:46 pm

  • Quote

Post by superczar » Sat Dec 16, 2006 7:43 am

I'm having a spot of trouble, followed the guide many times on a clean system, just installed apache. Can't connect from either of my OS X Tiger machines to my gentoo server/workstation.

Here's my access log.
192.168.0.152 - - [15/Dec/2006:23:39:03 -0800] "OPTIONS /idisk/ HTTP/1.1" 403 10
Here's my error log.
[Fri Dec 15 23:39:03 2006] [error] [client 192.168.0.152] (13)Permission denied: access to /idisk/ denied
All I get is 403 errors no auth window or anything useful.

I can view html files from outside the webdav folder but not from inside it, whether or not I have restricted GET access.

Here's my 45_mod_dav.conf file
<IfDefine DAV>
<IfModule !mod_dav.c>
LoadModule dav_module modules/mod_dav.so
</IfModule>
</IfDefine>

<IfDefine DAV_FS>
<IfModule !mod_dav_fs.c>
LoadModule dav_fs_module modules/mod_dav_fs.so
</IfModule>
</IfDefine>

<IfModule mod_dav.c>

Alias /idisk /mnt/personal/DAV/idisk
DavMinTimeout 600
<Location /idisk>
Options None
Dav On
<Limit PUT POST DELETE PROPFIND PROPPATCH MKCOL COPY MOVE LOCK UNLOCK>
AuthType Basic
AuthName "Andrew's WebDAV"
AuthUserFile /mnt/personal/DAV/lib/.davpasswd
Require valid-user
</Limit>
AllowOverride None
Order allow,deny
Allow from all

</Location>

</IfModule>

<IfModule mod_dav_fs.c>

# Location of the WebDAV lock database.
DavLockDB /mnt/personal/DAV/lib/lockdb

</IfModule>
My file/folder permissions are good... apache:apache rwx r-x r-x....

Apache is running as apache:apache

I'm using the finder to connect, not a web browser... (although i've tried to access an html file from a webbrowser to no avail).

Any ideas? (it's being called idisk, cause eventually it's gonna act as a fake idisk server, but for now plain ol' webdav would do nicely).
SuperCzar
Top
M1Sports20
Apprentice
Apprentice
Posts: 194
Joined: Thu Mar 25, 2004 6:21 pm
Location: Chicago, IL
Contact:
Contact M1Sports20
Website

  • Quote

Post by M1Sports20 » Mon Jan 22, 2007 5:16 am

This is a great howto. I am able to connect to my webdav server from both linux and windows. However I have a Microsoft Windows Vista Client. It won't connect. I tried both the port trick (append :80) and append # trick described on the first page of this thread.

Here is what the apache log looks like

access_log

Code: Select all

12.210.97.5 - - [21/Jan/2007:23:06:38 -0600] "PROPFIND / HTTP/1.1" 207 817
12.210.97.5 - - [21/Jan/2007:23:06:38 -0600] "PROPFIND / HTTP/1.1" 207 817
12.210.97.5 - - [21/Jan/2007:23:06:45 -0600] "PROPFIND / HTTP/1.1" 207 817
error_log -- Has nothing.


Anyone have any clue whats going on. Did Microsoft break the standard.
Top
Sakkath
Apprentice
Apprentice
Posts: 198
Joined: Sun Nov 06, 2005 4:13 am
Location: Pawtucket, RI
Contact:
Contact Sakkath
Website

  • Quote

Post by Sakkath » Fri Mar 23, 2007 7:38 pm

Why don't you warn before saying 'rm -rf /var/www'?
The person who makes no mistakes does not usually make anything.

Please add [SOLVED] to the subject of your original post when you feel that your problem is resolved.
Top
Caffeine
Guru
Guru
User avatar
Posts: 401
Joined: Wed Jul 17, 2002 7:21 pm
Location: Melbourne, Australia

Users

  • Quote

Post by Caffeine » Sun May 27, 2007 7:28 am

Great HowTo!

Has anybody managed to get this working for users other than apache? I'd like to be able to setup access to user homedirs and have the webdav process switch to the user's UID. I'd be happy setting up a virtual host per user. I've had a look here: http://httpd.apache.org/docs/2.2/mod/mp ... .html#user but it seems that the User directive no longer works within a <VirtualHost> section.

This must be a reasonably common request I'd have thought.

Cheers,
Dkam
Top
ailpein
n00b
n00b
Posts: 2
Joined: Mon Dec 17, 2007 9:36 pm

  • Quote

Post by ailpein » Mon Dec 17, 2007 9:52 pm

I can not connect with my webdav server. I try many trick's but it still doesn't work!
I need help...

When I look at : http://localhost/
I see:

Hello, world!

So apache is working. When I use nautilus to look at localhost/webdavserver or cadaver to open: localhost/mydavserver, I 've :

Could not contact server:
403 Forbidden


This is my 45_mod_dav.conf


<IfDefine DAV>
<IfModule !mod_dav.c>
LoadModule dav_module modules/mod_dav.so
</IfModule>
</IfDefine>

<IfDefine DAV_FS>
<IfModule !mod_dav_fs.c>
LoadModule dav_fs_module modules/mod_dav_fs.so
</IfModule>
</IfDefine>

<IfModule mod_dav.c>

Alias /mydavserver /var/dav/mydavserver
DavMinTimeout 600
<Location /mydavserver>
Options None
Dav On
<Limit GET PUT POST DELETE PROPFIND PROPPATCH MKCOL COPY MOVE LOCK UNLOCK>
AuthType Basic
AuthName "WebDAV Restricted Repository"
AuthUserFile /var/dav/.davpasswd
Require valid-user
</Limit>
</Location>

</IfModule>

<IfModule mod_dav_fs.c>

# Location of the WebDAV lock database.
DavLockDB /var/lib/dav/lockdb

</IfModule>

And folders:

drwxr-xr-x 3 apache apache 112 XII 17 22:12 dav

-rw-r--r-- 1 root root 22 XII 17 22:12 .davpasswd
drwxr-xr-x 2 apache apache 48 XII 17 22:11 mydavserver

Options in /etc/conf.d/apache:

APACHE2_OPTS="-D DAV -D DAV_FS -D DEFAULT_VHOST -D INFO -D LANGUAGE -D SUEXEC"

Thanks for help.
Top
notHerbert
Advocate
Advocate
User avatar
Posts: 2228
Joined: Tue Mar 11, 2008 11:55 pm
Location: 45N 73W

  • Quote

Post by notHerbert » Mon Jun 16, 2008 5:17 am

I couldn't get it to work with nautilus - must be some kind of gnome problem.

But it works fine with cadaver and KNetAttach. :)
Top
Post Reply

49 posts
  • Previous
  • 1
  • 2

Return to “Documentation, Tips & Tricks”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic