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

World: r3wp

[CGI] web server issues

Volker
22-Apr-2005
[128x6]
yes, wuld be good. message Cal.
but strange that the normal pages worked.
for debugging i would look for
   insert tail script-cache reduce [file-path script]

in webserv.r and comment that out. so that it loads allways from 
disk.
and in the error-catch around it 
  [probe disarm local]
instead of 
  []
and for your script:
print "Content-type: text/html^/" 
read-cgi: ...
args: decode-cgi read-cgi 
template: {
 <html><body> <pre> <% mold args %> </pre> </body></html>
}
print build-markup template
thats similar to %.rhtml
have fun ;)
Henrik
22-Apr-2005
[134x3]
thank you very much!
those things would make very nice additions to webserv.r too
cgi works now. groovy!
RebolJohn
18-May-2005
[137]
HELP w/ web rebol associations AND Rebol-View.
Here is the story..


On my PC, I have View pointing to an index.r file on my web server.
Everything is cool.

When I open up Rebol-View and traverse to my index.r on the server..
it works.


Now on the same server, I change the IIS-Web associations so that 
I can do rebol CGI.
I create a 'main.r' in some virtual directory on the server.
Web-ing to this http.//myserver/mydir/main.r   works GREAT!
CGI is working.


However, when I now open up Rebol-View on my local PC and traverse 
to my index.r which is
on the server.. I get an error.


The problem is that before.. rebol-view was requesting a file-download 
and the server sends it.

Now since IIS is doing '*.r' CGI, when rebol-view requests for the 
index.r download.. the server is processing the request
and attempting to send back html.. not a rebol file.


Is there any way of fixing this other than..

* changing the CGI association from '*.r' to something else  (ie. 
'*.rr')

* changing all my view-apps on the server from '*.r' to something 
else   (ie. '*.rr')
??
DideC
18-May-2005
[138]
Not that I know of. The way is to change cgi association (*.rcgi 
?)
Allen
18-May-2005
[139]
best to change the association on IIS, so you don't accidently have 
a desktop script or browser plugin script execute on the server. 
you'll sleep better :-)
RebolJohn
19-May-2005
[140]
Thanks.. I like the sound of  *.rcgi
BrianW
28-May-2005
[141x2]
hrm. I get weird behavior trying to run a cgi.

Here's the code:

#!/usr/local/bin/rebol -c

REBOL [
	Title: "Server Time"
]

print "content-type: text/html^/"
print [<HTML><BODY>]
print ["Date/time is:" now]
print [</BODY></HTML>]


I get an Internal Server Error result in the browser, and here's 
the output in my error_log:


[Sat May 28 16:21:38 2005] [error] [client 127.0.0.1] *** Boot Error 
951: \r

[Sat May 28 16:21:38 2005] [error] [client 127.0.0.1] Premature end 
of script headers: time.r


If I run if with 'rebol time.r', it clears the screen and then displays 
this:

content-type: text/html

<HTML> <BODY>
Date/time is: 28-May-2005/16:24:42-7:00
</BODY> </HTML>
Aborted

What the heck am I doing wrong?
oh, and /usr/local/bin/rebol is just the rebol executable copied 
over.
Volker
28-May-2005
[143]
line-endings converted to unix?
BrianW
28-May-2005
[144x2]
well, I'm editing and running on my linux machine, so I assume so.
yeah, fileformat=unix
Volker
28-May-2005
[146]
agreed. also the error-message looks more like a wrong header. nut 
this content-type looks ok to me.
Tomc
28-May-2005
[147]
what do you get calling it from the command line
BrianW
28-May-2005
[148]
The command line output is towards the end of my plea for help up 
above
PeterWood
28-May-2005
[149]
Brian - which version of REBOL are your using?
Tomc
28-May-2005
[150]
the premature end of script often means something is issueing an 
error/warrning
Volker
28-May-2005
[151x2]
what error-message do you get if you do it intentionally really wrong? 
wrong exe-path, wrong header, without permission?
Brian has console -output at bottom of his post.
BrianW
28-May-2005
[153]
I'm using Rebol/View (the stable release).
Volker
28-May-2005
[154]
aah! cgi-scripts on linux do not work then.
BrianW
28-May-2005
[155]
well shoot. Core only?
Tomc
28-May-2005
[156]
what is that "aborted?
Volker
28-May-2005
[157]
/view wants to connect to x and errors out without. and cgi usually 
has no DISPLAY set (or no X on server at all).
BrianW
28-May-2005
[158]
Hm, I wanted access to the image manipulation functions from View.
Volker
28-May-2005
[159]
IIRC correctly command can do that, without text. and there are some 
betas published, maybe they run?
BrianW
28-May-2005
[160]
I'll give that a shot, thanks Volker.
Volker
28-May-2005
[161]
do you have X on your server? (the one which you use later)
BrianW
28-May-2005
[162x3]
I can't assume that it would.
Oh wait, I don't have the money for command. Drat.
right. rebcmd works fine. I'm going to go hide my head in shame now.
Volker
28-May-2005
[165x2]
runs without license, only the special things are disabled. don't 
know if its intended to use it that way, but its downloadable.
would be rebcmdview then with graphics. i am curious if that runs 
without x with faces.
BrianW
28-May-2005
[167x2]
so far, no.
I mean, I am getting okay results from the command line (no aborted 
message), but still get the same error message when run as cgi.
Volker
28-May-2005
[169]
then i remember that wrong. sad.
BrianW
28-May-2005
[170x2]
[[wisti-:-localhost] cgi-bin]$ /usr/local/bin/rebol -c time.r
content-type: text/html

<HTML> <BODY>
Date/time is: 28-May-2005/16:47:35-7:00
</BODY> </HTML>
[[wisti-:-localhost] cgi-bin]$
I'm a little baffled.
Volker
28-May-2005
[172x2]
make an xterm and unset DISPLAY. that should give the error-message.
or try it from one of the system-consoles, utside x.
BrianW
28-May-2005
[174x2]
[[wisti-:-localhost] cgi-bin]$ unset DISPLAY
[[wisti-:-localhost] cgi-bin]$ /usr/local/bin/rebol -c time.r
content-type: text/html

<HTML> <BODY>
Date/time is: 28-May-2005/16:50:36-7:00
</BODY> </HTML>
no affect. I even tried shifting over to another virtual console 
and ran from there with no bad luck.
Volker
28-May-2005
[176]
^/view should tell something about missing font or such. *shrug*
BrianW
28-May-2005
[177]
I'm using rebcmd2555042a1 for these tests now.