RUNNING EXE FILES

 
Post new topic   Reply to topic    Aprelium Forum Index -> General Questions
View previous topic :: View next topic  
Author Message
osvaldur
-


Joined: 18 Oct 2006
Posts: 2

PostPosted: Wed Oct 18, 2006 2:02 am    Post subject: RUNNING EXE FILES Reply with quote

I need dummie info (step by step) Howto run exe files (application) on my server.

cheers

Osvaldo

ps. I know allowing EXE files to run on my your server can be dangerous
Back to top View user's profile Send private message
TRUSTAbyss
-


Joined: 29 Oct 2003
Posts: 3752
Location: USA, GA

PostPosted: Wed Oct 18, 2006 3:24 am    Post subject: Reply with quote

Create a folder in your htdocs called "cgi-bin" and add your EXE CGI apps to
that folder. Set "/cgi-bin" as a "Script Path" in "Scripting Parameters"

Now all exe files in your cgi-bin will execute.
Back to top View user's profile Send private message Visit poster's website
osvaldur
-


Joined: 18 Oct 2006
Posts: 2

PostPosted: Wed Oct 18, 2006 10:45 am    Post subject: Re: RUNNING EXE FILES Reply with quote

osvaldur wrote:
I need dummie info (step by step) Howto run exe files (application) on my server.

cheers

Osvaldo

ps. I know allowing EXE files to run on my your server can be dangerous


HI TRUSTAbyss

Your addvise help me a little bit. But the problem is now when users on my intranet, click on exe. files the application execute on myhost computer not theirs.

hope you understand my poor english.

Cheers
Osvaldo
Back to top View user's profile Send private message
cmxflash
-


Joined: 11 Dec 2004
Posts: 872

PostPosted: Wed Oct 18, 2006 2:52 pm    Post subject: Reply with quote

As I understand it, you want the application to execute on the server and send the text the program generated back to the client.

The way TRUSTAbyss describes it wont work since the exe-extension doesn't have "Text/HTML" as its MIME-type, and instead prompts the user to download the file.

There are two ways of solving this. One is to add a custom header in Abyss for /cgi-bin named "Content-type" and set it to "Text/HTML".

The other way is by using some script language (PHP, for example).
Code:
<?php
//example code
echo shell_exec("myprogram.exe");
?>
Back to top View user's profile Send private message
Niels H. Veldhuijzen
-


Joined: 19 Oct 2006
Posts: 3
Location: Arnhem, The Netherlands

PostPosted: Thu Oct 19, 2006 1:22 pm    Post subject: Cannot run EXE file Reply with quote

Dear all,

I am a newbie to this forum, and to Abyss as well. I read this thread, but it didn't help me much.
My EXE-file is a Fortran program writing HTML to the standard output console. It catches the QUERY_STRING variable and echoes it (I'm just trying, so there's nothing interesting yet). But instead of getting a reply, the message "page not found" is issued. I added the custom header "content-type: text/html"
Of course, you want to know my settings in the server. As a newbie, I don't know what settings you like to see; so please tell me.
The server is running locally, no network and internet connections. I know nothing about script languages.
The form I'm using is:
Quote:
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<form name="form1" method="get" action="Antwoord.exe">
Vul je naam in:
<input type="text" name="textfield">
en druk op de knop.
<input type="submit" name="Submit" value="Verstuur">
</form>
</body>
</html>

The Fortran code is:
Quote:

program antwoord
implicit none
character(len=1023) :: query
call get_environment_variable('QUERY_STRING',query)
write (*,'(''Content-type: text/html''//''<body>''/''The string is: '',a/''</body>'')') trim(query)
end program antwoord

Would you be so kind and help me on my legs?
_________________
Yours sincerely,
Niels H. Veldhuijzen
Arnhem, The Netherlands
Back to top View user's profile Send private message Send e-mail Visit poster's website
roganty
-


Joined: 08 Jun 2004
Posts: 357
Location: Bristol, UK

PostPosted: Thu Oct 19, 2006 11:18 pm    Post subject: Reply with quote

Niels H. Veldhuijzen, I haven't used Fortran myself, but when sending the "content-type:text/html" you will need to add two new lines after it

For example, I am using perl to demonstarte
Code:
print "Content-type:text/html\r\n\r\n";
print "<html></html>";


the characters "\r\n" creates a carrage reurn (\r) and a new line (\n)
_________________
Anthony R

Roganty
| Links-Links.co.uk
Back to top View user's profile Send private message Visit poster's website
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Fri Oct 20, 2006 1:06 pm    Post subject: Re: Cannot run EXE file Reply with quote

Niels H. Veldhuijzen,

You should also add the virtual path of the .exe file to the Script Paths table (Consoel > Hosts - Configuration > Scripting Parameters > Script Paths - Add : next press Browse next to virtual path and locate your .exe). By doing so, you instruct Abyss Web Server that this file is to be executed on the server.
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
Niels H. Veldhuijzen
-


Joined: 19 Oct 2006
Posts: 3
Location: Arnhem, The Netherlands

PostPosted: Mon Oct 23, 2006 11:00 am    Post subject: Reply with quote

Dear all,

The last two replies to my question were very helpful: everything is OK now.
Roganty: yes, I made a simple coding error in my Fortran source.
Aprelium: all right. But what if I want to execute ProgramA in replying to formA, and programB in replying to formB?
_________________
Yours sincerely,
Niels H. Veldhuijzen
Arnhem, The Netherlands
Back to top View user's profile Send private message Send e-mail Visit poster's website
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Tue Oct 24, 2006 8:43 am    Post subject: Reply with quote

Niels H. Veldhuijzen,

Add those two programs to the Script Paths and link to them in your forms (by referring to each of them in the ACTION parameter of the FORM tag). If you have too many .exe files in the same place, you can use wildcards and not declare each of them explicitly: for example, if your .exe are in /apps/, you can add /apps/*.exe to the Script Paths and Abyss Web Server will consider any .exe inside /apps directory as a server-side executable file.
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
Niels H. Veldhuijzen
-


Joined: 19 Oct 2006
Posts: 3
Location: Arnhem, The Netherlands

PostPosted: Wed Oct 25, 2006 8:19 am    Post subject: Running exe-files Reply with quote

Dear all, and especially Aprelium,

Thanks very much for your help. The last post let me to read the manual very carefully again, and yes: it is all there. It took me some time to come to understand some of the terms and phrases used; that is because I am not a very versed server user.
At the moment I am only using "localhost" in order to verify my code; I am afraid to open my home-PC to the world.
For the moment, I will not bother you again. Thanks again!
_________________
Yours sincerely,
Niels H. Veldhuijzen
Arnhem, The Netherlands
Back to top View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> General Questions 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