Re: Premature end of script headers: cgi-bin .bat file problem with apache 2.0 on Win XP




Matija wrote:
> hello,
>
> I am trying to run a cgi-bin .bat file on an
> apache_2.0.55-win32-x86-no_ssl.msi on Win XP:

Huh? I'm not familiar with running batch files as cgi scripts.

>
> -- httpd.conf contains:
> ScriptAlias /cgi-bin/ "C:/HadocDoc_copie_COURANTE/cgi-bin/"
> <Directory "C:/HadocDoc_copie_COURANTE/cgi-bin">
> AllowOverride None
> Options ExecCGI # Options were None originally
> >
> AddHandler cgi-script .bat # not sure about this, none by default...
>

Sound's like stuff the apache group guys could decipher.

> -- it is called from HTML code:
> FORM action="/cgi-bin/AnalyseurHadoc.bat ..."
>
> -- and AnalyseurHadoc.bat starts some java code (outputting HTML):
> @echo off
> jre -cp C:\HadocDoc_copie_COURANTE\cgi-bin ... AnalyseurHadoc
>

Unless I'm way off here.... java is not cgi ... but I'm not sure.

> I get the following:
> on the web page with the FORM: Internal Server Error
> in the error.log: Premature end of script headers: AnalyseurHadoc.bat

Ahh ... something I recognize. This can mean a lot of things:
1. File permissions not set correctly ... make sure the file is
executable by all
2. Forgot to tell the script how to execute the code ... i.e. in perl
you need a #!/usr/bin/perl at the top of every page you want to execute
perl from. If java or batch files are cgi executables ... I'm sure you
need to tell it something similar.
3. Program errors ... make sure your script runs without errors from
the command line ... so if your program is program.bat make sure it
runs from the command line without errors before you try it in a web
browser.
4. See if there is anything else in the error logs ... usually the
message you got is accompanied by something else or some kind of error
code.
5. I'm sure there are more things that could be wrong here ... so I
put a 5 in just in case.

>
> the same Java code runs correctly on an older Apache 1.3-run Solaris,
> where the script file
> is a shell script.

Solaris=sun=java ... sometimes java will run fine on a Solaris machine
but not anything else .. You might want to check the version of java
you have and see if there are any differences compared to what you had
on the Solaris machine.

>
> any ideas?

I would find a good apache group and ask them how to get windows batch
files to run java as script files and how to setup the httpd.conf file
to do this.

I may be wrong here ... but when I think of cgi ... I think of perl ...
not batch files or java


>
>
> --
> PLEASE NOTE: comp.infosystems.www.authoring.cgi is a
> SELF-MODERATED newsgroup. aa.net and boutell.com are
> NOT the originators of the articles and are NOT responsible
> for their content.
>
> HOW TO POST to comp.infosystems.www.authoring.cgi:
> http://www.thinkspot.net/ciwac/howtopost.html


--
PLEASE NOTE: comp.infosystems.www.authoring.cgi is a
SELF-MODERATED newsgroup. aa.net and boutell.com are
NOT the originators of the articles and are NOT responsible
for their content.

HOW TO POST to comp.infosystems.www.authoring.cgi:
http://www.thinkspot.net/ciwac/howtopost.html
.



Relevant Pages

  • Re: Why PHP is so succesfull?
    ... Trent> sounds like a lot of hassle to me. ... I've never written CGI scripts with Java myself. ... copying my first Hello World CGI java script to your ...
    (comp.programming)
  • Re: Is it possible to avoid loading the script for each request
    ... I do not know PHP, consider to write a CGI with this technology and ... Is it possible to invoke a PHP script and let it endlessly wait for ... But you don't have to configure your PHP setup as CGI; ... PHP is not Java. ...
    (comp.lang.php)
  • Re: image gallery
    ... Does this mean i dont have to modify the second part of the script - telling ... If your pictures are stored in your images folder, ... pictures like the FP Banner web component but will be visible to users ... Being in Java doesn't usually / neccessarily mean insecure. ...
    (microsoft.public.frontpage.addins)
  • Re: [opensuse] Editting PATH variable
    ... SuSEconfig script ... ... not knowing what you options you used to install ... If your unfamiliar with Bash a good book is 'Learning the Bash Shell' by ... For Java use editing the PATH variable is NOT required... ...
    (SuSE)
  • Re: JAvascripts not working in my computer
    ... I have all my java enabled in the ... >> Script Debugging Problem ... >> Sun JRE.) ... >> Sun also offers an automatic download and install of the 1.4 Java ...
    (microsoft.public.windows.inetexplorer.ie6.browser)