Adapt to recent interface changes of HTTPD and its file handlers.

Particularly, the SUrflet server can now serve the source of SUrflets
via '/source/add-raw.scm'
This commit is contained in:
interp 2003-01-28 21:58:33 +00:00
parent 367caeb01d
commit 8895e3b32a
3 changed files with 60 additions and 37 deletions

View File

@ -173,18 +173,20 @@ exec scsh -lm $sunet/packages.scm -lm $ssax/lib/packages.scm -lm $sunet/httpd/su
log-file-name
simultaneous-requests)
(httpd (with-port port
(with-root-directory (cwd)
(with-simultaneous-requests simultaneous-requests
(with-syslog? #t
(with-logfile log-file-name
;; The following settings are made to avoid dns lookups.
(with-reported-port port
(with-fqdn "localhost"
(with-resolve-ips? #f
(with-request-handler
(httpd (make-httpd-options
with-port port
with-root-directory (cwd)
with-simultaneous-requests simultaneous-requests
with-syslog? #t
with-logfile log-file-name
;; The following settings are made to avoid dns lookups.
with-reported-port port
with-fqdn "localhost"
with-resolve-ips? #f
with-request-handler
(alist-path-dispatcher
(list (cons "h" (home-dir-handler "public_html"))
(list (cons "h" (home-dir-handler "public_html"
(make-file-directory-options)))
; (cons "seval" seval-handler)
; (cons "man" (rman-handler #f "man?%s(%s)"
; "Generated by rman-gateway"))
@ -197,11 +199,20 @@ exec scsh -lm $sunet/packages.scm -lm $ssax/lib/packages.scm -lm $sunet/httpd/su
;; should serve .SCM files as text/plain (I did
;; not want to write a handler just for this file
;; type.)
(cons "source" (rooted-file-or-directory-handler surflet-dir))
(cons "img" (rooted-file-handler images-dir))
(cons "source" (rooted-file-or-directory-handler
surflet-dir
(with-file-name->content-type
(lambda (file-name)
(if (string-ci=? (file-name-extension file-name)
".scm")
"text/plain"))
(make-file-directory-options))))
(cons "img" (rooted-file-handler images-dir
(make-file-directory-options)))
(cons "surflet" (surflet-handler surflet-dir)))
(rooted-file-or-directory-handler htdocs-dir)))))))))))
))
(rooted-file-or-directory-handler htdocs-dir
(make-file-directory-options)))))
)
))
;; EOF

View File

@ -9,10 +9,10 @@ exec scsh -lm packages.scm -dm -o http-test -e main -s "$0" "$@"
httpd-make-options
httpd-basic-handlers
httpd-file-directory-handlers
cgi-server
seval-handler
rman-gateway
info-gateway
httpd-cgi-handlers
httpd-seval-handlers
httpd-rman-gateway
httpd-info-gateway
let-opt
scsh
scheme)
@ -133,21 +133,29 @@ exec scsh -lm packages.scm -dm -o http-test -e main -s "$0" "$@"
log-file-name
simultaneous-requests)
(httpd (with-port port
(with-root-directory (cwd)
(with-simultaneous-requests simultaneous-requests
(with-syslog? #t
(with-logfile log-file-name
(with-request-handler
(httpd (make-httpd-options
with-port port
with-root-directory (cwd)
with-simultaneous-requests simultaneous-requests
with-syslog? #t
with-logfile log-file-name
with-request-handler
(alist-path-dispatcher
(list (cons "h" (home-dir-handler "public_html"))
(list (cons "h" (home-dir-handler "public_html"
(make-file-directory-options)))
(cons "seval" seval-handler)
(cons "man" (rman-handler #f "man?%s(%s)"
;; You may want to adapt this to your site.
(cons "man" (rman-handler 'man
'nroff
"/usr/bin/rman"
"/usr/bin/zcat"
#f "man?%s(%s)"
"Generated by rman-gateway"))
(cons "info" (info-handler #f #f #f
"Generated by info-gateway"))
(cons "cgi-bin" (cgi-handler cgi-bin-dir)))
(rooted-file-or-directory-handler htdocs-dir))))))))))
(rooted-file-or-directory-handler htdocs-dir
(make-file-directory-options))))))
))
;; EOF

View File

@ -117,15 +117,19 @@ exec scsh -lm packages.scm -dm -o http-test -e main -s "$0" "$@"
port
log-file-name)
(httpd (with-port port
(with-root-directory (cwd)
(with-syslog? #t
(with-logfile log-file-name
(with-request-handler
(tilde-home-dir-handler "public_html"
(alist-path-dispatcher
(list (cons "cgi-bin" (cgi-handler cgi-bin-dir)))
(rooted-file-or-directory-handler htdocs-dir))))))))))
(httpd (make-httpd-options
with-port port
with-root-directory (cwd)
with-syslog? #t
with-logfile log-file-name
with-request-handler
(alist-path-dispatcher
(list (cons "cgi-bin" (cgi-handler cgi-bin-dir)))
(tilde-home-dir-handler "public_html"
(rooted-file-or-directory-handler
htdocs-dir
(make-file-directory-options))
(make-file-directory-options))))))
))
;; EOF