On Sat, Apr 17, 2004 at 02:01:33PM -0500, Puneet Kishor wrote:
...
> That is really cool. Could you (here, or offline) share more about how 
> you did this? In effect, the users are not going to 
> index.cgi?do=somecrap, but they are going to /website/somecrap. So you 

  Exactly.

> can use path_info, but how are you getting the cgi to fire up?
> I know this can be accomplished somewhat with the help of mod_rewrite, 
> but that is not always possible. I am very interested in knowing how 
> you are accomplishing this.

  This is really a webserver configuration issue, but just I wanted to
reaffirm that it's very possible under Apache or most other webservers.

  For our application I'm running mini_httpd, which is not super high
performance, but seems to be the smallest and simplest webserver that
will do SSL.  For this webserver, the CGI mapping is simply a list of
shell glob patterns that you set in the configuration file.

  For Apache, the configuration is done via the ScriptAlias directive. 
The standard convention is to map "/cgi-bin/" in the URL's path, like
this:

   ScriptAlias /cgi-bin/ "/usr/local/apache/share/cgi-bin/"

But you can just as easily map some other path, for instance:

   ScriptAlias /gui/ "/usr/local/mycoolguiscripts/"

or (I think)

   ScriptAlias /gui/ "/usr/local/cgi-bin/thisdoesitall.pl"

  If you want to have one script for everything, you can, as you noted,
take its invocation info out of PATH_INFO with something like this near
the head of your script:

    my $name = $ENV{PATH_INFO};
    $name =~ s%^.*/gui[^/]*/%%;
    # Add trailing index.html if filled in by web server
    $name =~ s%/$%/index.html%;
    # Remove leading slash
    $name =~ s%^/%%;

  Then access to "http://www.example.com/gui/home.html"; would result in 
$name being set to "home.html", ready for concatenation of your
template path prefix.

  If you have a number of different scripts for different elements of
the user interface, one strategy is to hard- or soft- link those
scripts into all the appropriate points in the URL hierachy where
ScriptAlias points, and then you can simply use SCRIPT_NAME as the
starting point instead of PATH_INFO.

  -- Clifton

-- 
          Clifton Royston  --  [EMAIL PROTECTED] 
         Tiki Technologies Lead Programmer/Software Architect
Did you ever fly a kite in bed?  Did you ever walk with ten cats on your head?
  Did you ever milk this kind of cow?  Well we can do it.  We know how.
If you never did, you should.  These things are fun, and fun is good.
                                                                 -- Dr. Seuss


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Html-template-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/html-template-users

Reply via email to