r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[CGI] web server issues

Anton
20-Feb-2005
[35]
ok, so anyway, you're saying it's probably the last version of Core.
Tim
20-Feb-2005
[36]
I do not believe that 'rebol on the linux server is the latest. I 
am using 2.5.6.3.1 (for windows) on this machine. I think I've got 
the latest for linux on my main workstation, but it is not available 
right now....
Chris
21-Feb-2005
[37]
Running a script as --cgi or -cs should negate the need for -q.  
While this looks like the line-ending transfer bug, that it does 
actually perform the CGI program suggests otherwise (unless I don't 
recall this bug correctly).
Tim
21-Feb-2005
[38]
Chris: from what I see, it does not. Either the file has to be transfered 
and saved on the server with unix-style line enders or -q has to 
be there to make it work for me. Time will tell. Unfortunately I 
don't have a linux machine to download and compare.... Can you say 
"Heisenberg Uncertainty Principle"? :-) Anway, what works, works. 
I'll post more on this subject when I actually get back to programming. 
thanks.
Sunanda
21-Feb-2005
[39]
Never seen that problem, Tim, despite developing in Windows and running 
live in various GNU/Linux/UNIX systems/

But then all the websites I support that have REBOL CGIs use a REBOL 
uploader rather than an FTP program -- so line endings are automatically 
translated.
Chris
21-Feb-2005
[40x2]
Tim: this bit down at the bottom:
Content-Type: text/html

hello from D Drive
Is this a part of your script?
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.