This is a discussion on Apache 2.0.44 offers download instead of executing Batch File within the Windows Web Servers forums, part of the Web Server and Related Forums category; Hello Everybody, I would like to execute a batch file as a cgi skript. My server is an apache 2....
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hello Everybody,
I would like to execute a batch file as a cgi skript. My server is an apache 2.0.44 under windows. After calling the skript via a HTML-Form, the server offers me to save or open the batch file but doesn't execute it. I tried the same with an apache 1.3.something and it worked, Does anybody know, why it doesn't work with Apache 2.0.44. Thanx a lot for your answers. Lars |
|
|||
|
On 1 Jul 2003 15:46:24 -0700, The Other Guy responded to a post from
lars@summerbeats.de (Lars Duelfer) who wrote in comp.infosystems.www.servers.ms-windows: >Hello Everybody, > >I would like to execute a batch file as a cgi skript. My server is an >apache 2.0.44 under windows. After calling the skript via a HTML-Form, >the server offers me to save or open the batch file but doesn't >execute it. > >I tried the same with an apache 1.3.something and it worked, Does >anybody know, why it doesn't work with Apache 2.0.44. > >Thanx a lot for your answers. > >Lars A couple of things. It sounds like you haven't got your server set up properly for cgi. Do other cgi scripts work? What does your error log say when you access this file (if anything)? Are you using SSI exec for the batch file? Thanks, TOG -- ../configure --prefix=~/zyterion Not this guy or that guy, The Other Guy. This spot may contain a satirical comment or comedic source, and is meant to be funny. If you are easily offended, gullible or don't have a sense of humour we suggest you read elsewhere. |
|
|||
|
I have been working at this too. For the longest time I couldn't get ANY
batch file to work right till I tried this simple batch file: @echo off echo Content-Type: text/plain echo. echo Hello, world! But I still would get a download instead of execution with http://domain.com/cgi-bin/test.bat however doing this would execute it: http://domain.com/cgi-bin/test.bat? sometimes - then later just invoking http://domain.com/cgi-bin/test.bat would execute it and adding the ? at the end made it want to download.. The behavior is a little strange. I'm using the latest Apache2.0 on windows2000, and my error logs show no errors and I'm using the "ScriptInterpreterSource registry" directive to execute it in its "VirtualScriptAlias E:/apache-root/vhosts/%0/cgi-bin" directory. Rach "Lars Duelfer" <lars@summerbeats.de> wrote in message news:d14e6c4b.0307011446.3d1bfdbb@posting.google.c om... > Hello Everybody, > > I would like to execute a batch file as a cgi skript. My server is an > apache 2.0.44 under windows. After calling the skript via a HTML-Form, > the server offers me to save or open the batch file but doesn't > execute it. > > I tried the same with an apache 1.3.something and it worked, Does > anybody know, why it doesn't work with Apache 2.0.44. > > Thanx a lot for your answers. > > Lars |
|
|||
|
Yeap, test.pl:
#!e:\Programs\Perl\bin\perl.exe @echo off echo Content-Type: text/plain echo. echo Hello, world! And, test.bat @echo off echo Content-Type: text/plain echo. echo Hello, world! test.bat works with the ? at the end (sometimes) and test.pl just dumps with: "aborted due to compilation errors." Rach "jorge" <jorge@jorge.be> wrote in message news:734d12db.0307060009.4fe23a09@posting.google.c om... > is it a script you made? > Ifso is a content-type given? |
|
|||
|
On Mon, 07 Jul 2003 02:51:32 GMT, The Other Guy responded to a post
from "rach" <kjkfjgndfjg.fgdfg@dfgdnfgdf.net> who wrote in comp.infosystems.www.servers.ms-windows: >"jorge" <jorge@jorge.be> wrote in message >news:734d12db.0307060009.4fe23a09@posting.google. com... >> is it a script you made? >> Ifso is a content-type given? <top post reversed> >Yeap, test.pl: > >#!e:\Programs\Perl\bin\perl.exe >@echo off >echo Content-Type: text/plain >echo. >echo Hello, world! > >And, test.bat >@echo off >echo Content-Type: text/plain >echo. >echo Hello, world! > >test.bat works with the ? at the end (sometimes) and test.pl just dumps >with: "aborted due to compilation errors." > >Rach I would suggest doing a perl -c (in a DOS prompt) on your test.pl file to check your syntax. This will give you an indiction of the compilation errors. You have, it appears, the script on a different drive/partition than where the Apache server is located. Do you have proper permissions set for Apache to access that drive? The test.bat looks like it should work OK. You will need to include the "?" at the end in this case, I believe, because you want it to pass any parameters (which, I think, is everything) and to make it execute. HTH TOG -- ../configure --prefix=~/zyterion Not this guy or that guy, The Other Guy. This spot may contain a satirical comment or comedic source, and is meant to be funny. If you are easily offended, gullible or don't have a sense of humour we suggest you read elsewhere. |
| Thread Tools | |
| Display Modes | |
|
|