Newb: Please help me activate webdav

Discussion in 'Server Operation' started by smartin, Dec 5, 2007.

  1. smartin

    smartin New Member

    Hi,

    I'm running Dapper server 6.0.LTS with the Ubuntu desktop.

    I had this running just fine in Feisty but the move to Dapper Server has broken something...

    This is what I have done:

    To enable the apache modules:
    Code:
    sudo a2enmod
    
    dav
    
    sudo a2enmod
    
    dav_fs
    
    Then make sure the lock file exists:
    Code:
    $ cd /var/lock/apache2
    $ sudo touch DAVLock
    $ sudo chown www-data:www-data DAVLock
    
    To create dav folder:
    Code:
    sudo mkdir /var/www/dav
    sudo chgrp www-data /var/www/dav
    sudo chmod 775 /var/www/dav
    
    To create user folder:
    Code:
    sudo mkdir /var/www/dav/simon
    sudo chgrp www-data /var/www/dav/simon
    sudo chmod 775 /var/www/dav/simon
    
    To create the user password:
    Code:
    sudo htpasswd -c /var/www/dav/simon/.DAVlogin simon
    
    Then create restrictions to folder:
    Code:
    sudo nano /etc/apache2/mods-enabled/dav_fs.conf
    
    Paste in:
    Code:
    DAVLockDB /var/lock/apache2/DAVLock
    #DAVMinTimeout 600
    
    <Location /dav/simon/>
            Dav On
    
            AuthType Basic
            AuthName simon
            AuthUserFile /var/www/dav/simon/.DAVlogin
    
            <LimitExcept OPTIONS>
                    Require user simon
            </LimitExcept>
    </Location>
    
    Restart apache:
    Code:
    sudo /etc/init.d/apache2 restart
    
    When I then try to access the folder http://myserver/dav/simon using the finder of my OSX box I get an error to the effect that the server cannot be found.

    When I try a browser, I can see the folder /simon and can get inside it without a password.

    What the heck have I done wrong?

    TIA!

    Simon
     
    Last edited: Dec 10, 2007
  2. smartin

    smartin New Member

    Hi,

    I don't know if it's relevant but if I open my DAVLock file in gEdit, there's nothing in it.

    I was expecting something to be in that file...

    ?

    Simon
     
  3. falko

    falko Super Moderator Howtoforge Staff

    Any errors in the log files on the server?
     
  4. smartin

    smartin New Member

    Falko! :)

    Im so sorry but I'm enough of a newb not to know how to read the log files. What is the command to see them?

    Thanks!

    Simon
     
  5. smartin

    smartin New Member

    Falko,

    Ok, I'm blufffing this...

    This seems to be the log in /var/log/apache2/accesslog. Last few lines. I had tried the webdav folder again just before:
    Code:
    "http://192.168.0.11/" "Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11"
    192.168.0.6 - - [05/Dec/2007:18:47:31 +0000] "OPTIONS /simon/ HTTP/1.1" 200 - "-" "WebDAVFS/1.4.1 (01418000) Darwin/8.11.0 (Power Macintosh)"
    192.168.0.77 - - [06/Dec/2007:20:00:28 +0000] "OPTIONS /simon/ HTTP/1.1" 200 - "-" "WebDAVFS/1.5 (01508000) Darwin/9.1.0 (i386)"
    192.168.0.77 - - [07/Dec/2007:15:57:19 +0000] "OPTIONS /simon/ HTTP/1.1" 200 - "-" "WebDAVFS/1.5 (01508000) Darwin/9.1.0 (i386)"
    
    The only other log in the same folder is the error.log. Last few lines again:
    Code:
    Wed Dec 05 17:07:25 2007] [notice] caught SIGTERM, shutting down
    [Wed Dec 05 17:07:27 2007] [notice] Apache/2.0.55 (Ubuntu) DAV/2 PHP/5.1.2 configured -- resuming normal operations
    [Wed Dec 05 18:38:45 2007] [notice] caught SIGTERM, shutting down
    [Wed Dec 05 18:38:45 2007] [notice] Apache/2.0.55 (Ubuntu) DAV/2 PHP/5.1.2 configured -- resuming normal operations
    [Thu Dec 06 14:59:40 2007] [notice] caught SIGTERM, shutting down
    [Thu Dec 06 15:00:44 2007] [notice] Apache/2.0.55 (Ubuntu) DAV/2 PHP/5.1.2 configured -- resuming normal operations
    
    Any help?

    Simon
     
  6. falko

    falko Super Moderator Howtoforge Staff

    The logs look ok.
    What's the output of
    Code:
    ls -la /var/www/dav/simon
    ?
     
  7. smartin

    smartin New Member

    Falko,

    I made a typo in my description above which has now been corrected. The folder I created is var/www/dav/simon. Above I described it as var/www/simon...

    The output is:
    Code:
    ls -la /var/www/dav/simon
    total 12
    drwxrwxr-x 2 root www-data 4096 2007-12-10 09:58 .
    drwxrwxr-x 3 root www-data 4096 2007-12-10 09:56 ..
    -rw-r--r-- 1 root root       20 2007-12-10 09:58 .DAVlogin
    
    I seem to have more logs ( I tried accessing the dav folder just before reading these):
    In var/logs/apache2 I have:
    access.log with nothing in it.
    access.log.1 with:
    Code:
    "http://192.168.0.11/" "Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11"
    192.168.0.6 - - [05/Dec/2007:18:47:31 +0000] "OPTIONS /simon/ HTTP/1.1" 200 - "-" "WebDAVFS/1.4.1 (01418000) Darwin/8.11.0 (Power Macintosh)"
    192.168.0.77 - - [06/Dec/2007:20:00:28 +0000] "OPTIONS /simon/ HTTP/1.1" 200 - "-" "WebDAVFS/1.5 (01508000) Darwin/9.1.0 (i386)"
    192.168.0.77 - - [07/Dec/2007:15:57:19 +0000] "OPTIONS /simon/ HTTP/1.1" 200 - "-" "WebDAVFS/1.5 (01508000) Darwin/9.1.0 (i386)"
    
    error.log:
    Code:
    [Sun Dec 09 07:35:20 2007] [notice] Apache/2.0.55 (Ubuntu) DAV/2 PHP/5.1.2 configured -- resuming normal operations
    [Mon Dec 10 09:59:41 2007] [notice] caught SIGTERM, shutting down
    [Mon Dec 10 09:59:42 2007] [notice] Apache/2.0.55 (Ubuntu) DAV/2 PHP/5.1.2 configured -- resuming normal operations
    
    error.log.1:
    Code:
    [Wed Dec 05 18:38:45 2007] [notice] Apache/2.0.55 (Ubuntu) DAV/2 PHP/5.1.2 configured -- resuming normal operations
    [Thu Dec 06 14:59:40 2007] [notice] caught SIGTERM, shutting down
    [Thu Dec 06 15:00:44 2007] [notice] Apache/2.0.55 (Ubuntu) DAV/2 PHP/5.1.2 configured -- resuming normal operations
    [Sun Dec 09 07:35:19 2007] [notice] caught SIGTERM, shutting down
    
    Why have I suddenly got log.1 files...?

    Any help?

    Simon
     
  8. smartin

    smartin New Member

    Falko,

    I just used my browser to go to http://127.0.0.1/dav/simon/.

    I then got the username/password challenge as expected and accessed the folder as expected.

    I then tried accessing the folder using a web-browser on my OSX box on the same network and got the username/password challenge but when I clicked Ok I got:
    Code:
    Object Not Found
    The requested URL '/dav/simon' was not found on the RomPager server.
    
    Return to last page
    
    When I use the OSX Finder to access the folder, things work as expected!

    I think something has sorted itself out! Weird error using a browser from the OSX box though...

    Simon
     
    Last edited: Dec 10, 2007

Share This Page