[plt-scheme] web-server with a single servlet
Jay wrote:
> The web-server does not support this out of the box. In the olden
> days, the `/servlets' URL was quite stamped into the system and I've
> been slowly working to get it out. [...] Also, you can look at the
> dispatcher API and write your on web-config unit and make a URL
> rewriter for the web-server. If you want to go on this route, I can
> guide you a bit more.
Yes. It would be nice to be able to publish servlets under specific
URLs. Perhaps something in the configuration file like:
(servlets
("/" (lib "root-servlet.ss" "my-package"))
("/admin" (lib "admin-servlet.ss" "my-package")))
; and so on ...
On a related note, I've come up with a couple of features that I think
might improve web-server for commercial use. None of them are
ground-breaking - just things that would make my life easier (and so
too, presumably, the lives of other people in my position). Some of
these involve the dispatcher. I'll contact you off-list about these.
> What went wrong with the mod_proxy? I do a similar thing and don't
> know what the problem with large files is (you can have Apache serve
> them).
It's the uploading of large files through <input type="file" ... />
controls that's problematic.
Noel and I spent some time looking into this yesterday: it seems that
there were at least two problems that were interacting. One problem was
with Apache and one was with web-server:
The web-server problem:
If web-server spent longer than about 30 seconds processing a
request,
it would time out (we traced the timeout back to line 198 of
dispatch-servlets.ss.
Using the managers/lru.ss instead of managers/timeout.ss fixes this
problem quite effectively.
The Apache problem:
As yet I have not fully diagnosed this, but even with the LRU fix to
web-server, Apache is still giving us proxy errors with really large
files.
For the moment I am getting around this by bypassing Apache for the
file upload. There's probably a configuration setting in mod_proxy
but
I haven't had time to look at it in detail.
Cheers,
-- Dave