webserver multiple domains

Started by TedWalther, June 09, 2010, 01:24:05 PM

Previous topic - Next topic

TedWalther

Has anyone else used the newlisp http mode to host several domains at once?  Is the appropriate method to modify the command-prompt?  Is an environment variable already set, or should I parse stdin to find out what the domain is?  How much parsing does newlisp do in http mode?  Just the first line of PUT/GET/etc?  And what variables does newlisp use to do its evaluating/processing afterward.



For instance, I want to hook in a handler to generate a directory listing.  Is there a callback I can set?  Or should I just "exit" once I'm done handling my URL, on the assumption that newlisp forks for every connection?  What if I want to futz with the headers a bit, but otherwise let newlisp do its thing of reading a file and blasting it out over the socket?  Should I do that in newlisp?  Do I lose much efficiency in read/write by doing that?



I host quite a few domains; I'm currently migrating them all over to the newlisp webserver.



I understand about setting the Status line, then having complete control over the output.  Guess I'll have to make utility functions to do things that newlisp does automatically under the hood.



Ted
Cavemen in bearskins invaded the ivory towers of Artificial Intelligence.  Nine months later, they left with a baby named newLISP.  The women of the ivory towers wept and wailed.  \"Abomination!\" they cried.

Lutz

#1
newLISP server doesn't fork connections, but you can run it using the Unix inetd utility, and then a new instance gets launched on every connection. As newLISP has a quick load time the overhead of launching can be neglected. You can read all about this in the Users Manual.



For redirection and rewriting urls and requests use 'command-event' in a http-conf.lsp as also described in the Users Manual and also described in Code Patterns.



To see environment variables set by newLISP you can run:

http://www.newlisp.org/syntax.cgi?environment.txt">http://www.newlisp.org/syntax.cgi?environment.txt



  

itistoday

#2
I don't think newLISP's built-in web server is designed to be used to host live websites.... Doesn't sound like a very good idea. :-
Get your Objective newLISP groove on.

TedWalther

#3
I did read the Code Patterns article; that is what prompted me to try the experiment in the first place.  I see it would take more work than I have time for at the moment; I'm dropping back to having newLISP generate my Apache config.
Cavemen in bearskins invaded the ivory towers of Artificial Intelligence.  Nine months later, they left with a baby named newLISP.  The women of the ivory towers wept and wailed.  \"Abomination!\" they cried.