Re: Need assistance setting up a cgi program

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Unfortunately no.  You see FoxPro is an odd beast.  It'll allow you to run a script/program without the extension.  So from within FoxPro you can type "do c:\temp\appname" and it'll look for appname.prg, then appname.app.  So the developers who wrote these apps are requesting pages like /cgi/login?foo=bar causing FoxPro to look for the login.prg or login.app.  So if I use a rewrite rule like that it'll break if the code is a .prg instead of an .app and unfortunately they used both all over the place.  Ideally I would make the developers rework their apps but unfortunately we've let the developers go and are maintaining the apps with the understanding that they won't be modified.




Brian Mearns <mearns.b@xxxxxxxxx>

03/09/2009 02:47 PM

Please respond to
users@xxxxxxxxxxxxxxxx

To
users@xxxxxxxxxxxxxxxx
cc
Subject
Re: Need assistance setting up a cgi program





On Mon, Mar 9, 2009 at 3:40 PM,  <REllis@xxxxxxxxxxxxxxx> wrote:
>
> Hello all, I have an old Windows web system I'm trying to migrate from an
> ancient version of Netscape Enterprise Server to Apache 2.2.x.  Most of
> the site is static content and I have that working correctly.  However
> part of the site is also using another ancient technology called FoxWeb
> which is basically an old way of putting FoxPro applications on the web. I
> need to be able to setup Apache to send all requests that come in with a
> URL like /cgi/login?foo=bar to the executable
> c:\FoxWeb_Test\foxweb\foxweb.exe.  It should be noted that each "page" is
> actually a FoxPro executable such as login.app or login.prg, however the
> extension isn't included in the URL's request.  \
>
> Here's what my web structure looks like:
>
> c:\FoxWeb_Test          # Root of the web server
> c:\FoxWeb_Test\http             # Static html files and graphics
> c:\FoxWeb_Test\foxweb   # FoxPro web applications - when a request for
> anything in here is made c:\FoxWeb_Test\foxweb\foxweb.exe needs to be
> called as a CGI with the request information
>
> Here's what I have for a virtual host so far, and it's already serving
> static content correctly.
>
> <VirtualHost *:8080>
>  DocumentRoot "C:\FoxWeb_Test\http"
>  ServerName testaccount.harte-hanks.com
>
>  <Directory "/">
>    Options +Indexes FollowSymLinks
>    AllowOverride AuthConfig FileInfo
>    Order allow,deny
>    Allow from all
>  </Directory>
> </VirtualHost>
>
>
> Adding the following gets it to work for .app files, but I need a fix that
> allows all files regardless of extension to go to foxweb.exe.
>
>  AddHandler foxweb-script .app
>  Action foxweb-script "/cgi/foxweb.exe"
>
>  ScriptAlias /cgi/ "C:/FoxWeb_Test/foxweb/"
>  <Directory "C:/FoxWeb_Test/foxweb/">
>    AllowOverride None
>    Options None
>    Order allow,deny
>    Allow from all
>  </Directory>
>
> I've also tried adding "SetHandler foxweb-script" to the foxweb directory
> directive but that gives me an error stating that too many internal
> redirects were made.
>
> Thanks in advance for any help you can provide.

You should be able to just use mod_rewrite to rewrite incoming
requests for "^/cgi/([^.]*)$" to "/cgi/$1.app". I think that will work
as long as none of the cgi scripts have a dot as part of their name
other than .app. If it does, you'll need to get more creative with
your regex, or use a negated rewrite cond to only apply the rewrite
when the URL doesn't already end in .app.

Does that help?

-Brian

--
Feel free to contact me using PGP Encryption:
Key Id: 0x3AA70848
Available from:
http://pgp.mit.edu/

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:
http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
  "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux