I'm a little stumped.

I have a DOS executable that I want to eventually run in my linux apache server.

Research has led me to believe using the mod_ext_filter module is my best bet.

I decided to make a super simple C program that prints out program arguments. Here's the source code:

#include <stdio.h>

int main(int argc,char* argv[]){
    while(argc > 0){
        printf("Arg %d: %s\n",argc,argv[argc]);
return 0;


I then compiled it and renamed the binary to aout. Then I updated the httpd.conf and included these after the "LoadModule" directives:

AddType dos/exe .exe
ExtFilterDefine runexe mode=output intype=dos/exe outtype=text/html cmd="/path/to/aout <0"
SetOutputFilter runexe

Then right under <Directory />, I add:

ExtFilterOptions LogStderr DebugLevel=5

When I start apache and run an EXE file that's found, I expected to see the exe filename as a parameter, but I don't. What I see in my browser is:

Arg 1: <0 Arg 0: /www/public/cgi/aout END

Which means that it recognized the program that handles the exe files and took the argument as if it was plain text.

Am I using the right module to associate EXE files with external programs or am I formatting my command string incorrectly? What could I be doing wrong?

So Why DOS and EXE?

My end goal is to take output from a compiled Qbasic program and have Linux apache pass it to my browser. I can already get the output printed in a terminal using the wineconsole command. And why such old software? because I'm doing a major project and the hardware is connected to the PC through the old serial port. so the program prints out HTML output as well as communicate with the hardware.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.