Rebol Talk Forum  |  Getting Started  |  Newbie Help  |  Topic: My rebol script works on SSH but not
Pages: [1] Print
Author Topic: My rebol script works on SSH but not  (Read 535 times)
rebolnotes
Newbie
*
Offline Offline

Posts: 23


View Profile
My rebol script works on SSH but not
« on: June 17, 2007, 01:53:08 PM »

I uploaded rebol to /usr/bin directory of my webhosting service (redhat linux). Change permissions to 755 and test by typing do %bin/test.r

It's ok.

Then I uploaded in cgi-bin directory of my server which is /var/www/cgi-bin/ this script (transfer type is ascii, end character is unix, and chmod 755)

#! /user/bin/rebol -c
REBOL [Title: "Server Time"]
print "content-type: text/html^/"
print [<HTML><BODY>]
print ["Date/time is:" now]
print [</BODY></HTML>]

It doesn't work, the error log shows:
Premature end of script headers: reboltest.cgi

My perl script on the other hand did work
#! /usr/bin/perl
print "Content-type: text/html\n\n";
print "<html><body><h1>Hello World!";
print "</h1></body></html>\n";

as well as my python script:
#!/usr/bin/python

# Required header that tells the browser how to render the text.
print "Content-Type: text/plain\n\n"

# Print a simple message to the display window.
print "Hello, World!\n"


« Last Edit: June 17, 2007, 02:12:36 PM by rebolnotes » Logged
Gabriele
Full Member
***
Offline Offline

Posts: 182


View Profile WWW
Re: My rebol script works on SSH but not
« Reply #1 on: June 18, 2007, 04:13:41 AM »

What do you get if you run the script directly? (ie. type /var/www/cgi-bin/script.cgi on the command line)
Logged
rebolnotes
Newbie
*
Offline Offline

Posts: 23


View Profile
Re: My rebol script works on SSH but not
« Reply #2 on: June 18, 2007, 05:04:18 PM »

What do you get if you run the script directly? (ie. type /var/www/cgi-bin/script.cgi on the command line)

/var/www/cgi-bin/perltest.cgi works
whereas
/var/www/cgi-bin/reboltest.cgi gives this error message:

bad interpreter: no such file or directory

( yeah I'm not really a Unix Guru Smiley )
Logged
PeterWood
Newbie
*
Offline Offline

Posts: 34


View Profile
Re: My rebol script works on SSH but not
« Reply #3 on: June 18, 2007, 07:54:29 PM »

Is the directory correct in your shebang line?

#! /user/bin/rebol -c

You mentioned that you saved rebol in /usr/bin/rebol.
Logged
Gabriele
Full Member
***
Offline Offline

Posts: 182


View Profile WWW
Re: My rebol script works on SSH but not
« Reply #4 on: June 19, 2007, 12:17:17 AM »

In your example above you used #!/user/bin/rebol - isn't that #!/usr/bin/rebol ?
Logged
rebolnotes
Newbie
*
Offline Offline

Posts: 23


View Profile
Re: My rebol script works on SSH but not
« Reply #5 on: June 19, 2007, 11:52:15 PM »

In your example above you used #!/user/bin/rebol - isn't that #!/usr/bin/rebol ?

Oops  sorry I didn't sleep enough that day Cheesy
Logged
Pages: [1] Print 
Rebol Talk Forum  |  Getting Started  |  Newbie Help  |  Topic: My rebol script works on SSH but not
Jump to:  

  
Quick Search...

Advanced search
  
Welcome, Guest. Please login or register.
Did you miss your activation email?
November 21, 2008, 09:35:14 PM
Username: Password: Session Length:
  

News: 01-09-08

Alpha version of REBOL 3 has been released!


  
2295 Posts in 593 Topics by 3763 Members
Latest Member: svolika

  Rebol Talk Forum | Powered by SMF 1.0.9.
© 2001-2005, Lewis Media. All Rights Reserved.

RT design by Defiant Pc