Webdav ошибка 403

I configured Apache2 to allow WebDav on a directory (CentOS 5 / Plesk 8.6):

  • WebDav is enabled in httpd.conf
  • /var/lib/dav/lockdb is writeable by Apache
  • My target dir is chmod 777
  • My target dir is chowned apache:psacln
  • using Basic Authentication (setup by Plesk interface)

in my vhost.conf I have:

<Directory /var/www/vhosts/domain.com/httpdocs/target_dir>
        Dav On
    AllowOverride none
        Order allow,deny
        Allow from all
</Directory>

I can connect to the directory using authentication fine and download files from it. But I cannot write to the dir. I get a 403 Error when I attempt to upload or create a dir.

Anyone have any tips?

Thanks in advance —

Update — 6/5 Using the comments below I’ve isolated the issue to being some type of conflict with .htpasswd protected directories. I can created an unprotected dir and enable WebDAV uploads fine. But once I enable Basic Auth on the directory everything goes south. I can read but no longer upload.

This is my vhost.conf:

<Directory /var/www/vhosts/domain.com/subdomains/subdomain/httpdocs/>
        AuthUserFile /var/www/.htpasswd
        AuthName "Login"
        AuthType Basic
        Require valid-user

        DAV on
    AllowOverride none
        <Limit PUT POST DELETE PROPFIND PROPPATCH MKCOL COPY MOVE LOCK UNLOCK>
                Require valid-user
        </Limit>
</Directory>

Update 6/6

Was able to get WebDAV working on a different domain with minimal effort. The only difference between the two domains is that in the one which refuses to allow write access I have a DocumentRoot directive:

    DocumentRoot /var/www/vhosts/domain.com/httpdocs/app/webroot

Might this be causing some problems?

If you are getting this error:

WebDAV 403 - Forbidden Access is denied. Server Error: 403 - Forbidden: Access is denied.You do not have permission to view this directory or page using the credentials that you supplied.

Here are the steps to solve it:

Step 1

Make sure that your ntfs permissions is set for the user that is trying to connect to WebDAV

Step 2

You need to create an Authoring Rules for the user that is trying to connect to WebDAV

Hello,

I have followed the WebDav wiki and I get the error 403 Forbidden:

$ cadaver http://127.0.0.1/dav
dav:/dav/> mkcol test
Creating `test': failed:
403 Forbidden
dav:/dav/> 

I have looked the forum pages
* 403 Forbidden Error on directory but not on index page which actually uses owncloud’s webdav
* [SOLVED] Apache and user directory
And also tried what is said in the discussion page

But I can’t find the problem.

/var/log/httpd/access_log:

127.0.0.1 - - [11/Apr/2015:12:16:46 +0200] "OPTIONS /dav/ HTTP/1.1" 200 -
127.0.0.1 - - [11/Apr/2015:12:16:46 +0200] "PROPFIND /dav/ HTTP/1.1" 207 683
127.0.0.1 - - [11/Apr/2015:12:16:56 +0200] "MKCOL /dav/test/ HTTP/1.1" 403 977

/var/log/httpd/access_log:

[Sat Apr 11 12:14:42.113880 2015] [dav:error] [pid 22639:tid 140478398338816] (13)Permission denied: [client 127.0.0.1:46716] Unable to create collection.  [403, #0]

/etc/httpd/cond/httpd.conf: (full conf if here)

DAVLockDB /home/httpd/DAV/DAVLock
Alias /dav "/home/httpd/html/dav"
<Directory "/home/httpd/html/dav">
  DAV On
  AllowOverride None
  Options Indexes FollowSymLinks
  Require all granted
</Directory>

And the status of my directory:

$ ls -la /home/httpd/DAV/
total 8
drwxr-xr-x 2 http http 4096 10 avril 19:29 .
drwxr-xr-x 4 root root 4096 10 avril 19:27 ..
-rw-r--r-- 1 http http    0 10 avril 19:29 DAVLock.dir
-rw-r--r-- 1 http http    0 10 avril 19:29 DAVLock.pag

$ ls -la /home/httpd/html/    
total 12
drwxr-xr-x 3 root   root   4096 10 avril 19:27 .
drwxr-xr-x 4 root   root   4096 10 avril 19:27 ..
drwxr-xr-x 2 nobody nobody 4096 11 avril 10:38 dav

Thanks for any help !

Last edited by Louson (2015-04-11 10:41:10)

If you are getting this error:

WebDAV 403 - Forbidden Access is denied. Server Error: 403 - Forbidden: Access is denied.You do not have permission to view this directory or page using the credentials that you supplied.

Here are the steps to solve it:

Step 1

Make sure that your ntfs permissions is set for the user that is trying to connect to WebDAV

Step 2

You need to create an Authoring Rules for the user that is trying to connect to WebDAV

Hello,

I have followed the WebDav wiki and I get the error 403 Forbidden:

$ cadaver http://127.0.0.1/dav
dav:/dav/> mkcol test
Creating `test': failed:
403 Forbidden
dav:/dav/> 

I have looked the forum pages
* 403 Forbidden Error on directory but not on index page which actually uses owncloud’s webdav
* [SOLVED] Apache and user directory
And also tried what is said in the discussion page

But I can’t find the problem.

/var/log/httpd/access_log:

127.0.0.1 - - [11/Apr/2015:12:16:46 +0200] "OPTIONS /dav/ HTTP/1.1" 200 -
127.0.0.1 - - [11/Apr/2015:12:16:46 +0200] "PROPFIND /dav/ HTTP/1.1" 207 683
127.0.0.1 - - [11/Apr/2015:12:16:56 +0200] "MKCOL /dav/test/ HTTP/1.1" 403 977

/var/log/httpd/access_log:

[Sat Apr 11 12:14:42.113880 2015] [dav:error] [pid 22639:tid 140478398338816] (13)Permission denied: [client 127.0.0.1:46716] Unable to create collection.  [403, #0]

/etc/httpd/cond/httpd.conf: (full conf if here)

DAVLockDB /home/httpd/DAV/DAVLock
Alias /dav "/home/httpd/html/dav"
<Directory "/home/httpd/html/dav">
  DAV On
  AllowOverride None
  Options Indexes FollowSymLinks
  Require all granted
</Directory>

And the status of my directory:

$ ls -la /home/httpd/DAV/
total 8
drwxr-xr-x 2 http http 4096 10 avril 19:29 .
drwxr-xr-x 4 root root 4096 10 avril 19:27 ..
-rw-r--r-- 1 http http    0 10 avril 19:29 DAVLock.dir
-rw-r--r-- 1 http http    0 10 avril 19:29 DAVLock.pag

$ ls -la /home/httpd/html/    
total 12
drwxr-xr-x 3 root   root   4096 10 avril 19:27 .
drwxr-xr-x 4 root   root   4096 10 avril 19:27 ..
drwxr-xr-x 2 nobody nobody 4096 11 avril 10:38 dav

Thanks for any help !

Last edited by Louson (2015-04-11 10:41:10)

  • Support
  • Downloads
  • Knowledge Base
  • German
  • Spanish
  • Italian
  • French
  • HGST Support

I configured Apache2 to allow WebDav on a directory (CentOS 5 / Plesk 8.6):

  • WebDav is enabled in httpd.conf
  • /var/lib/dav/lockdb is writeable by Apache
  • My target dir is chmod 777
  • My target dir is chowned apache:psacln
  • using Basic Authentication (setup by Plesk interface)

in my vhost.conf I have:

<Directory /var/www/vhosts/domain.com/httpdocs/target_dir>
        Dav On
    AllowOverride none
        Order allow,deny
        Allow from all
</Directory>

I can connect to the directory using authentication fine and download files from it. But I cannot write to the dir. I get a 403 Error when I attempt to upload or create a dir.

Anyone have any tips?

Thanks in advance —

Update — 6/5 Using the comments below I’ve isolated the issue to being some type of conflict with .htpasswd protected directories. I can created an unprotected dir and enable WebDAV uploads fine. But once I enable Basic Auth on the directory everything goes south. I can read but no longer upload.

This is my vhost.conf:

<Directory /var/www/vhosts/domain.com/subdomains/subdomain/httpdocs/>
        AuthUserFile /var/www/.htpasswd
        AuthName "Login"
        AuthType Basic
        Require valid-user

        DAV on
    AllowOverride none
        <Limit PUT POST DELETE PROPFIND PROPPATCH MKCOL COPY MOVE LOCK UNLOCK>
                Require valid-user
        </Limit>
</Directory>

Update 6/6

Was able to get WebDAV working on a different domain with minimal effort. The only difference between the two domains is that in the one which refuses to allow write access I have a DocumentRoot directive:

    DocumentRoot /var/www/vhosts/domain.com/httpdocs/app/webroot

Might this be causing some problems?

  • Remove From My Forums
  • Question

  • User764211229 posted

    I am running Windows server 2008 R2 with IIS7 and the built in webDAV module. The server is being used to host a drupal site and I need to access the files and folders for editing purposes. I have gotten the webDAV side of things to work with a local user
    via basic authentication, and I can navigate and view the files in the wwwroot/drupal folder. However, there are some files that when I try to copy/open them through webDAV they come back with an HTTP Forbidden error. I have not been able to come up with a
    pattern of why some are able to be opened and others are not.

    I have verified all the permissions settings in IIS and NTFS folders, the permissions are the same for all the folders in the wwwroot/drupal folder however, I am still not able to access some of the files for some reason.

    I have disabled request filtering, and I have even enabled request filtering and then made a rule to allow all file types, but there are still some files that will not cooperate. 

    If anyone has any ideas, I would greatly appreciate it.

    Please let me know if you need any additional information.

    Thank you in advance!

Answers

  • User-176674611 posted

    Hi,

    I suggest you check the webdav authoring rules. Ensure that it is not the rules that prevent you from accessing the specifc files successfully. Also for process monitor, it you correctly set the filters, it should show some clues for this failure.

    Thanks.

    • Marked as answer by

      Tuesday, September 28, 2021 12:00 AM

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and
privacy statement. We’ll occasionally send you account related emails.

Already on GitHub?
Sign in
to your account

Closed

enoch85 opened this issue

May 8, 2014

· 26 comments

Closed

Fatal webdav: Sabre_DAV_Exception_Forbidden:

#8501

enoch85 opened this issue

May 8, 2014

· 26 comments

Comments

@enoch85

(Sorry for not using the issue form, I didn´t find it…)

I have my sync client connected to a single folder on one of my comupters. The folder that´s connected is Dropbox and I sync a small amount of files.

Recently I noticed that I got
«Fatal webdav Sabre_DAV_Exception_Forbidden:». And this message is getting logged at the same time as I try to upload some files with the desktop sync-client.

At th same time the files dosen´t get synced to my dropbox accont, and the client shows me the same error. 404 forbidden.

I don´t know if it´s related to the sync client or to the core, so I begin with posting the issue here.

Client

1.5.4 (Windows 8.1)

1.5.5 (Android)

Server

OC 6.0.3

PHP & MySQL

Everything is updated to the latest

Server Enviroment

Ubuntu Server (viritual)

Logs

Owncloud.log — as posted above

@PVince81

@enoch85 for the issue template it is very simple, only three clicks: first click «New issue», then on the top there is a not too visible link «guidelines for contributing», then under the «TL;DR» is the link 😉

Can you redo the same test but with a folder that isn’t connected to Dropbox ? I just want to find out whether it’s related to the Dropbox ext storage.

It would also help if you could formulate your test case in steps, what you do first, then seconds.
Then, say «at step S the log shows XYZ». For clarity 😄 , especially if things seem to happen at the same time.

Thanks.

@enoch85

Thanks! @PVince81

Steps to reproduce:

  1. Take any file
  2. Copy it into a folder that exits in the ownCloud sync folder towards Dropbox.
  3. 404 Forbidden is shown

In other words; it´s Dropbox related.

Note; the folder in the ownCloud sync folder towards Dropbox only exits there and not in the original Dropbox account. Maybe because the ownCloud sync client haven´t succeeded to sync those folders and files.

Dropbox folder:
drobox folder
Owncloud folder:
owncloud folder

@PVince81

Can you try with a folder that doesn’t have any funny accents ? 😄

@enoch85

Ok, so there was the problem.

  1. Uploaded «install.txt» (no errors)
  2. Changed name to «åäö.txt» (404 — Forbidden)
  3. «åäö.txt» was automatically removed(!?)

@PVince81

Removed ? What do you mean ?

From your step 1 it means that there are encoding issues when uploading to Dropbox.

@PVince81

@realriot do you have any idea regarding the Dropbox client an file name encoding ?

@enoch85

@PVince81 Yes, the file was removed ~5 seconds after «404 Forbidden» by the Owncloud client.

@realriot

@PVince81 I cannot reproduce the behaviour…

  • Mounted the Dropbox into my owncloud
  • Added an folder within my dropbox «åäö.txt»
  • Mounted the owncloud in my windows system via webdav
  • Accessed the «åäö.txt» folder
  • Renamed the folder

Everything worked fine…

@PVince81

@realriot thanks for trying it out.

@enoch85 can you try finding out what exact set of operations causes your issue ?
You mentionned copying a file into the Dropbox folder, did you mean on the client side ?
The issue could be when uploading from the sync client / webdav instead of the web UI.
Such details would be useful to debug this 😄

@enoch85

Ok, so theese are the steps in detail:

I used the folder from the owncloud client, and I had the Dropbox WebUI to test if the files got synced.

  1. Uploaded «install.txt» via Owncloud client folder (the file where synced to Dropbox with no errors)
  2. Changed name on the file from «install.txt» to «åäö.txt» in Owncloud client folder (and did not sync to Dropbox, 404 — Forbidden)
  3. «åäö.txt» was automatically removed ~5 seconds after I got 404-Forbidden by the Owncloud client.

I hope that sort things out a bit more. 😄

@PVince81

Cool, thanks. So the error is possibly when renaming files, not uploading.

@enoch85

Yes maybe, but another thing I noticed now is that if I upload things to Dropbox WebUI the Owncloud client doesn’t sync them. It only syncs the files uploaded through the Owcloud client.

@PVince81

@realriot

I’ve tested the encoding problem with my webdav/dropbox solution. works without problem. Seems that there’s a «player» in the row which converts the encoding the wrong way? Just my thougths…

@enoch85

Saw this now in my log: Error files_external Curl error: (7) couldn’t connect to host

Related?

@PVince81

@realriot what do you mean with «player» ?

@enoch85 I believe that the Dropbox client lib is using curl, so if it sometimes cannot connect you might see such errors.

@enoch85

@enoch85

@enoch85

@enoch85

@PVince81

This ticket seemed to be related to renaming files on Dropbox, when putting special chars in it ? And that would cause the «Forbidden» to appear ?

@enoch85

Not using Dropbox anymore, so can’t tell you right now. But yes, I think this is Dropbox related. Keep open / Close / Fix? @PVince81

@PVince81

I’ll try and reproduce it first.

@enoch85

Setting milestone 8.2 as @DeepDiver1975 said you will take a look at Dropbox then.

@enoch85
enoch85

added this to the
8.2-next milestone

Mar 23, 2015

@PVince81

@PVince81

Dropbox works for me properly, even with special characters. I tried renaming a file «test.txt» to «aöäe.txt» and also moving it into a subdir. All worked fine.

I’ll close this, maybe it was an old issue or something.

@lock
lock
bot

locked as resolved and limited conversation to collaborators

Aug 12, 2019

Thanks you for your hint. Unfortunately, it doesn’t work yet, nor from browser or even evolution. Calling ‘https://mail.home.lan/webdav/olaf@home.lan’ gives on webdav’s docker host logs:

    $ tail -f /var/log/radicale/radicale.log
    2017-11-05 13:34:25,271 - INFO: GET request at /webdav/olaf@home.lan received
    2017-11-05 13:34:25,275 - DEBUG: Request headers:
    {'CONTENT_LENGTH': '',
     'CONTENT_TYPE': 'text/plain',
     'GATEWAY_INTERFACE': 'CGI/1.1',
     'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
     'HTTP_ACCEPT_ENCODING': 'gzip, deflate, br',
     'HTTP_ACCEPT_LANGUAGE': 'en-US,en;q=0.5',
     'HTTP_AUTHORIZATION': 'Basic b2xhZkBob21lLmxhbjpvbGFmNjk=',
     'HTTP_CACHE_CONTROL': 'max-age=0',
     'HTTP_CONNECTION': 'close',
     'HTTP_HOST': 'webdav:5232',
     'HTTP_UPGRADE_INSECURE_REQUESTS': '1',
     'HTTP_USER_AGENT': 'Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:56.0) Gecko/20100101 Firefox/56.0',
     'PATH_INFO': '/webdav/olaf@home.lan',
     'QUERY_STRING': '',
     'REMOTE_ADDR': '172.18.0.12',
     'REMOTE_HOST': '',
     'REQUEST_METHOD': 'GET',
     'SCRIPT_NAME': '',
     'SERVER_NAME': 'dd853d83a0a8',
     'SERVER_PORT': '5232',
     'SERVER_PROTOCOL': 'HTTP/1.0',
     'SERVER_SOFTWARE': 'WSGIServer/0.1 Python/2.7.13',
     'wsgi.errors': <open file '<stderr>', mode 'w' at 0x7ffaa7e891e0>,
     'wsgi.file_wrapper': <class wsgiref.util.FileWrapper at 0x7ffaa485eae0>,
     'wsgi.input': <socket._fileobject object at 0x7ffaa45b9ed0>,
     'wsgi.multiprocess': False,
     'wsgi.multithread': True,
     'wsgi.run_once': False,
     'wsgi.url_scheme': 'http',
     'wsgi.version': (1, 0)}
    2017-11-05 13:34:25,276 - DEBUG: Sanitized path: /olaf@home.lan
    2017-11-05 13:34:25,277 - DEBUG: Connecting to IMAP server imap:993.
    2017-11-05 13:34:26,543 - DEBUG: Authenticated IMAP user olaf@home.lan via imap.
    2017-11-05 13:34:26,544 - DEBUG: Rights type 'owner_only'
    2017-11-05 13:34:26,545 - DEBUG: Test if 'olaf@home.lan:/' matches against '.+:^olaf\@home\.lan(/.*)?$' from section 'rw'
    2017-11-05 13:34:26,546 - DEBUG: Section 'rw' does not match
    2017-11-05 13:34:26,546 - DEBUG: olaf@home.lan has NO read access to collection /
    2017-11-05 13:34:26,546 - DEBUG: Rights type 'owner_only'
    2017-11-05 13:34:26,547 - DEBUG: Test if 'olaf@home.lan:/' matches against '.+:^olaf\@home\.lan(/.*)?$' from section 'rw'
    2017-11-05 13:34:26,547 - DEBUG: Section 'rw' does not match
    2017-11-05 13:34:26,547 - DEBUG: olaf@home.lan has NO write access to collection /
    2017-11-05 13:34:26,548 - DEBUG: Connecting to IMAP server imap:993.
    2017-11-05 13:34:27,793 - DEBUG: Authenticated IMAP user olaf@home.lan via imap.
    2017-11-05 13:34:27,794 - DEBUG: Answer status: 403 Forbidden

Using ‘https://mail.home.lan/webdav/olaf@home.lan’ as Adress entry on evolution no logs are shown.

Понравилась статья? Поделить с друзьями:
  • Web2l activex control ошибка загрузки криптографической подсистемы нрд
  • Web of science произошла системная ошибка
  • Web ошибка 419
  • Web config ошибка 500
  • We like to read fairy tales исправить ошибки