[REBOL] Creating Servers in Rebol on Linux Re:
From: ryanc:iesco-dms at: 28-Aug-2000 13:05
> I asked this before to no avail.
> The SID-SERVER from the Official Guide or any server for that matter
> created in Rebol and to be run on Linux.
> How do I make the thing run resident so I can start or stop it via remote cgi?
What is the best way to peel an orange? Numerous ways come to my mind. First is
just to do what your trying to do, the manual way with telnet.
Another way is to have the server either stop taking requests either upon special
command either quiting or waiting for the "on" command. And yet another way would
be to have the server not take requests between a certain time periods.
Your decision just depends really on what you want it to do in the grand scheme of
things. I will be kind and give an example to play with.
Title: "Slightly Upgraded SID Server"
listen-port: open/lines tcp://:8080
send-http: func [data mime] [
insert data rejoin ["HTTP/1.0 200 OK^/Content-type: " mime "^/^/"]
insert http-port data
send-http "<H1>SERVER KILLED</H1>" mime
send-http "<H1>SERVER RESET</H1>" mime
max-sid: form (load max-sid) + 5000
send-http copy max-sid mime
http-port: first wait listen-port
probe request: first http-port
command: second probe parse/all request " "
do select command-list command
> Right now, I must telnet in and run manually, if I close telnet client,
> server shuts down.
Hmmm... I have never run into this. Probably your telnet server. Are you logged
in as root?
Try another telnetd maybe. Good question for a Linux newsgroup.
Anyways, have fun,