Use image directory for gnuplot output.

This commit is contained in:
interp 2002-10-22 16:01:25 +00:00
parent fc7a6f3719
commit 03da4f6e05
1 changed files with 16 additions and 5 deletions

View File

@ -29,12 +29,14 @@ exec scsh -lm $sunet/packages.scm -lm $ssax/lib/packages.scm -lm $sunet/httpd/se
(define (usage)
(format #f
"Usage: start-web-server [-h htdocs-dir] [-s servlet-dir] [-p port]
[-l log-file-name] [-r requests] [--help]
"Usage: start-servlet-server [-h htdocs-dir] [-s servlet-dir] [-i images-dir]
[-p port] [-l log-file-name]
[-r requests] [--help]
with
htdocs-dir directory of html files (default: ./web-server/root/htdocs)
servlet-dir directory of servlet files (default: ./web-server/root/servlets)
images-dir directory of images files (default: ./web-server/root/img)
port port server is listening to (default: 8080)
log-file-name directory where to store the logfile in CLF
(default: ./web-server/httpd.log)
@ -46,6 +48,7 @@ exec scsh -lm $sunet/packages.scm -lm $ssax/lib/packages.scm -lm $sunet/httpd/se
))
(define htdocs-dir #f)
(define images-dir #f)
; (define cgi-bin-dir #f)
(define port #f)
(define log-file-name #f)
@ -55,6 +58,7 @@ exec scsh -lm $sunet/packages.scm -lm $ssax/lib/packages.scm -lm $sunet/httpd/se
(define (init)
(set! htdocs-dir "./web-server/root/htdocs")
(set! images-dir "./web-server/root/img")
; (set! cgi-bin-dir "./web-server/root/cgi-bin")
(set! port "8088")
(set! log-file-name "./web-server/httpd.log")
@ -64,6 +68,7 @@ exec scsh -lm $sunet/packages.scm -lm $ssax/lib/packages.scm -lm $sunet/httpd/se
(define (normalize-options)
(set! htdocs-dir (absolute-file-name htdocs-dir))
(set! images-dir (absolute-file-name images-dir))
(set! log-file-name (absolute-file-name log-file-name))
; (set! cgi-bin-dir (absolute-file-name cgi-bin-dir))
(set! port (string->number port))
@ -93,6 +98,11 @@ exec scsh -lm $sunet/packages.scm -lm $ssax/lib/packages.scm -lm $sunet/httpd/se
(missing-argument-error (car options))
(set! htdocs-dir (cadr options)))
(loop (cddr options)))
((string=? (car options) "-i")
(if (null? (cdr options))
(missing-argument-error (car options))
(set! images-dir (cadr options)))
(loop (cddr options)))
((string=? (car options) "-c")
(format (error-output-port)
"This is the servlet server. It does not support cgi.~%")
@ -148,6 +158,7 @@ exec scsh -lm $sunet/packages.scm -lm $ssax/lib/packages.scm -lm $sunet/httpd/se
(format #t "Going to run Servlet server with:
htdocs-dir: ~a
servlet-dir: ~a
images-dir: ~a
port: ~a
log-file-name: ~a
a maximum of ~a simultaneous requests, syslogging activated,
@ -157,6 +168,7 @@ exec scsh -lm $sunet/packages.scm -lm $ssax/lib/packages.scm -lm $sunet/httpd/se
"
htdocs-dir
servlet-dir
images-dir
port
log-file-name
simultaneous-requests)
@ -179,9 +191,8 @@ exec scsh -lm $sunet/packages.scm -lm $ssax/lib/packages.scm -lm $sunet/httpd/se
; (cons "info" (info-handler #f #f #f
; "Generated by info-gateway"))
; (cons "cgi-bin" (cgi-handler cgi-bin-dir))
(cons "source" (lambda (path req)
(format #t "source~%")
((rooted-file-or-directory-handler servlet-dir) path req)))
(cons "source" (rooted-file-or-directory-handler servlet-dir))
(cons "img" (rooted-file-handler images-dir))
(cons "servlet" (servlet-handler servlet-dir "/servlet/")))
(rooted-file-or-directory-handler htdocs-dir)))))))))))
))