World: r3wp
[CGI] web server issues
older newer | first last |
Micha 22-Feb-2005 [42] | how do starting skrypt cgi in rebolu ? |
PeterWood 22-Feb-2005 [43] | Try this How to - Quick & Easy CGI at http://www.rebol.com/docs/cgi1.html |
Micha 22-Feb-2005 [44x5] | now.cgi [ print probe system/options/cgi] |
serv: [ open tcp://:80 ] | |
browse 127.0.0.1:80/now.cgi | |
plis help ? | |
what do to make in order to this side displayed ? | |
Graham 22-Feb-2005 [49x2] | you need to run a web server .. and just opening tcp://:80 won't do it. |
check out the web servers on rebol.org | |
Sunanda 22-Feb-2005 [51] | Or install the Apache webserver for the full works -- http://www.apache.org Or something like Xitami for 99% of what you are likely to need -- http://www.xitami.com |
Brett 2-Mar-2005 [52] | For anyone interested in getting Carl's blogger script (blog.r) to work under Cal's rebol webserver (webserv.r): (1) Cal''s script passes Carl's script a tcp connection and set's no-wait on this connection. Carl's script doesn't like that. (2) So I modified the post section of read-cgi in Carl's script as follows: set-modes system/ports/input [binary: yes lines: no no-wait: false] if integer? content-length: attempt [to integer! system/options/cgi/Content-Length] [ data: copy/part system/ports/input content-length ] ; which is based on some code Gabriele suggested a long while ago (3) Also, Cal's script was performing poorly for me (even on static files) until I modified a wait statement from [listen 0] to [listen 0.01]. So far these two changes make the combination work quite fast for me. |
Graham 2-Mar-2005 [53x3] | I wonder when Dockimbel is going to release his Cheyenne web server ... it was slated for a Dec 04 release according to his website. |
Not really CGI .. but anyone knows what is involved in writing a mail server? | |
I presume that the minimum one needs to do is to listen on port 25 and respond appropriately | |
Dockimbel 2-Mar-2005 [56] | You also need to make a DNS lookup to get MX records for destination mail servers. |
Graham 2-Mar-2005 [57] | I was thinking more of a simple mail server that only accepts mail for one's own domain. In that case, I wouldn't need to do any mail forwarding. But I guess I still need to do a DNS lookup to confirm that the server sending mail is who they claim to be. |
Henrik 22-Apr-2005 [58x2] | this is probably old, but has anyone successfully made reading GET and POST data working in webserv.r? |
I just get none! data back... | |
Volker 22-Apr-2005 [60] | read-cgi: func [/local data len] [ either system/options/cgi/request-method = "POST" [ len: to-integer system/options/cgi/content-length data: to-string copy/part system/ports/input len ] [ data: system/options/cgi/query-string ] data ] |
Henrik 22-Apr-2005 [61x2] | exactly that returns none |
hopefully it doesn't have anything to do with Windows... | |
Volker 22-Apr-2005 [63] | maybe something with set-modes too. i patched around in mine a bit. |
Henrik 22-Apr-2005 [64] | I read your post on the mailing list and tried the code you posted. same thing.... |
Volker 22-Apr-2005 [65x3] | set-modes system/ports/input [lines: false no-wait: false] ? |
and the webserv from rebol.org? | |
and a non-alpha rebol? IIRC that has problems with set-modes lines. | |
Henrik 22-Apr-2005 [68x2] | yes, latest version of webserv.r. I also tried a simple read-io system/ports/input. also tried an old rebol/core version and a newer rebol/view version. two different machines. three different browsers. same thing. |
I must have forgotten something essential... | |
Volker 22-Apr-2005 [70] | restarted webserv.r after a change? it caches scripts. |
Henrik 22-Apr-2005 [71x2] | done that many times now... |
also on different rebol instances | |
Volker 22-Apr-2005 [73] | no good idea. how do you post? |
Henrik 22-Apr-2005 [74x2] | first I want GET working, haven't tried post yet, but they should be fetched the same way, shouldn't they? if I check system/options/cgi/request-method it's none |
everything in system/options/cgi is none | |
Volker 22-Apr-2005 [76] | hu? no, fetching works different. GET is part of the url. POST gets more data from the port. system/options/cgi should contain some environment-variables AFAIK. |
Henrik 22-Apr-2005 [77] | they do. they're all empty |
Volker 22-Apr-2005 [78] | normal webserving works? |
Henrik 22-Apr-2005 [79x4] | yes, perfectly |
ok, here goes: I inserted print [mold system/options/cgi] in the beginning of my script | |
The URL I'm calling is http://192.168.1.27/index.rhtml?mode=FeatureRequests | |
(local machine) and it returns: make object! [ server-software: none server-name: none gateway-interface: none server-protocol: none server-port: none request-method: none path-info: none path-translated: none script-name: none query-string: none remote-host: none remote-addr: none auth-type: none remote-user: none remote-ident: none Content-Type: none content-length: none other-headers: [] ] | |
Volker 22-Apr-2005 [83x2] | rhtml is not cgi |
that may be it. maybe there is a bug. | |
Henrik 22-Apr-2005 [85] | well, my index.rhtml file contains script generated output which works, encapsulated in :[ ]:. shouldn't I be able to see cgi data? |
Volker 22-Apr-2005 [86x5] | i see no cgi-handling in the code. |
if content = "rhtml" [ content: "text/html" data: rhtml data ] | |
and that function does nothing | |
no, i mean, does not call the cgi-stuff. | |
but its a short function. you could turn it in a real cgi-script, with embedded data. | |
Henrik 22-Apr-2005 [91] | trying the same file as index.r now... |
older newer | first last |