From 714031c1d6f53d8dc3799f2c02facdc775bf0132 Mon Sep 17 00:00:00 2001 From: Eli Barzilay Date: Thu, 6 Nov 2008 22:17:18 +0000 Subject: [PATCH] status.ss is always in the web directory, so people can modify it more easily svn: r12337 --- .../handin-server/scribblings/server-setup.scrbl | 14 ++++++++------ collects/handin-server/web-status-server.ss | 14 ++++++-------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/collects/handin-server/scribblings/server-setup.scrbl b/collects/handin-server/scribblings/server-setup.scrbl index 2ca94ad738..1116902f2d 100644 --- a/collects/handin-server/scribblings/server-setup.scrbl +++ b/collects/handin-server/scribblings/server-setup.scrbl @@ -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 diff --git a/collects/handin-server/web-status-server.ss b/collects/handin-server/web-status-server.ss index 298b741eb6..b95cd91ca3 100644 --- a/collects/handin-server/web-status-server.ss +++ b/collects/handin-server/web-status-server.ss @@ -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