Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

Fun with Prohosting and REBOL

 [1/12] from: geneven::rocketmail::com at: 17-Apr-2001 23:11


As I was trying to set up REBOL on the free Prohosting site, I followed Michal Kracik's excellent instructions at http://hammer.prohosting.com/~rebol/rebol-cgi-prohosting.html and everything almost worked perfectly. However, I couldn't get beyond the word REBOL all by itself coming up in my browser (Internet Explorer -- does it matter?) I even went back to an earlier version of REBOL and got the same result. Finally, I chose View Source in the browser and got a surprise. It had been working all along, but for some reason wasn't displaying. All the information called for in Kracik's test script (cgitest.cgi) was there. I'm not particularly familiar with REBOL or CGI, so this is puzzling to me. Here's an interesting clue. Before the information called for in the script, information about REBOL that would probably be displayed if I did REBOL --help in Unix is displayed. Is there something, perhaps, in user.r or somewhere that would cause this help information to be displayed, thus bollacksing the html code and causing the information to hide out in the browser? Just in case someone wants to actually see the output, it's below. If I just look at the browser, I just see the word REBOL. But if I view source, I see a bunch of help information, and down after the Content-type line, I see the output I wanted to see. How do I squelch the bollacksing help info? Well, before I give that output, here's the actual script that is run: #!/usr/home1/geneven/html/cgi-bin/rebol -cgi REBOL [] print "Content-Type: text/plain^m^j" print "Hello world from REBOL" print mold system/options/cgi print system/version Now, below is what happens when I run the above script. REBOL <options> <script> <arguments> All fields are optional. Supported options are: --cgi (-c) Check for CGI input --do expr Evaluate expression --help (-?) Display this usage information --nowindow (-w) Do not open a window --noinstall (-i) Do not install (View) --quiet (-q) Don't print banners --reinstall (+i) Force an install (View) --script file Explicitly specify script --secure level Set security level: (none write read throw quit) --trace (-t) Enable trace mode Other command line options: +q Force not quiet (View) -s No security +s Full security Examples: REBOL script.r REBOL script.r 10:30 [test--domain--dom] REBOL script.r -do "verbose: true" REBOL --cgi -s REBOL --cgi --secure throw --script cgi.r "debug: true" REBOL --secure none Content-Type: text/plain Hello world from REBOL make object! [ server-software: "Apache/1.3.12 (Unix)" server-name: "lightning.prohosting.com" gateway-interface: "CGI/1.1" server-protocol: "HTTP/1.1" server-port: "80" request-method: "GET" path-info: none path-translated: none script-name: "/~geneven/cgi-bin/script.cgi" query-string: "" remote-host: none remote-addr: "24.11.68.251" auth-type: none remote-user: none remote-ident: none Content-Type: none content-length: none other-headers: ["HTTP_ACCEPT" {image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, */*} "HTTP_ACCEPT_ENCODING" "gzip, deflate" "HTTP_ACCEPT_LANGUAGE" "en-us" "HTTP_CONNECTION" Keep-Alive "HTTP_HOST" "lightning.prohosting.com" HTTP_REFERER {http://lightning.prohosting.com/~geneven/cgi-bin/testrebol.htm} HTTP_USER_AGENT {Mozilla/4.0 (compatible; MSIE 6.0b; Windows NT 5.0)}] ] 2.3.0.6.1 <//--><//"--></script> </NOSCRIPT></TITLE><SCRIPT LANGUAGE="JavaScript"> <!--Ad Banner function popupPage() { var windowopts location=no,scrollbars=no,menubars=no,toolbars=no,resizable=yes,left50,top=50,width=490,height=130 ; popup202977320 open('/prohost/banner.html',"MenuPopup",windowopts); popup202977320.focus(); } popupPage(); // Ad Banner--> </script>

 [2/12] from: stefan:falk:slg:se at: 18-Apr-2001 8:33


Hi, I haven't used the *nix version, but: #!/usr/home1/geneven/html/cgi-bin/rebol -cgi ^^^^ --cgi (-c) Check for CGI input ^^^^^ Maybe that's it? /Regards Stefan Falk

 [3/12] from: arolls:bigpond:au at: 18-Apr-2001 17:03


I think it should be --cgi, or -c. Note number of hyphens. Anton.

 [4/12] from: geneven:rocketmail at: 18-Apr-2001 4:27


So, that's a good guess, but would that give perfect output except for the help? I changed to --cgi and got Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, [webmaster--free--prohosting--com] and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log. as my output. I'm not sure this is a big improvement over perfect output plus extraneous help output. I'll try infinite other things when I come back from work tonight... --Gene --- Anton <[arolls--bigpond--net--au]> wrote:

 [5/12] from: cyphre:volny:cz at: 18-Apr-2001 15:02


Hello Gene I'm not sure but your problem is probably either in bad file atributes for the .cgi script or you are uploading the script using BINARY mode. Try to re-upload all your .cgi with ASCII transfer mode and the set CHMOD file attributes to code 711(owner- read/write/execute,group-execute, world-execute). Another solution could be to re-save the script file using any "better" text editor (ultraedit,notetab) as a UNIX text file. Cyphre

 [6/12] from: arolls:bigpond:au at: 18-Apr-2001 23:14


> Another solution could be to re-save the script file using > any "better" text editor (ultraedit,notetab) as a UNIX text file.
I think if you use rebol to upload to the unix box then it will convert to the correct format. I think I remember doing this... (don't use /binary mode to read and write). Anton.

 [7/12] from: kracik:mbox:dkm:cz at: 18-Apr-2001 15:41


Hi, the web server returns Internal Server Error when REBOL exits or crashes without printing the required CGI header, this happens when REBOL security exception occurs. Try disabling security with -cs, not --cgi or -cgi: #!/usr/home1/geneven/html/cgi-bin/rebol -cs Also, I'd double check script's end of line characters and permissions, which must be 711 for both rebol and the script. My test script worked with REBOL 2.2, I tried it and it still works with REBOL 2.5. http://hammer.prohosting.com/~rebol/cgi-bin/cgitest.cgi hope this helps, -- Michal Kracik Gene Venable wrote:

 [8/12] from: giovanni:cardona at: 18-Apr-2001 9:43


Try this.... in the very first line, type; #!rebol -cs After the rebol header, type print "Pragma: no-cache" print "Content-Type: text/html^/" And begin your very first HTML output like this..." print "<META HTTP-EQUIV='Pragma' CONTENT='no-cache'>" print "<META HTTP-EQUIV='Expires' CONTENT='0'>" print "<html><head><title>Your Title</title></head>" print "<killbanner>" This way, your page doesnt end up in a cache (in case your rebol script shows time sensitive data) and the "killbanner" shows the ProHosting logo in another window instead of in the same page. It works great for me... :) http://balder.prohosting.com/~mambo966/cgi-bin/cgismpro.cgi -=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=- "Miracles happen only to those who believe in them." * Visit 'The International Order of Sea-Monkey Owners' web site * http://home.coqui.net/menace/seamonke.htm * To subscribe to our monthly news, send a blank email to: * [instantlife-subscribe--listbot--com]

 [9/12] from: geneven:rocketmail at: 18-Apr-2001 15:52


Thanks, Giovanni. It works great for me, too, except I still get the same output I got before, with the extraneous REBOL help info. As soon as I View Source, I see all the right stuff. But as soon as I figure this out, I'll use your tricks. --Gene --- Giovanni Cardona <[giovanni--cardona--com]> wrote:
> Try this.... in the very first line, type; > #!rebol -cs
<<quoted lines omitted: 12>>
> another window instead of in the same page. > It works great for me... :)
http://balder.prohosting.com/~mambo966/cgi-bin/cgismpro.cgi
>
-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-
> "Miracles happen only to those who believe in them." > * Visit 'The International Order of Sea-Monkey Owners'
<<quoted lines omitted: 13>>
> > > >
http://hammer.prohosting.com/~rebol/rebol-cgi-prohosting.html
> > > > and everything almost worked perfectly.
<<quoted lines omitted: 119>>
> > "HTTP_REFERER" > >
{http://lightning.prohosting.com/~geneven/cgi-bin/testrebol.htm}
> > "HTTP_USER_AGENT" {Mozilla/4.0 (compatible; MSIE 6.0b; > > Windows NT 5.0)}]
<<quoted lines omitted: 7>>
> > var windowopts > >
location=no,scrollbars=no,menubars=no,toolbars=no,resizable=yes,left
> > 50,top=50,width=490,height=130
;
> > > > popup202977320
<<quoted lines omitted: 13>>
> > Yahoo! Auctions - buy the things you want at great > prices
=== message truncated ===

 [10/12] from: chris:ross-gill at: 18-Apr-2001 19:14


Hi Gene,
> It works great for me, too, except I still get the same > output I got before, with the extraneous REBOL help info. > As soon as I View Source, I see all the right stuff.
I had this problem briefly today with another host. Turns out I was using the wrong line endings - DOS instead of Unix. I just converted them and all was well. - Chris

 [11/12] from: kenlo:pop3free at: 19-Apr-2001 9:28


2001/4/17 PM 04:11:53, Gene Venable <[geneven--rocketmail--com]> wrote:
>As I was trying to set up REBOL on the free Prohosting >...
The source:- #!/usr/home2/kenlo/html/cgi-bin/rebol --cgi REBOL [] print "Content-type: text/plain^m^j" print "Hello world from REBOL" print mold system/options/cgi print system/version See how it works in http://jove.prohosting.com/~kenlo/cgi-bin/test.cgi

 [12/12] from: steve_rebol:yaho:o at: 19-Apr-2001 11:23


I am not sure about UNIX hosting, but in order to get rebol working (and reading and writing files) on my Windows Server under Apache i used. --cgi -s --script steve --- Gene Venable <[geneven--rocketmail--com]> wrote:

Notes
  • Quoted lines have been omitted from some messages.
    View the message alone to see the lines that have been omitted