Apache 2.0.44 offers download instead of executing Batch File

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....


Go Back   Usenet Forums > Web Server and Related Forums > Windows Web Servers

FAQ Members List Calendar Search Today's Posts Mark Forums Read

 

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-01-2003
Lars Duelfer
 
Posts: n/a
Default Apache 2.0.44 offers download instead of executing Batch File

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
  #2 (permalink)  
Old 07-02-2003
The Other Guy
 
Posts: n/a
Default Re: Apache 2.0.44 offers download instead of executing Batch File

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.
  #3 (permalink)  
Old 07-02-2003
rach
 
Posts: n/a
Default Re: Apache 2.0.44 offers download instead of executing Batch File

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



  #4 (permalink)  
Old 07-03-2003
jorge
 
Posts: n/a
Default Re: Apache 2.0.44 offers download instead of executing Batch File

try naming them cgi or pl, ie knows .bat as a dos script
  #5 (permalink)  
Old 07-04-2003
jorge
 
Posts: n/a
Default Re: Apache 2.0.44 offers download instead of executing Batch File

is the firest line:
#!c:\perl\bin\perl.exe
You need ti chage the path to your perl.exe
  #6 (permalink)  
Old 07-05-2003
Lars Dülfer
 
Posts: n/a
Default Re: Apache 2.0.44 offers download instead of executing Batch File

I used a FORM to execute the batch file.
It worked with the Apache 1.3 (but only with die post-method)

The server doesn't make an error message, it simply does nothing.

Lars
  #7 (permalink)  
Old 07-06-2003
jorge
 
Posts: n/a
Default Re: Apache 2.0.44 offers download instead of executing Batch File

is it a script you made?
Ifso is a content-type given?
  #8 (permalink)  
Old 07-07-2003
rach
 
Posts: n/a
Default Re: Apache 2.0.44 offers download instead of executing Batch File

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?



  #9 (permalink)  
Old 07-07-2003
jorge
 
Posts: n/a
Default Re: Apache 2.0.44 offers download instead of executing Batch File

hmmz, I'm not good at perl but does this work?
#!/usr/local/bin/perl
print "Content-type: text/html\n\n";
print "<H1>Hello World</H1>\n";
  #10 (permalink)  
Old 07-07-2003
The Other Guy
 
Posts: n/a
Default Re: Apache 2.0.44 offers download instead of executing Batch File

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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 08:35 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0