View previous topic :: View next topic |
Author |
Message |
tornatore -
Joined: 21 Jan 2008 Posts: 4
|
Posted: Thu Jan 24, 2008 3:01 pm Post subject: Cgi .exe |
|
|
Hi,
I have tested a cgi 'TestCgi.exe' on server and recive error from server:
HTTP 500 - Internal Error
Internet Explorer
Why?
For test I use this c source and compiled in .exe:
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
puts("HTTP/1.1 200 OK\nContent-type: text/plain\n\nHello world!");
return 0;
}
My testcgi.exe is in folder absolute path:
'C:\Programmi\Abyss Web Server\htdocs\'
This is file abyss.config:
Quote: | <?xml version="1.0" encoding="UTF-8"?>
<root>
<server>
<parameters>
<root>
C:\Programmi\Abyss Web Server\
</root>
<timeout>
30
</timeout>
<maxconn>
20
</maxconn>
<keepalive>
10
</keepalive>
<opsys>
<pidfile>
log/abyssws.pid
</pidfile>
</opsys>
</parameters>
<host>
<names/>
<path>
htdocs/
</path>
<running>
yes
</running>
<id>
1
</id>
<scripting>
<enabled>
yes
</enabled>
<cgi>
<timeout>
99999
</timeout>
<useregistry>
yes
</useregistry>
<useshebang>
yes
</useshebang>
<errorfile>
log/cgi.log
</errorfile>
</cgi>
<isapi>
<ext>
dll
</ext>
<errorfile>
log/isapi.log
</errorfile>
<debuglevel>
0
</debuglevel>
<ext>
exe
</ext>
</isapi>
<fastcgi>
<errorfile>
log/fastcgi.log
</errorfile>
<timeout>
240
</timeout>
<debuglevel>
1
</debuglevel>
</fastcgi>
<interpreters>
<interpreter>
<interface>
0
</interface>
<file>
C:\Programmi\Abyss Web Server\htdocs\TestCgi.exe
</file>
<checkexists>
yes
</checkexists>
<type>
0
</type>
<updatepaths>
yes
</updatepaths>
</interpreter>
</interpreters>
<paths>
<path>
<vpath>
/*.exe
</vpath>
<type>
0
</type>
</path>
</paths>
</scripting>
<ssi>
<extensions>
<ext>
shtml
</ext>
<ext>
shtm
</ext>
<ext>
stm
</ext>
</extensions>
<enabled>
yes
</enabled>
<errormessage/>
<timeformat/>
<abbreviatesize>
yes
</abbreviatesize>
<execcmd>
no
</execcmd>
</ssi>
<log>
<file>
log/access.log
</file>
<extendedformat>
yes
</extendedformat>
<denied/>
</log>
<indexes>
<index>
index.html
</index>
<index>
index.htm
</index>
<index>
default.aspx
</index>
</indexes>
<antileech>
<paths/>
<redirect/>
<strict>
no
</strict>
<allowed/>
</antileech>
<bindip>
*
</bindip>
<dirlist>
<type>
1
</type>
<scope>
<order>
ad
</order>
<allow>
<path>
/
</path>
<path>
/aurorabin
</path>
</allow>
</scope>
<hidden>
<file>
.*
</file>
</hidden>
</dirlist>
<port>
8000
</port>
</host>
<throttle>
<maxspeed/>
<maxspeedperip/>
</throttle>
<antihack>
<enabled>
no
</enabled>
<threshold>
20
</threshold>
<monitorperiod>
20
</monitorperiod>
<banperiod>
60
</banperiod>
<logfile/>
<denied>
<ip>
127.0.0.1
</ip>
</denied>
</antihack>
<mimes>
<mime>
<type>
application/mac-binhex40
</type>
<ext>
hqx
</ext>
</mime>
<mime>
<type>
application/msword
</type>
<ext>
doc
</ext>
</mime>
<mime>
<type>
application/octet-stream
</type>
<ext>
bin
</ext>
<ext>
dms
</ext>
<ext>
lha
</ext>
<ext>
lzh
</ext>
<ext>
exe
</ext>
<ext>
class
</ext>
</mime>
<mime>
<type>
application/pdf
</type>
<ext>
pdf
</ext>
</mime>
<mime>
<type>
application/postscript
</type>
<ext>
ai
</ext>
<ext>
eps
</ext>
<ext>
ps
</ext>
</mime>
<mime>
<type>
application/smil
</type>
<ext>
smi
</ext>
<ext>
smil
</ext>
</mime>
<mime>
<type>
application/vnd.mif
</type>
<ext>
mif
</ext>
</mime>
<mime>
<type>
application/vnd.ms-asf
</type>
<ext>
asf
</ext>
</mime>
<mime>
<type>
application/vnd.ms-excel
</type>
<ext>
xls
</ext>
</mime>
<mime>
<type>
application/vnd.ms-powerpoint
</type>
<ext>
ppt
</ext>
</mime>
<mime>
<type>
application/x-cdlink
</type>
<ext>
vcd
</ext>
</mime>
<mime>
<type>
application/x-compress
</type>
<ext>
Z
</ext>
</mime>
<mime>
<type>
application/x-cpio
</type>
<ext>
cpio
</ext>
</mime>
<mime>
<type>
application/x-csh
</type>
<ext>
csh
</ext>
</mime>
<mime>
<type>
application/x-director
</type>
<ext>
dcr
</ext>
<ext>
dir
</ext>
<ext>
dxr
</ext>
</mime>
<mime>
<type>
application/x-dvi
</type>
<ext>
dvi
</ext>
</mime>
<mime>
<type>
application/x-gtar
</type>
<ext>
gtar
</ext>
</mime>
<mime>
<type>
application/x-gzip
</type>
<ext>
gz
</ext>
</mime>
<mime>
<type>
application/x-javascript
</type>
<ext>
js
</ext>
</mime>
<mime>
<type>
application/x-latex
</type>
<ext>
latex
</ext>
</mime>
<mime>
<type>
application/x-sh
</type>
<ext>
sh
</ext>
</mime>
<mime>
<type>
application/x-shar
</type>
<ext>
shar
</ext>
</mime>
<mime>
<type>
application/x-shockwave-flash
</type>
<ext>
swf
</ext>
</mime>
<mime>
<type>
application/x-stuffit
</type>
<ext>
sit
</ext>
</mime>
<mime>
<type>
application/x-tar
</type>
<ext>
tar
</ext>
</mime>
<mime>
<type>
application/x-tcl
</type>
<ext>
tcl
</ext>
</mime>
<mime>
<type>
application/x-tex
</type>
<ext>
tex
</ext>
</mime>
<mime>
<type>
application/x-texinfo
</type>
<ext>
texinfo
</ext>
<ext>
texi
</ext>
</mime>
<mime>
<type>
application/x-troff
</type>
<ext>
t
</ext>
<ext>
tr
</ext>
<ext>
roff
</ext>
</mime>
<mime>
<type>
application/x-troff-man
</type>
<ext>
man
</ext>
</mime>
<mime>
<type>
application/x-troff-me
</type>
<ext>
me
</ext>
</mime>
<mime>
<type>
application/x-troff-ms
</type>
<ext>
ms
</ext>
</mime>
<mime>
<type>
application/zip
</type>
<ext>
zip
</ext>
</mime>
<mime>
<type>
application/vnd.wap.wmlc
</type>
<ext>
wmlc
</ext>
</mime>
<mime>
<type>
audio/basic
</type>
<ext>
au
</ext>
<ext>
snd
</ext>
</mime>
<mime>
<type>
audio/midi
</type>
<ext>
mid
</ext>
<ext>
midi
</ext>
<ext>
kar
</ext>
</mime>
<mime>
<type>
audio/mpeg
</type>
<ext>
mpga
</ext>
<ext>
mp2
</ext>
<ext>
mp3
</ext>
</mime>
<mime>
<type>
audio/x-aiff
</type>
<ext>
aif
</ext>
<ext>
aiff
</ext>
<ext>
aifc
</ext>
</mime>
<mime>
<type>
audio/x-pn-realaudio
</type>
<ext>
ram
</ext>
<ext>
rm
</ext>
</mime>
<mime>
<type>
audio/x-realaudio
</type>
<ext>
ra
</ext>
</mime>
<mime>
<type>
audio/x-wav
</type>
<ext>
wav
</ext>
</mime>
<mime>
<type>
image/bmp
</type>
<ext>
bmp
</ext>
</mime>
<mime>
<type>
image/gif
</type>
<ext>
gif
</ext>
</mime>
<mime>
<type>
image/ief
</type>
<ext>
ief
</ext>
</mime>
<mime>
<type>
image/jpeg
</type>
<ext>
jpeg
</ext>
<ext>
jpg
</ext>
<ext>
jpe
</ext>
</mime>
<mime>
<type>
image/png
</type>
<ext>
png
</ext>
</mime>
<mime>
<type>
image/tiff
</type>
<ext>
tiff
</ext>
<ext>
tif
</ext>
</mime>
<mime>
<type>
image/vnd.wap.wbmp
</type>
<ext>
wbmp
</ext>
</mime>
<mime>
<type>
image/x-cmu-raster
</type>
<ext>
ras
</ext>
</mime>
<mime>
<type>
image/x-portable-anymap
</type>
<ext>
pnm
</ext>
</mime>
<mime>
<type>
image/x-portable-bitmap
</type>
<ext>
pbm
</ext>
</mime>
<mime>
<type>
image/x-portable-graymap
</type>
<ext>
pgm
</ext>
</mime>
<mime>
<type>
image/x-portable-pixmap
</type>
<ext>
ppm
</ext>
</mime>
<mime>
<type>
image/x-rgb
</type>
<ext>
rgb
</ext>
</mime>
<mime>
<type>
image/x-xbitmap
</type>
<ext>
xbm
</ext>
</mime>
<mime>
<type>
image/x-xpixmap
</type>
<ext>
xpm
</ext>
</mime>
<mime>
<type>
image/x-xwindowdump
</type>
<ext>
xwd
</ext>
</mime>
<mime>
<type>
image/x-icon
</type>
<ext>
ico
</ext>
</mime>
<mime>
<type>
model/iges
</type>
<ext>
igs
</ext>
<ext>
iges
</ext>
</mime>
<mime>
<type>
model/mesh
</type>
<ext>
msh
</ext>
<ext>
mesh
</ext>
<ext>
silo
</ext>
</mime>
<mime>
<type>
model/vrml
</type>
<ext>
wrl
</ext>
<ext>
vrml
</ext>
</mime>
<mime>
<type>
text/css
</type>
<ext>
css
</ext>
</mime>
<mime>
<type>
text/html
</type>
<ext>
html
</ext>
<ext>
htm
</ext>
</mime>
<mime>
<type>
text/plain
</type>
<ext>
asc
</ext>
<ext>
txt
</ext>
</mime>
<mime>
<type>
text/richtext
</type>
<ext>
rtx
</ext>
</mime>
<mime>
<type>
text/rtf
</type>
<ext>
rtf
</ext>
</mime>
<mime>
<type>
text/sgml
</type>
<ext>
sgml
</ext>
<ext>
sgm
</ext>
</mime>
<mime>
<type>
text/tab-separated-values
</type>
<ext>
tsv
</ext>
</mime>
<mime>
<type>
text/xml
</type>
<ext>
xml
</ext>
</mime>
<mime>
<type>
text/vnd.wap.wml
</type>
<ext>
wml
</ext>
</mime>
<mime>
<type>
text/vnd.wap.wmlscript
</type>
<ext>
wmls
</ext>
</mime>
<mime>
<type>
video/mpeg
</type>
<ext>
mpeg
</ext>
<ext>
mpg
</ext>
<ext>
mpe
</ext>
</mime>
<mime>
<type>
video/quicktime
</type>
<ext>
qt
</ext>
<ext>
mov
</ext>
</mime>
<mime>
<type>
video/x-msvideo
</type>
<ext>
avi
</ext>
</mime>
</mimes>
</server>
<version>
2.5.0.0
</version>
<console>
<port>
9999
</port>
<bindip>
*
</bindip>
<ipcontrol>
<order>
ad
</order>
<allow>
192.168.0.1-192.168.255.254
</allow>
<allow>
172.16.0.1-172.31.255.254
</allow>
<allow>
10.0.0.1-10.255.255.254
</allow>
</ipcontrol>
<language>
en
</language>
<login>
bitsol
</login>
<password>
7dec95de6c44ac5c474e99d54423c1d7
</password>
</console>
</root> |
|
|
Back to top |
|
|
pkSML -
Joined: 29 May 2006 Posts: 955 Location: Michigan, USA
|
Posted: Fri Jan 25, 2008 11:11 pm Post subject: |
|
|
Try this one:
Code: | /*
hello.c - CGI program for the web
*/
#include <stdio.h>
int main()
{
printf("content-type: text/html\n\n");
printf("<html>\n<body>\n");
printf("<h1> Hello, World! </h1>\n");
printf("</body>\n</html>\n");
return 0;
}
|
Source: http://nwfolk.com/cppcode.html
PS I don't think you're supposed to set the HTTP status code from a CGI application. That's up to the web server. _________________ Stephen
Need a LitlURL?
http://CodeBin.yi.org |
|
Back to top |
|
|
rrinc -
Joined: 24 Feb 2006 Posts: 725 Location: Arkansas, USA
|
Posted: Sat Jan 26, 2008 1:24 am Post subject: |
|
|
Here's a test C++ CGI app I made:
Code: | // Test CGI App
#include <iostream>
using namespace std;
int main()
{
cout << "Content-type: text/plain\n\n";
cout << "Testing";
return 0;
} |
_________________ -Blake | New Server :D
SaveTheInternet
Soy hispanohablante. Puedes contactarme por mensajes privados. |
|
Back to top |
|
|
aprelium -
Joined: 22 Mar 2002 Posts: 6800
|
Posted: Sun Jan 27, 2008 5:37 pm Post subject: Re: Cgi .exe |
|
|
tornatore wrote: | Hi,
I have tested a cgi 'TestCgi.exe' on server and recive error from server:
HTTP 500 - Internal Error
Internet Explorer
Why?
For test I use this c source and compiled in .exe:
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
puts("HTTP/1.1 200 OK\nContent-type: text/plain\n\nHello world!");
return 0;
}
|
Your code looks fine. But error 500 means that there was a problem with your application. Check the cgi.log file for more information.
If you find there a bad header error, check the actual output that is sent by the application (even though it looks fine).
Another possible cause is that the application needs a DLL (usually the C/C++ runtime) and that this DLL is not in the system PATH when Abyss Web Server launches the application. In such a case, try running testcgi.exe from a command line directly and check the error messages returned by Windows. _________________ Support Team
Aprelium - http://www.aprelium.com |
|
Back to top |
|
|
tornatore -
Joined: 21 Jan 2008 Posts: 4
|
Posted: Mon Jan 28, 2008 9:23 am Post subject: |
|
|
Hi thanks for reply,
I have check but not run. |
|
Back to top |
|
|
aprelium -
Joined: 22 Mar 2002 Posts: 6800
|
Posted: Thu Jan 31, 2008 5:10 pm Post subject: |
|
|
tornatore wrote: | Hi thanks for reply,
I have check but not run. |
Do you mean it "does not run" in a Windows command line too? _________________ Support Team
Aprelium - http://www.aprelium.com |
|
Back to top |
|
|
tornatore -
Joined: 21 Jan 2008 Posts: 4
|
Posted: Fri Feb 01, 2008 8:26 am Post subject: |
|
|
the cgi run in windows system and IIS web server. |
|
Back to top |
|
|
aprelium -
Joined: 22 Mar 2002 Posts: 6800
|
Posted: Tue Feb 05, 2008 6:01 pm Post subject: |
|
|
tornatore wrote: | the cgi run in windows system and IIS web server. |
Could you please send to our technical support your CGI .exe so that we can test it? Please do not forget to add a reference to that forum thread as well as your abyss.conf file. _________________ Support Team
Aprelium - http://www.aprelium.com |
|
Back to top |
|
|
|