Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
A donation makes a contribution towards the costs, the time and effort that's going in this site and building.
Thank You! Steffen
Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
| |
|
Topic: method PUT is not allowed for this URL |
|
| Author |
|
oliv2831
Joined: 16 Mar 2026 Posts: 1
|
Posted: Mon 16 Mar '26 19:57 Post subject: method PUT is not allowed for this URL |
|
|
Hello,
My goal is to configure an 2.4.66 Apache instance on Debian 13 to accept file uploads from local IP phones using PUT method.
I've tested many combinations of the following config:
| Code: | <VirtualHost *:80>
ServerAdmin jdoe@example.com
Alias / /srv/tftp/
DocumentRoot /srv/tftp/
LogLevel debug
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory "/srv/tftp/">
Options Indexes FollowSymLinks
AllowOverride None
<Limit GET POST OPTIONS PUT DELETE>
Require all granted
</Limit>
</Directory>
<Location "/yealink/uploads/toto.txt">
AllowMethods GET POST OPTIONS PUT DELETE
Script PUT /cgi-bin/file_upload.php
</Location>
</VirtualHost> |
I'm testing with :
curl --verbose -T /tmp/toto.txt http://192.168.4.5/yealink/uploads/toto.txt
...
<html><head>
<title>405 Method Not Allowed</title>
</head><body>
<h1>Method Not Allowed</h1>
<p>The requested method PUT is not allowed for this URL.</p>
Error.log shows:
| Code: | [Mon Mar 16 18:40:58.257519 2026] [authz_core:debug] [pid 66299:tid 66306] mod_authz_core.c(815): [client 192.168.4.187:56986] AH01626: authorization result of Require all granted: granted
[Mon Mar 16 18:40:58.257768 2026] [authz_core:debug] [pid 66299:tid 66306] mod_authz_core.c(815): [client 192.168.4.187:56986] AH01626: authorization result of <RequireAny>: granted
[Mon Mar 16 18:40:58.257880 2026] [authz_core:debug] [pid 66299:tid 66306] mod_authz_core.c(815): [client 192.168.4.187:56986] AH01626: authorization result of Require all granted: granted
[Mon Mar 16 18:40:58.257888 2026] [authz_core:debug] [pid 66299:tid 66306] mod_authz_core.c(815): [client 192.168.4.187:56986] AH01626: authorization result of <RequireAny>: granted |
My script file /usr/lib/cgi-bin/file_upload.php is:
| Quote: | <?php
error_log("Current user is ".get_current_user());
$data = file_get_contents("php://input");
//$output_filename = $_SERVER['DOCUMENT_ROOT'].$_SERVER['REQUEST_URI'];
$output_filename = $_SERVER['DOCUMENT_ROOT'].$_SERVER['PATH_INFO'];
$code = file_put_contents($output_filename, $data);
if (strlen($data) !== $code)
error_log("Error code while writing ".$output_filename.": input length is ".strlen($data)." while output length is ".$code);
?> |
How can I get this working ?
Best regards |
|
| Back to top |
|
Stray78

Joined: 15 Apr 2024 Posts: 57 Location: USA
|
Posted: Mon 16 Mar '26 21:51 Post subject: |
|
|
| Do you have mod_actions enabled? |
|
| Back to top |
|
|
|
|
|
|