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

configuration improvements for the PLT webserver?



Hello,

I'd like to propose a few minor changes that *might* improve the
webserver configuration:

   (1) add a handler for CGIs based on extension (ala apache):

(define cgi-script-extension
  (make-parameter null (lambda (x)
			 (if (list? x) x
			     (error 'cgi-script-extension
				    "list of CGI extensions expected")))))
; cgi-extension? : str  -> bool
(define cgi-extension?
  (lambda (file)
    (let ((match (regexp-match "\\..*" file)))
      (and match
	   (member (car match) (cgi-script-extension))))))

and of course, modify cgi-bin? as in:

(define cgi-bin? (lambda (x)
		   (or ((prefix? "/cgi-bin/") x)
		       (cgi-extension? x))))

then export the `cgi-script-extension' in the web-main^ signature, and
now people can use:

(cgi-script-extension '(".cgi" ".ss"))

thus bypassing the "cgi-bin" subdirectory restriction.

   (2) How about converting the DEFAULT-SEARCHES var into a parameter?
this way, people could do things like:

(DEFAULT-SEARCHES '("index.html" "index.ss"))
(cgi-script-extension '(".ss"))

and have people directed to their default site:

   http://www.foo.com

where an index.ss script would execute, and generate the front end
page, with on the fly information.  Same thing for every other
subdirectory on the webserver file system.

   (3) Add a log facility that uses the Common Logfile Format, so that
we could reuse existing tools like: webalizer, analog, wwwstat, etc.

What do you guys think?

--Francisco