Click to See Complete Forum and Search --> : Enabling EXE processing


Lexation
07-20-2001, 04:08 AM
Can anyone help me figure out how to configure my web server (Debian GNU/Linux 2.2) to process .exe files through http requests? Ie. http://site.com/dir/script.exe?var=Test should show the output from this executable file. Right now, it just gives you the option of downloading and/or running it on the client's computer.

Thanks,

Nathan

hux
07-20-2001, 04:45 AM
is this file actually a MSDOS executable, or perl script, or what? If it's a dos file it ain't happenin, far as I know...if it's perl or some such, I'm guessing yer gonna have to use a different extension, else you'll be conflicting with mime types set up for dos exe's, like you already found out, sounds like..

I'm assuming that the file has actually got an .exe extension, you didn't just put that there to show it's an executable...

Lexation
07-20-2001, 12:30 PM
Actually, it's a program that I created myself, using C and the gcc compiler. I just named it to .exe because I have seen other interactive sites with .exe files.

Now that I am thinking about it, it probably has to do with cgi script processing or something, since it appears they are usually in a cgi-bin directory.

Any ideas?

Thanks,
Nathan

hux
07-20-2001, 01:27 PM
wish I could do that :)

I'd try two things, keep in mind these are guesses..

a: plop it in the cgi-bin or some other executable directory.

b: try changing that extension to something else..I dunno what, but every browser and most servers I've run across see .exe and think "oh, download!" them sites you saw probly hadda jump through some mime type hoops to make that go...

again, just guesses, I really don't know:0)

Lexation
07-20-2001, 02:33 PM
It's easy to create a C program. Create a text file mycode.c containing this:

#include <stdlib.h>
int main(void) {
printf("Hello, world!\n");
return 0;
}

Then type:
gcc mycode.c

Your executable will probably be named: a.out
chmod +x a.out
./a.out
And you will see the results.

Anyway, back to my problem... I found the cgi-bin directory, so I guess it was already set up at /usr/lib/cgi-bin.
I put my file in it and tried to access it through the web. It gave me: Internal Server Error.

Something must be wrong in the srm.conf, access.conf, etc files.

Any ideas anyone?

Thanks,
Nathan :)

Energon
07-25-2001, 04:12 PM
That's because you're C program isn't setup right... there's a line you have to print first, but I forget what it is... do a search and you'll find it... it's the same thing as it is in perl...

And unless you're running DOS or Windows, there's no real reason to call it .exe... it's that way on some servers because they run Windows and <b>have</b> to have it that way unless they fiddle with some things... you aren't restricted that way...

MrNewbie
07-25-2001, 04:56 PM
You need to do this:

printf("Content-type: text/html\n\n");

I'd also ditch the .exe extension, though I don't think it matters, but you don't need any extension at all for C CGI scripts, at least I haven't when I have used them.

Lexation
07-25-2001, 06:58 PM
Thanks for all your help everyone! It worked!

Nathan