From 97452408315dbf082f6adbc940122621a660c7b2 Mon Sep 17 00:00:00 2001 From: Eli Barzilay Date: Thu, 6 Nov 2008 22:05:50 +0000 Subject: [PATCH] adapt to new web-server configuration svn: r12336 --- .../status-web-root/conf/collect-garbage.html | 7 ----- .../status-web-root/conf/forbidden.html | 7 ----- .../status-web-root/conf/not-found.html | 7 ----- .../conf/passwords-refresh.html | 7 ----- .../status-web-root/conf/protocol-error.html | 7 ----- .../status-web-root/conf/servlet-error.html | 9 ------- .../status-web-root/conf/servlet-refresh.html | 7 ----- .../status-web-root/{htdocs => }/index.html | 2 +- collects/handin-server/web-status-server.ss | 26 ++++++++++--------- 9 files changed, 15 insertions(+), 64 deletions(-) delete mode 100644 collects/handin-server/status-web-root/conf/collect-garbage.html delete mode 100644 collects/handin-server/status-web-root/conf/forbidden.html delete mode 100644 collects/handin-server/status-web-root/conf/not-found.html delete mode 100644 collects/handin-server/status-web-root/conf/passwords-refresh.html delete mode 100644 collects/handin-server/status-web-root/conf/protocol-error.html delete mode 100644 collects/handin-server/status-web-root/conf/servlet-error.html delete mode 100644 collects/handin-server/status-web-root/conf/servlet-refresh.html rename collects/handin-server/status-web-root/{htdocs => }/index.html (60%) diff --git a/collects/handin-server/status-web-root/conf/collect-garbage.html b/collects/handin-server/status-web-root/conf/collect-garbage.html deleted file mode 100644 index 48017d9299..0000000000 --- a/collects/handin-server/status-web-root/conf/collect-garbage.html +++ /dev/null @@ -1,7 +0,0 @@ - -Garbage Collect Ran - -

The garbage collection routine has run.

-

Powered by PLT

- - diff --git a/collects/handin-server/status-web-root/conf/forbidden.html b/collects/handin-server/status-web-root/conf/forbidden.html deleted file mode 100644 index fcd2eb9032..0000000000 --- a/collects/handin-server/status-web-root/conf/forbidden.html +++ /dev/null @@ -1,7 +0,0 @@ - -Access Denied - -

The server could not verify that you have permissions to access the requested document.

-

Powered by PLT

- - \ No newline at end of file diff --git a/collects/handin-server/status-web-root/conf/not-found.html b/collects/handin-server/status-web-root/conf/not-found.html deleted file mode 100644 index 19bc1a0570..0000000000 --- a/collects/handin-server/status-web-root/conf/not-found.html +++ /dev/null @@ -1,7 +0,0 @@ - -Not Found - -

The file you were looking for was not found on this server.

-

Powered by PLT

- - diff --git a/collects/handin-server/status-web-root/conf/passwords-refresh.html b/collects/handin-server/status-web-root/conf/passwords-refresh.html deleted file mode 100644 index 3f283393ab..0000000000 --- a/collects/handin-server/status-web-root/conf/passwords-refresh.html +++ /dev/null @@ -1,7 +0,0 @@ - -Passwords Refreshed - -

The Web server is now using the new password file.

-

Powered by PLT

- - diff --git a/collects/handin-server/status-web-root/conf/protocol-error.html b/collects/handin-server/status-web-root/conf/protocol-error.html deleted file mode 100644 index 122732cc8d..0000000000 --- a/collects/handin-server/status-web-root/conf/protocol-error.html +++ /dev/null @@ -1,7 +0,0 @@ - -Browser Error - -

The browser sent a malformed request.

-

Powered by PLT

- - diff --git a/collects/handin-server/status-web-root/conf/servlet-error.html b/collects/handin-server/status-web-root/conf/servlet-error.html deleted file mode 100644 index bf6b698231..0000000000 --- a/collects/handin-server/status-web-root/conf/servlet-error.html +++ /dev/null @@ -1,9 +0,0 @@ - -Servlet Error - -

The servlet terminated abnormally.
- Please ask the author to fix the problem based on the details in - the Web server's log file.

-

Powered by PLT

- - diff --git a/collects/handin-server/status-web-root/conf/servlet-refresh.html b/collects/handin-server/status-web-root/conf/servlet-refresh.html deleted file mode 100644 index 8db24b53c5..0000000000 --- a/collects/handin-server/status-web-root/conf/servlet-refresh.html +++ /dev/null @@ -1,7 +0,0 @@ - -Servlets Refreshed - -

Fresh copies of Servlets will now be (re)loaded from disk.

-

Powered by PLT

- - diff --git a/collects/handin-server/status-web-root/htdocs/index.html b/collects/handin-server/status-web-root/index.html similarity index 60% rename from collects/handin-server/status-web-root/htdocs/index.html rename to collects/handin-server/status-web-root/index.html index 6b228e97e1..26af46228c 100644 --- a/collects/handin-server/status-web-root/htdocs/index.html +++ b/collects/handin-server/status-web-root/index.html @@ -3,6 +3,6 @@ The handin status server is running.
-You can check your submissions on this server. +You can check your submissions on this server. diff --git a/collects/handin-server/web-status-server.ss b/collects/handin-server/web-status-server.ss index 3ddb7db87f..298b741eb6 100644 --- a/collects/handin-server/web-status-server.ss +++ b/collects/handin-server/web-status-server.ss @@ -15,10 +15,15 @@ (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-plt-web-dir + (in-dir (build-path (collection-path "web-server") "default-web-root"))) + (define web-dir - (path->string - (or (get-conf 'web-base-dir) - (build-path (this-expression-source-directory) "status-web-root")))) + (cond [(get-conf 'web-base-dir) => path->string] + [else (in-here)])) (define config `((port ,port-no) @@ -43,17 +48,14 @@ (file-per-byte-connection-timeout 1/20) (file-base-connection-timeout 30)) (paths - (configuration-root "conf") - (host-root ,web-dir) + (configuration-root ,(in-plt-web-dir "conf")) + (host-root ".") (log-file-path ,(cond [(get-conf 'web-log-file) => path->string] [else #f])) - (file-root "htdocs") - (servlet-root ,web-dir) - (mime-types ,(path->string - (build-path (collection-path "web-server") - "default-web-root" - "mime.types"))) - (password-authentication "unused")))) + (file-root ".") + (servlet-root ,(in-here "servlets")) + (mime-types ,(in-plt-web-dir "mime.types")) + (password-authentication ,(in-plt-web-dir "passwords"))))) (virtual-host-table))) (define configuration