IIS 7.5 does not support Anonymous webdav PUTS which is required by Avaya phones and to properly backup. However there is a solution.
This will only Work on IIS 7.5.
- Uninstall or Disable webdav on the website or virtual directory.
- Create a empty rewrite rule as follows
- Requested URL: Matches the Pattern
- Using: Wildcards
- Pattern: *.txt
- Action Type: Rewrite
- Rewrite URL: avayaupload.php
- Put the script below into avayaupload.php
<?php
if ($_SERVER['REQUEST_METHOD'] == "PUT")
{ $f = fopen(basename($_SERVER['REQUEST_URI']), "w");
$s = fopen("php://input", "r");
while($kb = fread($s, 1024))
{ fwrite($f, $kb, 1024); }
fclose($f);
fclose($s);
Header("HTTP/1.1 201 Created"); }
elseif ($_SERVER['REQUEST_METHOD'] == "GET")
{ readfile(basename($_SERVER['REQUEST_URI'])); }
?>
You are going to need PHP installed. The easiest way is to install it from here http://www.microsoft.com/web/downloads/platform.aspx
Make sure your BRURI is set and your BRAUTH is 0. A quick test is to use curl from a unix or mac machine. curl -T test.txt http://avayabackupserver/backupdir test.txt will be uploaded to the server if everything is configured correctly.
*UPDATE
Please note that this was written for IIS 7.5 in 2008 r2 not for IIS 7.0 in 2008.

Stephen,
At what level do you apply the url re-write and where do you store the avayaupload.php file?
If BRURI = http://myserver/mydir
you put the script and redirect in /mydir
if BRURI = http://myserver
you put the script and the redirect in the root of the directory.
You must make sure the the user account can write to the directory.
Thanks for that.Unfortunately in our case, we are still experiencing issues.
We verified PHP is installed and working (any specific configs) and webdav is disabled?
We verified IIS and Anonymous accounts have write access to all related directories and the file is in the backup directory as well as the rewrite rule is applied to the directory.
We have used the following BRURIs :
http://IIShostIP/avaya/Location/userdata/avayaupload.php
http://IIShostIP/avaya/Location/userdata/avayaupload.php
However we are still getting the following IIS errors.
2010-09-01 19:35:29 IISHostIP GET /avaya/Location/userdata/avayaupload.php/8001_96xxdata.txt – 80 – AvayaIP
AVAYA/SPICE/v3.0+(9630)/Std/0.1 500 0 0 1812
2010-09-01 19:35:36 IISHostIP
PUT /avaya/Location/userdata/avayaupload.php/8001_96xxdata.txt – 80 – AvayaIP AVAYA/SPICE/v3.0+(9630)/Std/0.1 405 0 0 0
Any thoughts? Thanks in advance.
hey craig,
I see your problem
BRURI should be http://IIShostIP/avaya/Location/userdata/
the redirect rule tells iis that any text file uploaded to that directory avayaupload.php will process it.
Thanks. Sorry for the delayed response. I actually made a mistake in my last update . The BRURI was configured with and without the avayaupload.php in it and we get an HTTP error regardless. Can the backup location be a subdirectory in an IIS Virtual Directory or would it need to be it's own virtual directory? I believe we are 1 dotted i away from this working for us but cannot seem to pinpoint the source of the issue. Any thoughts are appreciated. Thanks.
Hey craig, click on the right to get my email address. I want more information that should not be put here.
Could you post your (suitably changed) 46xxsettings.txt as well please
I can't get this to work. I keep getting this when trying to test via curl:
HTTP verb used to access this page is not allowed.
The page you are looking for cannot be displayed because an invalid method (HTTP verb) was used to attempt access
I had to remove WebDAV completely in my environment to get this to work. Apparently Microsoft has some hooks for WebDAV even when it is disabled. After removing WebDAV, though, this solution worked like a charm!
What features need to be installed in iis 7.5 to get this to work? I had to download php 5.2 and install manually as this server has no access to the internet. i chose fastcgi and it made me install cgi for iis 7
Hi Stephen,
I have tried to follow all your instructions but I am still facing a problem…
Server Error
405 – HTTP verb used to access this page is not allowed.
The page you are looking for cannot be displayed because an invalid method (HTTP verb) was used to attempt access.
I would appreciate if you can help me.
Thanks in advance,
Seb
I get the .txt file created, but it is empty. Is there a permissions issue that I’m running into?
Stephen,
I have implemented your script on it own site with URL Rewrite set as you specify. When i test via curl the contents of the file i am sending REPLACE the avayaupload.php contents. After the first run there is no error but the file is no longer updated. Any ideas or more info I can provide for some assistence?
Hi Stephen, my php53_error.log gives me this error:
PHP Parse error: syntax error, unexpected T_IF in C:\inetpub\wwwroot\PhoneBackup\avayaupload.php on line 2
Line 2 looks like this (based off of what I copied from your post above:
2 if ($_SERVER['REQUEST_METHOD'] == “PUT”)
Any ides why I might be getting this error. I don’t know PHP or troubleshooting its sytax.
Thanks, Colleen
Hello, we also having issues getting our avaya phone backups… I have set up the rewrite rule to point to the php script. However, when i test (using curl) I get a 405 error. Any ideas why? I have put the text.txt file and .php file in default web application.
Got it working by reinstalling php… Now the Manual restore from back is not working just saying restore failed. Any reason why this would fail? Are there any other settings that need to be set?
You should use curl or wget from the command line to test GET and PUT to make sure permissions are right.
I am getting the 405 – HTTP verb used to access this page is not allowed.
Any troubleshooting steps I can try?
To fix the 405 HTTP Verb used to access this pages is not allowed problem –
Under Handler Mappings for your site in IIS, edit the module mapping for PHP.
Under Request Restrictions, in the verb tab add PUT to the existing verb list.
(Note: You may need to add double quotations around the executable path before you can click ok)
Hi Stephen,
Great tutorial. I’ve the same issue with IIS7.0. I’d to modify your code because there is no variable named $_SERVER['REQUEST_URI']. So I inserted this before:
if (!isset($_SERVER['REQUEST_URI'])) {
$_SERVER['REQUEST_URI'] = substr($_SERVER['PHP_SELF'],0 );
if (isset($_SERVER['QUERY_STRING']) AND $_SERVER['QUERY_STRING'] != "") {
$_SERVER['REQUEST_URI'] .= "?".$_SERVER['QUERY_STRING'];
}
}
Your script works after that but the content of the php file itself is replaced everytime a backup is made. Do you have any idea how to change this?
Cheers,
Danny
I made a solution for IIS 7.5 (or IIS7) based on ASP/VBSCRIPT only. So you don’t need to install PHP (which you should maintain.. patch..update..etc.).
See my script here: http://www.roelbroersma.nl/index.php/2011/10/17/how-to-backuprestore-avaya-to-iis7-5