You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by RE...@harte-hanks.com on 2009/03/09 20:40:22 UTC
[users@httpd] Need assistance setting up a cgi program
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.
Re: [users@httpd] Need assistance setting up a cgi program
Posted by André Warnier <aw...@ice-sa.com>.
REllis@harte-hanks.com wrote:
> 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.
>
Shot from the hip : wouldn't "content negociation" help in a case like
that ? I'm thinking vaguely of the mechanism that is normally used to
return a .html.en or .html.es or .html.fr etc...
---------------------------------------------------------------------
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@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] Need assistance setting up a cgi program
Posted by RE...@harte-hanks.com.
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 <me...@gmail.com>
03/09/2009 02:47 PM
Please respond to
users@httpd.apache.org
To
users@httpd.apache.org
cc
Subject
Re: [users@httpd] Need assistance setting up a cgi program
On Mon, Mar 9, 2009 at 3:40 PM, <RE...@harte-hanks.com> 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@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] Need assistance setting up a cgi program
Posted by Brian Mearns <me...@gmail.com>.
On Mon, Mar 9, 2009 at 3:40 PM, <RE...@harte-hanks.com> 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@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org