Apache error "(405) Method Not Allowed" while saving to webserver

Post your questions about Web Server usage and Apache + PHP + MySQL/SQLite web applications.
Post Reply
giopas
Been there, done that
Posts: 848
Joined: Thu Mar 26, 2015 12:36 am
Location: somewhere in EU

Apache error "(405) Method Not Allowed" while saving to webserver

Post by giopas » Fri Aug 14, 2015 1:19 am

Hi folks,

as discussed here and here I am putting a database binary file on the webserver of my qnap to have the possibility to open it from remote (and sync it with the master file).

I can authenticate and open the file, I can write on it, but when I try to save it, I receive the following error (which actually is the same described here):

Code: Select all

Failed to save the current database to the specified location!

The remote server returned an error (405) Method Not Allowed.

The target file might be corrupted. Please try saving again. If that fails, save the database to a different location.

I think that the problem is in apache.conf or httpd.conf (or similar file) in relation to the subdirectory where this file is located (/share/Web/lock/).

I would therefore probably need to add some lines similar to the following (credits):

Code: Select all

<Directory />
    AllowOverride All
    <Limit GET HEAD POST PUT DELETE OPTIONS>
        Order Allow,Deny
        Allow from all
    </Limit>
</Directory>

However I am not skilled enough to modify without advise apache on my NAS as I don't want to open security flows, neither to clock me out of it. :roll:

Just to add some useful information, I report here the righes of the database file:

Code: Select all

[/share/Web/lock] # ls -l
-rwxrwx---    1 admin    administ     93742 Aug 13 02:34 database.db*
[/share/Web/lock] # stat -c "%a %n" *
770 database.db


Could you please help me guiding into the right direction?

Thanks,

giopas
Qnap TS-253Pro 16Gb RAM - Single Storage Pool: 2 WRed 4TB (RAID 1)
Qnap TS-453A 16Gb RAM - Single Storage Pool: 4 WRed 4TB (RAID 5)

giopas
Been there, done that
Posts: 848
Joined: Thu Mar 26, 2015 12:36 am
Location: somewhere in EU

Re: Apache error "(405) Method Not Allowed" while saving to webserver

Post by giopas » Sat Aug 15, 2015 5:14 pm

I come back to this point (it is the last piece I miss to complete my personal project).

I have continued researching and I have seen that this WebDAV issue could also be linked to MultiViews as reported here: http://sourceforge.net/p/keepass/bugs/1176/

I made some tests, but I am not sure how and where to look to disable it for this specific subdirectory of /share/Web/

Could someone please help me on this? Thanks!
Qnap TS-253Pro 16Gb RAM - Single Storage Pool: 2 WRed 4TB (RAID 1)
Qnap TS-453A 16Gb RAM - Single Storage Pool: 4 WRed 4TB (RAID 5)

giopas
Been there, done that
Posts: 848
Joined: Thu Mar 26, 2015 12:36 am
Location: somewhere in EU

Re: Apache error "(405) Method Not Allowed" while saving to webserver

Post by giopas » Wed Aug 19, 2015 5:12 pm

Hi,

thanks to the precious help of QoolBox :DD , I solved my problem, which was actually stupid:

1) activate WebDAV service in WebServer settings, then
2) create a shared folder (with the appropriate access rights)

and it is done! :oops:

You will see changes appearing on /mnt/HDA_ROOT/.config/apache/extra/apache-dav.conf

If you want to secure the folder even more requiring an SSL connection (and you don't want a simple redirect), then just create a .htaccess file in that folder with a single line:

Code: Select all

SSLRequireSSL

I hope this could help someone else solving this (at the end, dumb) problem.

giopas

ps: you can also add "Options -Indexes" to .htaccess to prevent automatic listing of the directory content if you want.
Qnap TS-253Pro 16Gb RAM - Single Storage Pool: 2 WRed 4TB (RAID 1)
Qnap TS-453A 16Gb RAM - Single Storage Pool: 4 WRed 4TB (RAID 5)

Post Reply

Return to “Web Server & Applications (Apache + PHP + MySQL / SQLite)”