Use image directory for gnuplot output.
This commit is contained in:
parent
fc7a6f3719
commit
03da4f6e05
|
@ -29,12 +29,14 @@ exec scsh -lm $sunet/packages.scm -lm $ssax/lib/packages.scm -lm $sunet/httpd/se
|
||||||
|
|
||||||
(define (usage)
|
(define (usage)
|
||||||
(format #f
|
(format #f
|
||||||
"Usage: start-web-server [-h htdocs-dir] [-s servlet-dir] [-p port]
|
"Usage: start-servlet-server [-h htdocs-dir] [-s servlet-dir] [-i images-dir]
|
||||||
[-l log-file-name] [-r requests] [--help]
|
[-p port] [-l log-file-name]
|
||||||
|
[-r requests] [--help]
|
||||||
|
|
||||||
with
|
with
|
||||||
htdocs-dir directory of html files (default: ./web-server/root/htdocs)
|
htdocs-dir directory of html files (default: ./web-server/root/htdocs)
|
||||||
servlet-dir directory of servlet files (default: ./web-server/root/servlets)
|
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)
|
port port server is listening to (default: 8080)
|
||||||
log-file-name directory where to store the logfile in CLF
|
log-file-name directory where to store the logfile in CLF
|
||||||
(default: ./web-server/httpd.log)
|
(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 htdocs-dir #f)
|
||||||
|
(define images-dir #f)
|
||||||
; (define cgi-bin-dir #f)
|
; (define cgi-bin-dir #f)
|
||||||
(define port #f)
|
(define port #f)
|
||||||
(define log-file-name #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)
|
(define (init)
|
||||||
(set! htdocs-dir "./web-server/root/htdocs")
|
(set! htdocs-dir "./web-server/root/htdocs")
|
||||||
|
(set! images-dir "./web-server/root/img")
|
||||||
; (set! cgi-bin-dir "./web-server/root/cgi-bin")
|
; (set! cgi-bin-dir "./web-server/root/cgi-bin")
|
||||||
(set! port "8088")
|
(set! port "8088")
|
||||||
(set! log-file-name "./web-server/httpd.log")
|
(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)
|
(define (normalize-options)
|
||||||
(set! htdocs-dir (absolute-file-name htdocs-dir))
|
(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! log-file-name (absolute-file-name log-file-name))
|
||||||
; (set! cgi-bin-dir (absolute-file-name cgi-bin-dir))
|
; (set! cgi-bin-dir (absolute-file-name cgi-bin-dir))
|
||||||
(set! port (string->number port))
|
(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))
|
(missing-argument-error (car options))
|
||||||
(set! htdocs-dir (cadr options)))
|
(set! htdocs-dir (cadr options)))
|
||||||
(loop (cddr 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")
|
((string=? (car options) "-c")
|
||||||
(format (error-output-port)
|
(format (error-output-port)
|
||||||
"This is the servlet server. It does not support cgi.~%")
|
"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:
|
(format #t "Going to run Servlet server with:
|
||||||
htdocs-dir: ~a
|
htdocs-dir: ~a
|
||||||
servlet-dir: ~a
|
servlet-dir: ~a
|
||||||
|
images-dir: ~a
|
||||||
port: ~a
|
port: ~a
|
||||||
log-file-name: ~a
|
log-file-name: ~a
|
||||||
a maximum of ~a simultaneous requests, syslogging activated,
|
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
|
htdocs-dir
|
||||||
servlet-dir
|
servlet-dir
|
||||||
|
images-dir
|
||||||
port
|
port
|
||||||
log-file-name
|
log-file-name
|
||||||
simultaneous-requests)
|
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
|
; (cons "info" (info-handler #f #f #f
|
||||||
; "Generated by info-gateway"))
|
; "Generated by info-gateway"))
|
||||||
; (cons "cgi-bin" (cgi-handler cgi-bin-dir))
|
; (cons "cgi-bin" (cgi-handler cgi-bin-dir))
|
||||||
(cons "source" (lambda (path req)
|
(cons "source" (rooted-file-or-directory-handler servlet-dir))
|
||||||
(format #t "source~%")
|
(cons "img" (rooted-file-handler images-dir))
|
||||||
((rooted-file-or-directory-handler servlet-dir) path req)))
|
|
||||||
(cons "servlet" (servlet-handler servlet-dir "/servlet/")))
|
(cons "servlet" (servlet-handler servlet-dir "/servlet/")))
|
||||||
(rooted-file-or-directory-handler htdocs-dir)))))))))))
|
(rooted-file-or-directory-handler htdocs-dir)))))))))))
|
||||||
))
|
))
|
||||||
|
|
Loading…
Reference in New Issue