You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by bu...@now-india.net.in on 2002/12/06 01:02:10 UTC

[users@httpd] cannot run exe on apache2

I have written a c program :

/******************************/
#include <stdio.h>
#include <conio.h>

void main()
{
  printf("Content-Type: text/html\n\n");
  printf("<html>\n");
  printf("<head>\n");
  printf("  <title>Hello World</title>\n");
  printf("</head>\n");
  printf("<body>\n");
  printf("  <h1>Hello World!</h1>\n");
  printf("  cgi rulez!\n");
  printf("</body>\n");
  printf("</html>\n");
}
/***************************/
I compiled it and made an exe called test.exe
I placed it in the cgi-bin folder of apache 1.3.19 and
http://localhost/cgi-bin/test.exe shows the output
However on another system using apache 2.0.43 when I placed test.exe in its
cgi-bin folder , http://localhost/cgi-bin/printenv.pl works but
http://localhost/cgi-bin/test.exe always shows Internal error in the browser
and "[Fri Dec 06 05:30:11 2002] [error] [client 127.0.0.1] (720005)Access is
denied.  : couldn't spawn child process: C:/Program Files/Apache
Group/Apache2/cgi-bin/test.exe" error in the error log
I am using winxp, and fat32 so no question of permissions

would appreciate any help
thanx


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] please advice cannot run exe on apache2

Posted by bu...@now-india.net.in.
wont the scriptalias take care of that ?
----- Original Message -----
From: "ncool007" <nc...@optonline.net>
To: <us...@httpd.apache.org>
Sent: 08 December, 2002 11:23 PM
Subject: Re: [users@httpd] please advice cannot run exe on apache2


> shouldn't you add Options ExecCGI to the cgi directory?
>
> At 06:48 PM 12/8/2002 +0530, you wrote:
> >hi all here is my httpd.conf
> >and the source code of test.exe
> >would appreciate any help
> >still cannot run http://localhost/cgi-bin/test.exe on apache2
> >even though http://localhost/cgi-bin/printenv runs just fine
> >Also when I run the following file http://localhost/1.cmd , IE6 tries to
> >download it while opera, netscape and mozilla show the output
> >Contents of 1.cmd placed in cgi-bin :
> >@echo content-type: text/plain
> >@echo.
> >@echo.
> >@echo %path%
> >@echo.
> >@echo.
> >@echo Hello there how are you
> >
> >----- Original Message -----
> >From: "J. Greenlees" <ja...@shaw.ca>
> >To: <us...@httpd.apache.org>
> >Sent: 06 December, 2002 02:25 PM
> >Subject: Re: [users@httpd] cannot run exe on apache2
> >
> >
> > >
> > >
> > > bulbultyagi@now-india.net.in wrote:
> > > ~snip~
> > >
> > > > gaurav : how do I do that ? , I have placed the test.exe in cgi-bin
> >folder ,
> > > > I used ScriptAlias /cgi-bin/ "C:/Program Files/Apache
> > > > Group/Apache2/cgi-bin/"
> > > > <Directory "C:/Program Files/Apache Group/Apache2/cgi-bin">
> > > >     AllowOverride None
> > > >     Options None
> > > >     Order allow,deny
> > > >     Allow from all
> > > > </Directory>
> > > > I even tried AddHandler cgi-script .exe .pl
> > > have you given apache the data it needs to parse an exe?
> > > from the apache 2 docs on apache.org:
> > >
> > > If you're writing CGI programs in C, there are a variety of options.
> > > One of these is the CGIC library, from http://www.boutell.com/cgic/
> > >
> > > if you have not included a library for apache to understand the file,
> > > then it won't work.
> > >
> > > if you put your httpd.conf up then it makes it easier to see what
might
> > > be causing the problem.
> >
> >
> >
> >---------------------------------------------------------------------
> >The official User-To-User support forum of the Apache HTTP Server
Project.
> >See <URL:http://httpd.apache.org/userslist.html> for more info.
> >To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> >    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> >For additional commands, e-mail: users-help@httpd.apache.org
>
>
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] please advice cannot run exe on apache2

Posted by ncool007 <nc...@optonline.net>.
shouldn't you add Options ExecCGI to the cgi directory?

At 06:48 PM 12/8/2002 +0530, you wrote:
>hi all here is my httpd.conf
>and the source code of test.exe
>would appreciate any help
>still cannot run http://localhost/cgi-bin/test.exe on apache2
>even though http://localhost/cgi-bin/printenv runs just fine
>Also when I run the following file http://localhost/1.cmd , IE6 tries to
>download it while opera, netscape and mozilla show the output
>Contents of 1.cmd placed in cgi-bin :
>@echo content-type: text/plain
>@echo.
>@echo.
>@echo %path%
>@echo.
>@echo.
>@echo Hello there how are you
>
>----- Original Message -----
>From: "J. Greenlees" <ja...@shaw.ca>
>To: <us...@httpd.apache.org>
>Sent: 06 December, 2002 02:25 PM
>Subject: Re: [users@httpd] cannot run exe on apache2
>
>
> >
> >
> > bulbultyagi@now-india.net.in wrote:
> > ~snip~
> >
> > > gaurav : how do I do that ? , I have placed the test.exe in cgi-bin
>folder ,
> > > I used ScriptAlias /cgi-bin/ "C:/Program Files/Apache
> > > Group/Apache2/cgi-bin/"
> > > <Directory "C:/Program Files/Apache Group/Apache2/cgi-bin">
> > >     AllowOverride None
> > >     Options None
> > >     Order allow,deny
> > >     Allow from all
> > > </Directory>
> > > I even tried AddHandler cgi-script .exe .pl
> > have you given apache the data it needs to parse an exe?
> > from the apache 2 docs on apache.org:
> >
> > If you're writing CGI programs in C, there are a variety of options.
> > One of these is the CGIC library, from http://www.boutell.com/cgic/
> >
> > if you have not included a library for apache to understand the file,
> > then it won't work.
> >
> > if you put your httpd.conf up then it makes it easier to see what might
> > be causing the problem.
>
>
>
>---------------------------------------------------------------------
>The official User-To-User support forum of the Apache HTTP Server Project.
>See <URL:http://httpd.apache.org/userslist.html> for more info.
>To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
>For additional commands, e-mail: users-help@httpd.apache.org



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


[users@httpd] please advice cannot run exe on apache2

Posted by bu...@now-india.net.in.
hi all here is my httpd.conf
and the source code of test.exe
would appreciate any help
still cannot run http://localhost/cgi-bin/test.exe on apache2
even though http://localhost/cgi-bin/printenv runs just fine
Also when I run the following file http://localhost/1.cmd , IE6 tries to
download it while opera, netscape and mozilla show the output
Contents of 1.cmd placed in cgi-bin :
@echo content-type: text/plain
@echo.
@echo.
@echo %path%
@echo.
@echo.
@echo Hello there how are you

----- Original Message -----
From: "J. Greenlees" <ja...@shaw.ca>
To: <us...@httpd.apache.org>
Sent: 06 December, 2002 02:25 PM
Subject: Re: [users@httpd] cannot run exe on apache2


>
>
> bulbultyagi@now-india.net.in wrote:
> ~snip~
>
> > gaurav : how do I do that ? , I have placed the test.exe in cgi-bin
folder ,
> > I used ScriptAlias /cgi-bin/ "C:/Program Files/Apache
> > Group/Apache2/cgi-bin/"
> > <Directory "C:/Program Files/Apache Group/Apache2/cgi-bin">
> >     AllowOverride None
> >     Options None
> >     Order allow,deny
> >     Allow from all
> > </Directory>
> > I even tried AddHandler cgi-script .exe .pl
> have you given apache the data it needs to parse an exe?
> from the apache 2 docs on apache.org:
>
> If you're writing CGI programs in C, there are a variety of options.
> One of these is the CGIC library, from http://www.boutell.com/cgic/
>
> if you have not included a library for apache to understand the file,
> then it won't work.
>
> if you put your httpd.conf up then it makes it easier to see what might
> be causing the problem.


Re: [users@httpd] cannot run exe on apache2

Posted by bu...@now-india.net.in.
but why do the c programs run on apache 1.3.19 and 1.3.27 ?
>
>
> bulbultyagi@now-india.net.in wrote:
> ~snip~
>
> > gaurav : how do I do that ? , I have placed the test.exe in cgi-bin
folder ,
> > I used ScriptAlias /cgi-bin/ "C:/Program Files/Apache
> > Group/Apache2/cgi-bin/"
> > <Directory "C:/Program Files/Apache Group/Apache2/cgi-bin">
> >     AllowOverride None
> >     Options None
> >     Order allow,deny
> >     Allow from all
> > </Directory>
> > I even tried AddHandler cgi-script .exe .pl
> have you given apache the data it needs to parse an exe?
> from the apache 2 docs on apache.org:
>
> If you're writing CGI programs in C, there are a variety of options.
> One of these is the CGIC library, from http://www.boutell.com/cgic/
>
> if you have not included a library for apache to understand the file,
> then it won't work.
>
> if you put your httpd.conf up then it makes it easier to see what might
> be causing the problem.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] cannot run exe on apache2

Posted by bu...@now-india.net.in.
zac ,  you are you using apache 2.0.43 ?
I mean just look at the code

/*test.c*/
#include <stdio.h>
#include <conio.h>

void main()
{
  printf("Content-Type: text/html\n\n");
  printf("<html>\n");
  printf("<head>\n");
  printf("  <title>Hello World</title>\n");
  printf("</head>\n");
  printf("<body>\n");
  printf("  <h1>Hello World!</h1>\n");
  printf("  cgi rulez!\n");
  printf("</body>\n");
  printf("</html>\n");
}
it is a simple hello world program
and runs on apache 1.3.19 and 1.3.27 on the same machine
http://localhost/cgi-bin/test.exe
what am i doing wrong ??

----- Original Message -----
From: "Zac Stevens" <zt...@cryptocracy.com>
To: <us...@httpd.apache.org>
Sent: 06 December, 2002 04:10 PM
Subject: Re: [users@httpd] cannot run exe on apache2


> On Fri, Dec 06, 2002 at 12:55:05AM -0800, J. Greenlees wrote:
> > If you're writing CGI programs in C, there are a variety of options.
> > One of these is the CGIC library, from http://www.boutell.com/cgic/
> >
> > if you have not included a library for apache to understand the file,
> > then it won't work.
>
> This isn't quite correct - the aforementioned link is for a C
> CGI-programming library, however this (like the Perl CGI module) merely
> provides ways to interact with form data and the like.  It certainly is
not
> *required* for writing a CGI program in C.
>
> The OP's code is really just a C implementation of the canonical CGI -
HTTP
> headers & a "Hello World" response - and should be working fine, as long
as
> it is being invoked in accordance with Apache's configuration.
>
> HTH,
> >
> Zac


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] cannot run exe on apache2

Posted by Zac Stevens <zt...@cryptocracy.com>.
On Fri, Dec 06, 2002 at 12:55:05AM -0800, J. Greenlees wrote:
> If you're writing CGI programs in C, there are a variety of options.
> One of these is the CGIC library, from http://www.boutell.com/cgic/
> 
> if you have not included a library for apache to understand the file, 
> then it won't work.

This isn't quite correct - the aforementioned link is for a C
CGI-programming library, however this (like the Perl CGI module) merely
provides ways to interact with form data and the like.  It certainly is not
*required* for writing a CGI program in C.

The OP's code is really just a C implementation of the canonical CGI - HTTP
headers & a "Hello World" response - and should be working fine, as long as
it is being invoked in accordance with Apache's configuration.

HTH,


Zac

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] cannot run exe on apache2

Posted by "J. Greenlees" <ja...@shaw.ca>.

bulbultyagi@now-india.net.in wrote:
~snip~

> gaurav : how do I do that ? , I have placed the test.exe in cgi-bin folder ,
> I used ScriptAlias /cgi-bin/ "C:/Program Files/Apache
> Group/Apache2/cgi-bin/"
> <Directory "C:/Program Files/Apache Group/Apache2/cgi-bin">
>     AllowOverride None
>     Options None
>     Order allow,deny
>     Allow from all
> </Directory>
> I even tried AddHandler cgi-script .exe .pl
have you given apache the data it needs to parse an exe?
from the apache 2 docs on apache.org:

If you're writing CGI programs in C, there are a variety of options.
One of these is the CGIC library, from http://www.boutell.com/cgic/

if you have not included a library for apache to understand the file, 
then it won't work.

if you put your httpd.conf up then it makes it easier to see what might 
be causing the problem.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] cannot run exe on apache2

Posted by bu...@now-india.net.in.
greenlees : is the second machine apache configured to run .exe as cgi?
> looks like it's not set up to run your exe as a cgi.
>
gaurav : how do I do that ? , I have placed the test.exe in cgi-bin folder ,
I used ScriptAlias /cgi-bin/ "C:/Program Files/Apache
Group/Apache2/cgi-bin/"
<Directory "C:/Program Files/Apache Group/Apache2/cgi-bin">
    AllowOverride None
    Options None
    Order allow,deny
    Allow from all
</Directory>
I even tried AddHandler cgi-script .exe .pl
In fact I have the printenv.pl  in this cgi-bin directory and
http://localhost/cgi-bin/printenv.pl works just fine ( I had to change the
first line to point to the actual location of perl.exe)
I am having this problem  on apache 2.0.43 , I tried out
http://localhost/cgi-bin/test.exe on apache 1.3.19 and 1.3.27 and it worked.
what am I doing wrong ??

----- Original Message -----
From: "J. Greenlees" <ja...@shaw.ca>
To: <us...@httpd.apache.org>
Sent: 06 December, 2002 06:19 AM
Subject: Re: [users@httpd] cannot run exe on apache2


>
>
> bulbultyagi@now-india.net.in wrote:
> ~snip~
>
> > However on another system using apache 2.0.43 when I placed test.exe in
its
> > cgi-bin folder , http://localhost/cgi-bin/printenv.pl works but
> > http://localhost/cgi-bin/test.exe always shows Internal error in the
browser
> > and "[Fri Dec 06 05:30:11 2002] [error] [client 127.0.0.1]
(720005)Access is
> > denied.  : couldn't spawn child process: C:/Program Files/Apache
> > Group/Apache2/cgi-bin/test.exe" error in the error log
>
>
> is the second machine apache configured to run .exe as cgi?
> looks like it's not set up to run your exe as a cgi.
>



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] cannot run exe on apache2

Posted by "J. Greenlees" <ja...@shaw.ca>.

bulbultyagi@now-india.net.in wrote:
~snip~

> However on another system using apache 2.0.43 when I placed test.exe in its
> cgi-bin folder , http://localhost/cgi-bin/printenv.pl works but
> http://localhost/cgi-bin/test.exe always shows Internal error in the browser
> and "[Fri Dec 06 05:30:11 2002] [error] [client 127.0.0.1] (720005)Access is
> denied.  : couldn't spawn child process: C:/Program Files/Apache
> Group/Apache2/cgi-bin/test.exe" error in the error log


is the second machine apache configured to run .exe as cgi?
looks like it's not set up to run your exe as a cgi.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org