cgi setup problem (despite reading the forum)

 
Post new topic   Reply to topic    Aprelium Forum Index -> FastCGI/CGI
View previous topic :: View next topic  
Author Message
Martincg
-


Joined: 19 Feb 2006
Posts: 3

PostPosted: Sun Feb 19, 2006 8:08 pm    Post subject: cgi setup problem (despite reading the forum) Reply with quote

I cannot setup Abyss to use cgi scripts.
My cgi scripts are exe's.
This is what I have done and I imagine this is where I've misunderstood-

In scripting parameters
Enable Scripts Execution is ticked.
I have set the interpreter to 'D:Windows\SYSTEM32\CMD.EXE', and the associated extensions to 'exe'. (without the inverted commas)
I have set the Script Paths to the full path which for me is
'D:\Program Files\Abyss Web\cgi-bin'


When I enter
http://127.0.0.1 in the browser address I get the index.html displayed ok.
I downloaded an example cgi from cgi expert and compiled it in Delphi 7, and saved the exe in the cgi-bin folder.

When I enter 'http://127.0.0.1/cgi-bin/userlogin.exe' in the browser address then I get Error 500.
If I set nothoing in the interpreters then I am asked if I want to download the file.
The cgi.log says-
CGI: [d:\windows\SYSTEM32\CMD.EXE mg_CGI_001.exe ] URI: /cgi-bin/mg_CGI_001.exe Bad CGI header line [Microsoft Windows XP [Version 5.1.2600]]

Thanks in advance for anyone who who helps me to get started.
Back to top View user's profile Send private message
Anonymoose
-


Joined: 09 Sep 2003
Posts: 2192

PostPosted: Sun Feb 19, 2006 10:33 pm    Post subject: Reply with quote

Why would you set the script interpreter of an exe file to be CMD.EXE ?

An exe file is executable - it doesn't need a separate interpreter. You are seeing

Quote:

CGI: [d:\windows\SYSTEM32\CMD.EXE mg_CGI_001.exe ] URI: /cgi-bin/mg_CGI_001.exe Bad CGI header line [Microsoft Windows XP [Version 5.1.2600]]


in the log because forcing CMD.EXE to run means the screen output of CMD.EXE is also returned - "Microsoft Windows XP [Version 5.1.2600]" is the first line that appears on the console if you run CMD.exe manually, and it is not a valid CGI header (obviously)

You should configure Abyss to run your executables directly, not associate them with any other interpreter.

Hope this helps...
_________________

"Invent an idiot proof webserver and they'll invent a better idiot..."


Last edited by Anonymoose on Mon Feb 20, 2006 10:33 am; edited 1 time in total
Back to top View user's profile Send private message
Martincg
-


Joined: 19 Feb 2006
Posts: 3

PostPosted: Sun Feb 19, 2006 11:26 pm    Post subject: Reply with quote

Quote:
Why would you set the script interpreter of an exe file to be CMD.EXE ?

An exe file is executable - it doesn't need a separate interpreter.


Well I thought that since I needed an intpreter that this may be what I had to do because, as I said in my message,
Quote:
If I set nothing in the interpreter then I am asked if I want to download the file.

So presumably this is what you mean when you say I should configure Abyss to run my executables directly, not associate them with any other interpreter.

Still don't understand what to do.
Back to top View user's profile Send private message
Anonymoose
-


Joined: 09 Sep 2003
Posts: 2192

PostPosted: Mon Feb 20, 2006 10:39 am    Post subject: Reply with quote

Sorry, I missed your "If I set nothing..." line.

You want to set Script Paths either to allow execution of .exe files in your cgi-bin, or if you only have a limited number of files/you're paranoid then set them for each individual file.

Quote:

When the server is asked for a document, it first checks if it is a script. Scripts must belong to one of the script paths or their subpaths, or must match with one of the path patterns listed in the Script Paths table.

Abyss Web Server is able to run standalone CGI executables. These executables can be GUI or non-GUI Windows applications or MS-DOS EXE or COM programs. The Script Paths table must contain explicitly the general patterns /*.exe and/or /*.com (or more path restrictive patterns ending with *.exe and/or *.com) in order to have them executed. Otherwise, the executable files are downloaded to the client browser.


http://www.aprelium.com/data/doc/2/abyssws-win-doc-html/cgiinternals.html
_________________

"Invent an idiot proof webserver and they'll invent a better idiot..."
Back to top View user's profile Send private message
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Mon Feb 20, 2006 10:49 am    Post subject: Re: cgi setup problem (despite reading the forum) Reply with quote

Martincg,

There is no need for an interpreter for .exe files. All you have to do is to allow their execution by the server. To do so, add a script path for each one (for example add a Script Path /cgi-bin/userlogin.exe for http://127.0.0.1/cgi-bin/userlogin.exe).

If there are many .exe files inside /cgi-bin or any other directory, you can add a pattern in Script Paths to avoid having to update it with each .exe . The pattern should look like /cgi-bin/*.exe .
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
Martincg
-


Joined: 19 Feb 2006
Posts: 3

PostPosted: Mon Feb 20, 2006 5:42 pm    Post subject: Reply with quote

Thanks Anonymoose and Aprelium for your help.

I've got something to happen now; I think the problem was that there were no virtual paths set. I had assumed these were preset to the Abyss Web Server folder.
Back to top View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> FastCGI/CGI All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group