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

Putting Rebol on Server?

 [1/8] from: robert::starcenter::com at: 4-Nov-2002 2:13

Hello, I wish to put Rebol Core on my server, in order to run Rebol scripts for my website. The problem is, Rebol is not supported by my server (, FreeBSD, Apache). The techs there attempted to help me get Rebol configured, but they finally gave up and suggested that I ask the Rebol people directly. So --- does anyone know how I might go about configuring my server to recognize and run Rebol scripts? I have already uploaded Rebol Core to my www directory. I have set the permissions to read, write, and execute by all, and have uploaded a test script from the Rebol manual to my htdocs directory. The Verio techs told me to create a .htaccess file and put the following lines in it: AddType application/x-httpd-rebol .r Action application/x-httpd-rebol /cgi-bin/rebol.exe I did so. But when I go to: (a test email script at my website), nothing works. Here is the code for email.r: -------------------------------------------------------------------------- #!/path/to/rebol -cs REBOL [Title: "Send CGI Email"] print "Content-Type: text/html^/" cgi: make object! decode-cgi-query system/options/cgi/query-string print {<HTML><BODY><H1>Email Status</H1><HR><P>} failed: error? try [send to-email cgi/email cgi/message] print either failed [ {The email could not be sent.} ][ [{The email to} cgi/email {was sent.}] ] print {</BODY><HTML>} -------------------------------------------------------------------------- Can you explain what I might do, or suggest where I might find exact information to learn about this? Thank you. Sincerely, Robert Tkoch

 [2/8] from: al:bri:xtra at: 7-Nov-2002 15:52

Robert wrote:
> I did so. But when I go to: (a test
email script at my
> website), nothing works. Here is the code for email.r: > -------------------------------------------------------------------------- > #!/path/to/rebol -cs
Try changing the above line from: #!/path/to/rebol -cs to: #!/cgi-bin/rebol.exe -cs And I think it will work, provided you're using a similar operating system to what your server is using. That's because a Windows OS has different line endings for text files to a UNIX OS. Andrew Martin ICQ: 26227169

 [3/8] from: jason:cunliffe:verizon at: 6-Nov-2002 22:05

Robert Try just adding this to your .htaccess file Addhandler cgi-script .r If you decide to suffix your rebol scripts .xyz or .cgi .pl [eek!!] then you can do so : Addhandler cgi-script .r .xyz or .cgi .pl All of those will Apache web server to execute them as cgi-scripts. That givses permission. The next step is up to your scrip to define what applcaition it wants to use, as defined in the the first line, as you are doing: #!/path/to/rebol -cs Once it is working, you may want Rebol to generate directory indexes. If so, just add this line to .htaccess DirectoryIndex index.html index.htm index.shtml index.r That means when someone goes to: Apache will look first for a file called index.html and use that. If it does not find any index.html, it will go on down the list until it finds one, eventually perhaps getting to index.r [or whatever you want to name it] If your want Rebol to be your first choice to handle the default index, then put it as the first item instead: DirectoryIndex index.r index.html index.htm index.shtml In that case, even if index.html also exists, index.r will be run. hth ./Jason

 [4/8] from: louisaturk:coxinet at: 6-Nov-2002 22:04

Hi Robert, Sending the following to my ISP enabled them to get things set up right for me: CGI Scripts Before developing REBOL CGI scripts: 1. Set up CGI access on your webserver following instructions from your web provider and the section below on Setting up CGI in Your Web Server. 2. Set up REBOL networking using the set-net command. Setting up CGI in Your Web Server Setting up CGI access is different in every web server. In most cases, once you have the web server set up and serving web pages you will need to enable the execute CGI option, (ExecCGI in Apache) and configure the directory where CGI programs may reside (typically cgi-bin). The final step is to make your CGI scripts runnable. On most UNIX-type systems or those that use Apache or similar web server, make the CGI script readable and executable by all users and have the appropriate header. Refer to Standard Script Header, below. With other web servers, the system may require configuration to execute the REBOL executable for .r extension files and run REBOL with any required options, such as --cgi or -cs. CGI Configuration Under Microsoft IIS To configure CGI for MS IIS, go into the Properties of cgi-bin and and click on the Configuration button. This brings up a configuration requester. Click on Add and enter the location e path to your rebol.exe file like this: C:\rebol\rebol.exe -cs %s %s The two %s %s must be added to make sure it works correctly when passing the script and command line arguments to REBOL. Add the extension or REBOL files and set the last field to PUT, DELETE. The script engine doesn't have to be selected. Hope this helps. Louis At 02:13 AM 11/4/2002 -0800, you wrote:

 [5/8] from: robert:starcenter at: 7-Nov-2002 15:38

Hello, Thank you for your help. I did as you suggested, but only managed to get a server error. Here is my test script, uploaded to htdocs, with permissions set to read/write/execute by all: #! -cs REBOL [Title: "CGI Test Script"] print "Content-Type: text/plain" print "" ; required print "Hello!" I tried two .htaccess files. One simply said: AddHandler cgi-script .r The other said: AddType application/x-httpd-rebol .r Action application/x-httpd-rebol /cgi-bin/rebol.exe AddHandler cgi-script .cgi AddHandler cgi-script .pl AddHandler cgi-script .r The .htaccess file is located in the www directory. I went to (my site with the test script), and received the following error: Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, [webmaster--starcenter--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. Apache/1.3.26 Server at Port 80 I also tried uploading the script to the cgi-bin, but that made no difference. I have rebol core in the cgi-bin with permissions set to read/write/execute by all. Any ideas? Thank you. Sincerely, Robert Tkoch 11/6/2002 7:05:58 PM, Jason Cunliffe" <[jason--cunliffe--verizon--net]> wrote:

 [6/8] from: jason:cunliffe:verizon at: 7-Nov-2002 19:31

Robert you're almost there.. Q1: Did you remember to make the script executable ? In a login shell enter: chmod 755 test-absolute.r Heres a mimimal cgi script I use to check Rebol installations. It displays the date and time. ------------------------------- #!/home/jasonic/rebol/rebol -cs REBOL[] print "Content-type: text/html^/^/" result: copy "" append result rejoin[now/precise <br>] print result ------------------------------- Also if you get errors, check by looking at the Apache logs. In a login shell enter: tail path-to-your-apache-logs/error_log Call that rigth after you get an error. hth and please post a little report when you get it running good luck ./Jason

 [7/8] from: sunandadh:aol at: 7-Nov-2002 19:11

> Any ideas?
Here's one thing to look at.... If you are uploading a file from MAC or PC/DOS/Windows to UNIX, you've got to make sure the line terminations are right -- all three platforms indicate new line/carriage return in text files differently. Getting it wrong can cause this message....I know -- I spent nearly two days tearing hair out trying to debug this once. If you upload with Rebol, it'll make all the right conversions for you. If you upload with an FTP program it may not. You'll probably want to set ASCII mode (but the hows depend on the program) Sunanda. Sunanda

 [8/8] from: jan:skibinski:sympatico:ca at: 7-Nov-2002 19:39

Hi Robert, Could it be that the very first first line is causing you your trouble? Do you really intend to execute rebol.exe remotely via http? Shouldn't you point Apache to a local location so it will find the rebol.exe within its own filesystem? #!/usr/local/...rebol/rebol --cgi (or --cs) Jan Robert Tkoch wrote: