status.ss is always in the web directory, so people can modify it more easily

svn: r12337
This commit is contained in:
Eli Barzilay 2008-11-06 22:17:18 +00:00
parent 9745240831
commit 714031c1d6
2 changed files with 14 additions and 14 deletions

View File

@ -116,11 +116,13 @@ This directory contains the following files and sub-directories:
@item{@indexed-scheme[web-base-dir] --- if @scheme[#f] (the
default), the built-in web server will use the
@filepath{status-web-root} in this collection for its
configuration; to have complete control over the built in server,
you can copy and edit @filepath{status-web-root}, and add this
configuration entry with the name of your new copy (relative to
the handin server directory, or absolute).}
@filepath{status-web-root} in the handin collection for its
configuration; to have complete control over the built in server
content, you can copy and edit @filepath{status-web-root}, then
add this configuration entry set to the name of your new copy
(relative to the handin server directory, or absolute). Note that
you must copy the @filepath{servlets} directory if you want the
status servlet.}
@item{@indexed-scheme[web-log-file] --- a path (relative to handin
server directory or absolute) that specifies a filename for
@ -217,7 +219,7 @@ This directory contains the following files and sub-directories:
Changes to @filepath{config.ss} are detected, the file will be
re-read, and options are reloaded. A few options are fixed at
startup time: port numbers, log file specs, and the
@scheme[web-base-dir] are as configured at startup. All other
@scheme[web-base-dir] are fixed as configured at startup. All other
options will change the behavior of the running server (but things
like @scheme[username-case-sensitive?] it would be unwise to do
so). (For safety, options are not reloaded until the file parses

View File

@ -16,15 +16,13 @@
(define (serve-status port-no)
(define ((in-dir dir) . paths) (path->string (apply build-path dir paths)))
(define in-here
(in-dir (build-path (this-expression-source-directory) "status-web-root")))
(define in-web-dir
(in-dir (or (get-conf 'web-base-dir)
(build-path (this-expression-source-directory)
"status-web-root"))))
(define in-plt-web-dir
(in-dir (build-path (collection-path "web-server") "default-web-root")))
(define web-dir
(cond [(get-conf 'web-base-dir) => path->string]
[else (in-here)]))
(define config
`((port ,port-no)
(max-waiting 40)
@ -53,7 +51,7 @@
(log-file-path ,(cond [(get-conf 'web-log-file) => path->string]
[else #f]))
(file-root ".")
(servlet-root ,(in-here "servlets"))
(servlet-root ,(in-web-dir "servlets"))
(mime-types ,(in-plt-web-dir "mime.types"))
(password-authentication ,(in-plt-web-dir "passwords")))))
(virtual-host-table)))
@ -61,7 +59,7 @@
(define configuration
(configuration-table-sexpr->web-config@
config
#:web-server-root web-dir
#:web-server-root (in-web-dir)
#:make-servlet-namespace
(make-make-servlet-namespace
#:to-be-copied-module-specs