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

Troubles in CGI land

 [1/8] from: stevej::sieve::net at: 25-Apr-2001 0:40


Hi fellow REBOL nerds, I downloaded the newest REBOL/View yesterday and have been playing around with it again but I'm having a problem with a simple CGI script. Inside of my cgi-bin, I have a script called test.r, which is the following: -------------------------------------- #!/usr/local/rebol/rebol -cs print "Content-Type: text/plain" print "" ; print "Hello!" send [stevej--sieve--net] decode-cgi input --------------------------------------- The permissions are 755 (rwxr-xr-x), other cgi's run out of this directory just fine, and I'm able to use rebol from the command-line with no problem, with the rebol executable referenced above. Unfortunately, when I call this CGI from a webbrowser, it starts a download (I assume because of a lack of a Content-Type header) of the following text: {** Near: size: size-text self all [ para para/origin size: size + para/origin para/margin size: size + para/margin ] ... (funky escape characters) (you can see this for yourself at http://sieve.net/cgi-bin/test.r) What is this? When I run that single line from within the REBOL/View environment, it works fine. I'm baffled. There's nothing in my apache error logs, and no obvious sign of problems. I'm too new to the langauge to really diagnose it farther so I'd like to call on you kids for some help. BTW my prefs.r in /usr/local/rebol are such: REBOL [Title: "User Preferences" Date: 24-Apr-2001/2:34:51-7:00 ] name: "steve jenson" pass: none express: "none" server: "localhost" script: "none" proxy-user: none proxy-pass: none root: none poll-time: none connect-wait: none log: true debug: false window-size: none window-offset: 689x529 icon-offset: none keymap: none auto-connect: true always-close: true desktop: false skin: none I'm running Linux 2.2.16 and apache 1.3.19. The REBOL/View in question is: REBOL/View/Pro 1.1.0.4.2 17-Apr-2001 Thanks for any help, steve -- steve jenson <[stevej--sieve--net]> http://sieve.net/ PGP fingerprint: 79D0 4836 11E4 A43A 0179 FC97 3AE2 008E 1E57 6138

 [2/8] from: sanghabum:aol at: 25-Apr-2001 5:42


I had a similar problem last week. My script ran fine if browsed from Internet Explorer or Opera. But it downloaded as a text file if browsed from Lynx. I spent a long-time banging my head against a click wall trying to fix it. In the end I put it to one side. Strange thing is, Lynx works fine today. I don't know what the difference is. Sorry. This post is to express solidarity and sympathy, not to solve your problem......Other than to suggest you try another browser. --Colin

 [3/8] from: gchiu:compkarori at: 25-Apr-2001 22:10


On Wed, 25 Apr 2001 00:40:09 -0700 steve jenson <[stevej--sieve--net]> wrote:
> I downloaded the newest REBOL/View yesterday and have > been playing around
<<quoted lines omitted: 5>>
> -------------------------------------- > #!/usr/local/rebol/rebol -cs
Why are you using Rebol view for cgi? Have you tried Core with the same settings? -- Graham Chiu

 [4/8] from: m:koopmans2:chello:nl at: 25-Apr-2001 16:48


Hey Steve, Change the options from -cs to --cgi -s It seems to be changed in View --Maarten

 [5/8] from: carl:rebol at: 25-Apr-2001 9:18


Maartin, --cgi -s... we'll check on that. Odd. It is also likely that this error is coming from X-windows not being installed on the server (which is often the case). The size-text requires fonts, hence X-windows, and blows out. We will need to create an explicit error message for this in the future. Solution: use REBOL/Core, not REBOL/View on servers. We will be releasing REBOL/Core/Pro for those who want encryption, shell, and libraries on servers. -Carl

 [6/8] from: ingo:2b1 at: 25-Apr-2001 12:10


Hi Steve, I'm not sure if ths relates to your problem, but for cgi purposes it's best to use the respective /Core distribution. - should startup faster (no /View overhead) - !!! /View needs the X11 libraries to be installed, which is not the case on most web-servers !!! (could this be your problem?) just a thought, kind regards, Ingo

 [7/8] from: stevej:sieve at: 25-Apr-2001 11:49


Quoting Ingo Hohmann ([ingo--2b1--de]):
> Hi Steve, > > I'm not sure if ths relates to your problem, but for cgi > purposes it's best to use the respective /Core distribution.
I bothers me to have multiple kinds of REBOL distributions, but it doesn't bother me that much. Switching to /Core solved the problem, but adding the --cgi -s switches in my call to /View did not. It'd be great if I could run CGI's with /View and /View/Pro. I'm glad to hear Carl say that he'll be released /Core/Pro. I want my DH EKE! ;-)
> - should startup faster (no /View overhead) > - !!! /View needs the X11 libraries to be installed, which > is not the case on most web-servers !!! > (could this be your problem?)
No, X11 is installed and running (it's my desktop).
> just a thought,
thanks so much to everybody for their input. steve -- steve jenson <[stevej--sieve--net]> http://sieve.net/ PGP fingerprint: 79D0 4836 11E4 A43A 0179 FC97 3AE2 008E 1E57 6138

 [8/8] from: agem:crosswinds at: 27-Apr-2001 4:24


>>>>>>>>>>>>>>>>>> Ursprüngliche Nachricht <<<<<<<<<<<<<<<<<<
Am 25.04.01, 08:40:09, schrieb steve jenson <[stevej--sieve--net]> zum Thema [REBOL] Troubles in CGI land:
> Hi fellow REBOL nerds, > I downloaded the newest REBOL/View yesterday and have been playing
around
> with it again but I'm having a problem with a simple CGI script. > Inside of my cgi-bin, I have a script called test.r, which is the
<<quoted lines omitted: 7>>
> --------------------------------------- > The permissions are 755 (rwxr-xr-x), other cgi's run out of this
directory
> just fine, and I'm able to use rebol from the command-line with no
problem,
> with the rebol executable referenced above. > Unfortunately, when I call this CGI from a webbrowser, it starts a
download
> (I assume because of a lack of a Content-Type header) of the following > text:
<<quoted lines omitted: 8>>
> environment, it works fine. I'm baffled. There's nothing in my apache > error logs, and no obvious sign of problems. I'm too new to the
langauge
> to really diagnose it farther so I'd like to call on you kids for > some help.
This is unix-rebol/view needs a running x-server which it can connect to. It tries to setup some stuff vor /view and cannot connect. (you see 'size-text fails, which needs font-information and that) Even if you run on x-windows and start a script on apache, it may fail, since apache may run it as user 'wwwrun or that, which cannot connect to the X startet for yourself. On a server you should choose rebol/core, that works X-less. Volker

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