HOW-TO serve multiple apps with the builtin newLISP -http

Started by hilti, April 22, 2009, 09:30:06 AM

Previous topic - Next topic

hilti

Hi Fan Club!



This is my day three on newLISP and my first post in this forums. Originally I came from PHP, took a short trip with Rails and discovered newLISP via a short research on the XEROX Star.



Yes - the XEROX Star - an old, but so impressive system which runs completely on LISP. I googled about LISP and found this forum. That's my story :-)



I'm very impressed about the work Lutz has done!!



Back to my topic:

Is it possible to serve multiple applications on Port 80 with the builtin newLISP webserver?



Maybe we could use the newLISP Wiki to build up some great HOW-TO tutorials.



What Do you think?



Best Regards from Germany!

Marc
--()o Dragonfly web framework for newLISP

http://dragonfly.apptruck.de\">http://dragonfly.apptruck.de

cormullion

#1
Hi Marc...


QuoteIs it possible to serve multiple applications on Port 80 with the builtin newLISP webserver?


If you can you access different CGI files underneath the specified directory, this might let you serve different applications...

cgs1019

#2
Marc



I am also new to newlisp. When I first found it I browsed the newlisp source and found that the http connection code is single threaded and blocks on more than one connection.



In order to use newlisp in a more robust server setting I'm playing with apache/cgi. Simply set up a webfolder, enable cgi in your apache server, and create an index.cgi script (with executable permissions) and you're in. Writing code to parse HTTP requests is an excellent exercise to familiarize yourself with newlisp :)



I use apache mod_rewrite to map arbitrary path requests through index.cgi and into handler code which enables me to model a RESTful(ish) sytle service. mod_rewrite should be present in any recent-ish apache dist, but might not be enabled by default in apache.conf (or httpd.conf, depending on dist), and there are lots of tutorials online. (Make sure you add AllowOverride to the Options statement in your apache configuration for the web directory in which you're using rewrite -- this has tripped me up a couple times and is tough to debug).



Anyway, I'm quite interested in the possibility of using newlisp's spawn, net-listen, net-accept, etc. to whip up a nice multi-threaded server with child threads spawning per connection and inheriting the parent symbol space. This would make for a very interesting and powerful dynamic system, customizable on the fly.



If you decide to try the apache stuff, feel free to post back here and I'll walk you through whatever you might have trouble with.



Cheers
-- Christopher Suter



\"The only reason for time is so that everything doesn\'t happen at once.\"

Albert Einstein

cormullion

#3
there are some threads that you guys might want to peruse:



http://www.alh.net/newlisp/phpbb/viewtopic.php?t=2464">http://www.alh.net/newlisp/phpbb/viewtopic.php?t=2464

http://www.alh.net/newlisp/phpbb/viewtopic.php?t=2203">http://www.alh.net/newlisp/phpbb/viewtopic.php?t=2203

http://www.alh.net/newlisp/phpbb/viewtopic.php?t=2197">http://www.alh.net/newlisp/phpbb/viewtopic.php?t=2197

http://www.alh.net/newlisp/phpbb/viewtopic.php?t=2191">http://www.alh.net/newlisp/phpbb/viewtopic.php?t=2191

http://www.alh.net/newlisp/phpbb/viewtopic.php?t=405">http://www.alh.net/newlisp/phpbb/viewtopic.php?t=405

http://www.alh.net/newlisp/phpbb/viewtopic.php?t=434">http://www.alh.net/newlisp/phpbb/viewtopic.php?t=434

http://www.alh.net/newlisp/phpbb/viewtopic.php?t=320">http://www.alh.net/newlisp/phpbb/viewtopic.php?t=320

cgs1019

#4
This is great. Thanks a lot!
-- Christopher Suter



\"The only reason for time is so that everything doesn\'t happen at once.\"

Albert Einstein