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

Re: CGI Mapping



Nathan R Heagy schrieb:
> 
> After following your newest instructions, and adding the cgi MIME type, the
> scripts are still not working, I am simply now asked where to put
> whatsnew.cgi, even if it is a .pl file, the extension is renamed to .cgi!!!
> I have attached my config.pi3 file, in the hopes that the problem can be
> found. Maybe I am restarting the server incorrectly?
^^^^
I tried it with your original config.pi3 file, created the directory structure 
for localhost/heagy/ (C:\Projects\980201_Nathan_web-site\website\) copied
2 files in the website\ directory and ... it worked.
Now I'm a bit confused. What could be the difference?
1.) I stopped the server when changing config file and then started it again.

2.) Are the paths correct? (Remove index files from the website directory
to have a look on it as HTML-table)

3.) Whats the content-type you send with the whatsnew.cgi?
This header field let your browser know what to do with the received data.
The getenv.pl (my test script) sends 'print "Content-type: text/html\n\n";'
An experiment: Save the stuff and look into the file you saved. Is it the
cgi program code or the cgi program output? I tried getenv.pl with 
'print "Content-type: application/octet-stream\n\n";'

Now the browser is showing a dialog to save "getenv.exe".
Please check 1.) to 3.) it and let me know. My favourite is 3.)
> 
> Thanks, again.
> Nathan R Heagy
> -- -- --
> Sites Built Better
> http://heagy.com
> 
> -----Original Message-----
> From: Holger Zimmermann <zimpel@t-online.de>
> To: Nathan R Heagy <nheagy@cintek.com>
> Cc: pi3 users <pi3-users@johnroy.com>
> Date: July 18, 1998 11:03 PM
> Subject: Re: CGI Mapping
> 
> >Nathan R Heagy schrieb:
> >>
> >> Thanks for the suggestion, Holger, but it isn't working on my sytem. I
> moved
> >> a cgi, whatsnew.cgi, to a document directory, localhost/heagy/, and when
> I
> >                  ^^ is file extension .cgi?
> >                     then add .cgi to mime-type text/x-perl.
> >                     Search for AddMIMEEntry in the Config file and add
> line
> >                     AddMIMEEntry "cgi  text/x-perl"
> >                     or change it with the GUI admin. When it works now,
> however
> >                     I suggest to use the enhanced suggestion (see below).
> >
> >> tried to run the cgi netscape asks me to tell it where to download
> >> whatsnew.exe. What have I done wrong?
> >^^^^       ^^ or .exe?
> >^^^^
> >If the file extension is .exe the problem is the mime-type of your CGI.
> >I build the example for Perl (*.pl, *.cgi) and you are using executables
> >(*.exe). I wrote some sentences about the possible enhancements in the
> >discussion of my suggestion in the last mail but I did not work out this
> >there.
> >The problem for this mime type is that it is used not only for executables
> >but for all binary formats. Here's my suggestion that works with perl and
> >.exe CGI's and has some more enhancements (see below):
> >
> >1.) Default handler
> >Search for
> >        Handle CGIScripts
> >
> >Change it into
> >        Handle
> >Condition="&or(&cmp($c,text/x-perl),&and(&cmp($c,application/octet-stream),
> \
> >&regexp('*.exe',$z)))" CGIScripts
> >
> >
> >2.) Change the handler object named 'CGIScripts', delete the condition-line
> >
> ><Object>
> >        Name CGIScripts
> >        Class FlexibleHandlerClass
> >        CheckPath RefuseFileByMask AllowFileMask="EFD" RefuseStatus=404
> >        CheckPath RefuseFileByMask AllowFileMask="F" RefuseStatus=403
> >        CheckPath ReturnCode ReturnCode=COMPLETED
> >        CheckAccess AccessByFile RequirePermissions="X"
> >        CheckType ReturnCode ReturnCode=COMPLETED
> >        Handle StandardCGI
> ></Object>
> >
> >Discussion:
> >Now CGI is executed when the mime type is "text/x-perl" or
> >"application/octet-stream" and the url-file extension is ".exe".
> >The condition I moved out of the call of CGIScripts handler, that's
> >for speed optimization (ca. 200ms per request). Thank you, Ang-Chih Kao
> >for the hint. This example I tested for perl and executable CGI and
> >it worked with .pl, .cgi and .exe files.
> >
> >Still Problems?
> >Check your configuration (GUI or config file) for the following mime
> entries:
> >
> >                     AddMIMEEntry "cgi  text/x-perl"
> >                     AddMIMEEntry "exe  application/octet-stream"
> >                     AddMIMEEntry "pl   text/x-perl"
> >>
> >> Thanks for any (more) suggestions.
> >^^^^
> >No matter.
> >
> >> Nathan R Heagy
> >> -- -- --
> >> Sites Built Better
> >> http://heagy.com
> >>
> >
> >8< CUT >8
> >
> >--
> >with regards
> >Holger
> >
> >---------------------------------------------------------
> >Holger 'Zimpel' Zimmermann    Contact me:
> >---------------------------------------------------------
> >Wendishain                    tel./fax company: on demand
> >Germany                       tel./fax private: on demand
> >---------------------------------------------------------
> >homepage: http://home.t-online.de/home/zimpel/
> >web server: surf to it from my homepage (online every
> >            Sunday 20:00-24:00 GMT, start shifted again)
> >e-Mail:     zimpel@t-online.de
> >--------------------------------------------------------
> >
> >
> 
>   --------------------------------------------------------------------------------
> 
>                     Name: Config.pi3
>    Config.pi3       Type: Ohne Angabe (application/octet-stream)
>                 Encoding: quoted-printable

-- 
with regards
Holger

---------------------------------------------------------
Holger 'Zimpel' Zimmermann    Contact me:
---------------------------------------------------------
Wendishain                    tel./fax company: on demand
Germany                       tel./fax private: on demand
---------------------------------------------------------
homepage: http://home.t-online.de/home/zimpel/
web server: surf to it from my homepage (online every
            Sunday 20:00-24:00 GMT, start shifted again)
e-Mail:     zimpel@t-online.de
--------------------------------------------------------