Page 1 of 2

"SOLVED" "PUT" Support for XAMPP Lite

PostPosted: 14. April 2009 21:08
by steffenbaier
See last post this is now solved !

Hi all,

I am trying to get Xampplite to support "put". Unfortunately I have not real experience with Webservers ;-)

A Wireless DECT Server needs "PUT" in order to upload it's configuration and using google to search for it does not show up to many results that helped me so far.
I understood that I need CGI Support for PUT to be able to work.

Here is what I have done so far:

Downloaded Xampplite from here:

http://www.apachefriends.org/download.p ... -1.7.0.exe

Un-rarred to c:\xampplite

Run the setup_xampp.bat

Created a Directory within C:\xampplite\htdocs called Kirk and within this a directory called backup

Opened a Text Editor and create a file called backup.txt with this content:

Code: Select all
mod cmd UP0 scfg http://172.27.12.54/kirk/backup/#d#h#b5.txt


And stored this within the C:\xampplite\htdocs\kirk\backup directory

Above file is opened by the DECT (Cordless Phone Server) and tells it were to put the configuration file

Downloaded the following CGI Script: http://www.apacheweek.com/issues/put1

from here: http://www.apacheweek.com/features/put and stored it as a txt file called put.cgi within: C:\xampplite\htdocs\kirk\backup

Change the Top line in the put.CGI into :
Code: Select all
#!C:/xampplite/perl/bin/perl


Open the httpd.conf within C:\xampplite\apache\conf change the:

Code: Select all
<Directory />
    Options FollowSymLinks


into:

Code: Select all
<Directory />
    Options FollowSymLinks ExecCGI


and add to the:

Code: Select all
<IfModule dir_module>
    DirectoryIndex index.php index.php4 index.php3 index.cgi index.pl index.html index.htm index.shtml index.phtml

the put.cgi script as know module

Started xamp via xampp_start.exe within C:\xampplite

I can see within the access.log file the following:

Code: Select all
172.27.5.130 - - [14/Apr/2009:17:52:30 +0100] "GET /kirk/backup/backup.txt?ver=6.00+dvl-sr2+IP1200%5B09-60700.80%5D%2C+Bootcode%5B366%5D%2C+HW%5B30%5D+8192%2F32768&PROT=08-60700.75&CFG-BACKUP-NUM=1 HTTP/1.1" 200 55
172.27.5.130 - - [14/Apr/2009:17:52:30 +0100] "PUT /kirk/backup/00-90-33-0f-23-a2.txt HTTP/1.1" 405 1043


I can run the put.cgi script manually within a MS-Dos Box:

Code: Select all
C:\xampplite\perl\bin>perl.exe c:\xampplite\htdocs\kirk\backup\put.cgi
Status: 500
Content-Type: text/html

<HEAD><TITLE>Error</TITLE></HEAD><H1>Error Publishing File</H1> An error occurred publishing this file (Request method is not PUT).



Any Hints ...?

Thanks

Steffen

Re: NEED "PUT" Support for XAMPP Lite

PostPosted: 14. April 2009 21:57
by Wiedmann

Re: NEED "PUT" Support for XAMPP Lite

PostPosted: 14. April 2009 22:02
by steffenbaier
Is that added to the httpd.conf?

Re: NEED "PUT" Support for XAMPP Lite

PostPosted: 15. April 2009 09:38
by steffenbaier
OK,

I tried:
Code: Select all
DocumentRoot "/xampplite/htdocs"
<Directory />
    Options FollowSymLinks ExecCGI
    AllowOverride None
    Order deny,allow
    Allow from all
    Script PUT /kirk/backup/put.cgi
</Directory>


and get:

Code: Select all
172.27.5.130 - - [15/Apr/2009:09:32:30 +0100] "PUT /kirk/backup/00-90-33-0f-23-a2.txt HTTP/1.1" 500 142


then I tried:

Code: Select all
DocumentRoot "/xampplite/htdocs"
<Directory />
    Options FollowSymLinks ExecCGI
    AllowOverride None
    Order deny,allow
    Allow from all
    Script PUT /xamplite/htdocs/kirk/backup/put.cgi
</Directory>


and got:

Code: Select all
172.27.5.130 - - [15/Apr/2009:09:35:30 +0100] "PUT /kirk/backup/00-90-33-0f-23-a2.txt HTTP/1.1" 405 1043


Any hints are gladly taken ;-)

Steff

Re: NEED "PUT" Support for XAMPP Lite

PostPosted: 15. April 2009 09:47
by Wiedmann
Code: Select all
Script PUT /kirk/backup/put.cgi

That's correct. But you should enable this only for the directory "/xamplite/htdocs/Kirk".

172.27.5.130 - - [15/Apr/2009:09:32:30 +0100] "PUT /kirk/backup/00-90-33-0f-23-a2.txt HTTP/1.1" 500
142

Read the "error.log".

Re: NEED "PUT" Support for XAMPP Lite

PostPosted: 15. April 2009 11:22
by steffenbaier
Hi,

thanks again for your help but I think I am a bit "thick" ...

Part of my HTTPD.conf:
Code: Select all
DocumentRoot "/xampplite/htdocs/kirk"
<Directory />
    Options FollowSymLinks ExecCGI
    AllowOverride None
    Order deny,allow
    Allow from all
    Script PUT /backup/put.cgi
</Directory>
<Directory "/xampplite/htdocs/kirk">
    Options Indexes FollowSymLinks Includes ExecCGI
    AllowOverride All
    Order allow,deny
    Allow from all
      Script PUT /backup/put.cgi
</Directory>


my "script" being called by the DECT server:

Code: Select all
mod cmd UP0 scfg http://172.27.12.54/backup/#m.txt


access.log:

Code: Select all
172.27.5.130 - - [15/Apr/2009:11:20:14 +0100] "GET /backup/backup.txt?ver=6.00+dvl-sr2+IP1200%5B09-60700.80%5D%2C+Bootcode%5B366%5D%2C+HW%5B30%5D+8192%2F32768&PROT=08-60700.75&CFG-BACKUP-NUM=1 HTTP/1.1" 200 50
172.27.5.130 - - [15/Apr/2009:11:20:14 +0100] "PUT /backup/00-90-33-0f-23-a2.txt HTTP/1.1" 500 1168


error.log:

Code: Select all
[Wed Apr 15 11:20:14 2009] [error] [client 172.27.5.130] (OS 3)The system cannot find the path specified.  : couldn't create child process: 720003: put.cgi
[Wed Apr 15 11:20:14 2009] [error] [client 172.27.5.130] (OS 3)The system cannot find the path specified.  : couldn't spawn child process: C:/xampplite/htdocs/kirk/backup/put.cgi

Re: NEED "PUT" Support for XAMPP Lite

PostPosted: 15. April 2009 11:28
by steffenbaier
quick update to the error above...

I had missed the correct Path for Perl in the put.cgi

Code: Select all
#!C:/xampplite/perl/bin/perl.exe


Now I only get this in the access.log and no error in the error.log

Code: Select all
172.27.5.130 - - [15/Apr/2009:11:26:14 +0100] "GET /backup/backup.txt?ver=6.00+dvl-sr2+IP1200%5B09-60700.80%5D%2C+Bootcode%5B366%5D%2C+HW%5B30%5D+8192%2F32768&PROT=08-60700.75&CFG-BACKUP-NUM=1 HTTP/1.1" 200 50
172.27.5.130 - - [15/Apr/2009:11:26:14 +0100] "PUT /backup/00-90-33-0f-23-a2.txt HTTP/1.1" 500 142

Re: NEED "PUT" Support for XAMPP Lite

PostPosted: 15. April 2009 11:31
by Wiedmann
Part of my HTTPD.conf:

You remember?
--> Only for "/xampplite/htdocs/kirk"

Code: Select all
Script PUT /backup/put.cgi

I'm not sure at the moment: Is this the correct URI for the file "put.cgi"? (In which directory did you have this file?)
(IMHO should be "/kirk/put.cgi" or /kirk/backup/put.cgi")

Re: NEED "PUT" Support for XAMPP Lite

PostPosted: 15. April 2009 11:52
by steffenbaier
Hi,

thanks for your patience ;-)

put.cgi is within:
Code: Select all
C:\xampplite\htdocs\kirk\backup>dir
 Volume in drive C has no label.
 Volume Serial Number is F4C6-3994

 Directory of C:\xampplite\htdocs\kirk\backup

15/04/2009  11:47    <DIR>          .
15/04/2009  11:47    <DIR>          ..
15/04/2009  10:28                50 backup.txt
15/04/2009  11:47             2,580 put.cgi
               2 File(s)          2,630 bytes
               2 Dir(s)  119,019,667,456 bytes free

C:\xampplite\htdocs\kirk\backup>


I did not understand your reference above:
You remember?
--> Only for "/xampplite/htdocs/kirk"


As I understand I specify the directory for document root and the ones that are served when a directory is requested

Therefore in the http.conf:

Code: Select all
DocumentRoot "/xampplite/htdocs/kirk"

<Directory />
    Options FollowSymLinks ExecCGI
    AllowOverride None
    Order deny,allow
    Allow from all
    Script PUT /kirk/backup/put.cgi
</Directory>


and
Code: Select all
#
<Directory "/xampplite/htdocs/kirk">
 Options Indexes FollowSymLinks Includes ExecCGI
 AllowOverride All
 Order allow,deny
 Allow from all
Script PUT /kirk/backup/put.cgi
</Directory>


Would you have a downloadable example or should we switch to German instead...?

access.log:
Code: Select all
172.27.5.130 - - [15/Apr/2009:11:51:14 +0100] "GET /backup/backup.txt?ver=6.00+dvl-sr2+IP1200%5B09-60700.80%5D%2C+Bootcode%5B366%5D%2C+HW%5B30%5D+8192%2F32768&PROT=08-60700.75&CFG-BACKUP-NUM=1 HTTP/1.1" 200 50
172.27.5.130 - - [15/Apr/2009:11:51:14 +0100] "PUT /backup/00-90-33-0f-23-a2.txt HTTP/1.1" 405 1043

and nothing in the error log ... :cry:

Re: NEED "PUT" Support for XAMPP Lite

PostPosted: 15. April 2009 11:58
by Nobbie
steffenbaier wrote:A Wireless DECT Server needs "PUT" in order to upload it's configuration and using google to search for it does not show up to many results that helped me so far.
I understood that I need CGI Support for PUT to be able to work.


I think you are completely wrong with that. The DECT Server (which runs a webserver inside) has a CGI Service which can be triggered by the (standard) HTTP Request PUT (not used very often, but part of the HTTP specification). See WebDav for more Information.

I dont believe that you have to set up a webserver which supports a PUT Request, you have to find a browser which supports a PUT Request in order to trigger the PUT Script on the Kirk DECT Server. With this PUT Request you might upload a new configuration to that DECT Server or similar. A PUT Request is a kind of Upload, whereas a GET is a kind of download.

Could you show us the documentation, where you read about this PUT Script of your Kirk DECT router?

Re: NEED "PUT" Support for XAMPP Lite

PostPosted: 15. April 2009 12:02
by steffenbaier
Hi,

thanks for the interest...
The actual Software for this Part is programmed by Innovaphone from Germany.

Admin Guide here: http://www.polycom.eu/global/documents/ ... _guide.pdf Page 191

• One or more Web server(s) accessible by the devices.
• the Web servers tested were MS IIS and the Apache server. It should, however, also
work with all other common Web servers.
• For best results, the Web server should be able to manage a large number of
simultaneous HTTP sessions. MS Personal Web Server, for example, is not a suitable
Web server, since it manages a maximum of 10 simultaneous HTTP sessions.


I could provide a wireshark trace if this helps ;-)

Re: NEED "PUT" Support for XAMPP Lite

PostPosted: 15. April 2009 12:11
by Wiedmann
Hmm,

172.27.5.130 - - [15/Apr/2009:11:51:14 +0100] "PUT /backup/00-90-33-0f-23-a2.txt HTTP/1.1" 405 1043

172.27.5.130 - - [15/Apr/2009:09:35:30 +0100] "PUT /kirk/backup/00-90-33-0f-23-a2.txt HTTP/1.1" 405 1043


Your device is accessing " /backup/" or "/kirk/backup/"?

Re: NEED "PUT" Support for XAMPP Lite

PostPosted: 15. April 2009 12:17
by steffenbaier
Wiedmann wrote:Hmm,

172.27.5.130 - - [15/Apr/2009:11:51:14 +0100] "PUT /backup/00-90-33-0f-23-a2.txt HTTP/1.1" 405 1043

172.27.5.130 - - [15/Apr/2009:09:35:30 +0100] "PUT /kirk/backup/00-90-33-0f-23-a2.txt HTTP/1.1" 405 1043


Your device is accessing " /backup/" or "/kirk/backup/"?


Hi,

it should access
Code: Select all
C:\xampplite\htdocs\kirk\backup


within the http.conf I specify that the Document root is:
Code: Select all
"/xampplite/htdocs/kirk"


via GET it loads the backup.txt from :
Code: Select all
C:\xampplite\htdocs\kirk\backup\
and shows in the access.log:
Code: Select all
"GET /backup/backup.txt?ver=6.00+dvl-sr2+IP1200%5B09-60700.80%5D%2C+Bootcode%5B366%5D%2C+HW%5B30%5D+8192%2F32768&PROT=08-60700.75&CFG-BACKUP-NUM=1 HTTP/1.1" 200 50


It then executes the backup.txt and "should" PUT the created file mac-address.txt into /backup Directory within
Code: Select all
C:\xampplite\htdocs\kirk\

Re: NEED "PUT" Support for XAMPP Lite

PostPosted: 15. April 2009 12:20
by Wiedmann
it should access

Your device was using two different URI's for the PUT (not GET) request. Why?

Re: NEED "PUT" Support for XAMPP Lite

PostPosted: 15. April 2009 12:30
by steffenbaier
Hi,

I was trying to adopt some of the changes you suggested (http.conf) and must have changed the URL within the backup.txt and therefore the access.log reflects this.

I have attached my http.conf,backup.txt and put.cgi

http://www.2shared.com/file/5357135/f0f ... _test.html

I also just noticed that within the put.cgi I had specified:
Code: Select all
$putlog = "/tmp/put1.log";


and whilst I had the 500 error I got the following in the Log

Code: Select all
172.27.5.130 - C:\xampplite\htdocs\kirk\backup\00-90-33-0f-23-a2.txt status 500 (Content-Length missing or zero ())
but only until 11:05 UK time