logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: How to invoke CGI program without using its file extension?
Author
raguila



Joined: 04 Oct 2006
Posts: 3

PostPosted: Wed 04 Oct '06 19:37    Post subject: How to invoke CGI program without using its file extension? Reply with quote

Hi,

I'd like to know how can Apache2 run a cgi program without using its file extension.

This works ok
http://my.server.com/cgi-bin/program.exe?Parameter=Value

and I would like that something like this works too:
http://my.server.com/cgi-bin/program?Parameter=Value

It works OK in Apache 1.3 but not in Apache 2 (default configuracion).


Thanks in advance for your help.
Back to top
Brian



Joined: 21 Oct 2005
Posts: 209
Location: Puyallup, WA USA

PostPosted: Thu 05 Oct '06 1:34    Post subject: Reply with quote

You could implement this with MOD_REWRITE, or perhaps you could use a PHP (or any server-side scripting language) script to do this whereby you call it something like:

http://www.mywebsite.com/scripts/run.php?prog=blablabla

In your script you could do something as basic as have some pre-defined titles and if the request matches one of the titles in your list your script kicks out the appropriate headers to tell the browser what to expect and then it sends the file.

This way it can handle the security and access to the programs/scripts/executibles on your server. This creates a very secure environment since you can control more easily who, what, and when the scripts can be accessed.

You could make this dynamic as well via a db driven list of apps, or keep it simple as I mentioned.

Personally, I would look at using PHP or perhaps mod_rewrite or even setting up a proxy to connect to this file.

I hope that some of these ideas get you started. If you desire more specific info, try doing a little research on what I suggested as well as what others may suggest for solutions. Then, if all else fails post a follow up.
Back to top
raguila



Joined: 04 Oct 2006
Posts: 3

PostPosted: Thu 05 Oct '06 13:59    Post subject: Reply with quote

It works without .exe extension in Apache 1.3 then I think it is a configuration issue that it do not in Apache2. But, what have I to change?
Back to top
CanUuRead



Joined: 18 Sep 2006
Posts: 38

PostPosted: Thu 05 Oct '06 18:35    Post subject: Reply with quote

What did you do in Apache 1.3 to accomplish this?
Back to top
raguila



Joined: 04 Oct 2006
Posts: 3

PostPosted: Fri 06 Oct '06 12:50    Post subject: Reply with quote

Ok, I get it!

In Apache2 config file I need to add in the cgi-bin Directory section the following directives:

Options MultiViews
AddHandler cgi-script exe

With these directives I can run a cgi program (.exe) without using its file extension.

I were not using this options in Apache 1.3, perhaps the default behaviour are diferent in both releases.

Thanks.
Back to top


Reply to topic   Topic: How to invoke CGI program without using its file extension? View previous topic :: View next topic
Post new topic   Forum Index -> Apache