Could some expert help to set up Rev CGI (Linux Host)?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Could some expert help to set up Rev CGI (Linux Host)?
Hi,
I tried to set up a Rev CGI Environment in my hosting account about 1.5 years ago, but failed. Now I changed the hosting (linux hosting) and would like to try again. I read and followed through the steps provided in many documents. However I still cannot set up the CGI enviroment after trying many times.
Could some experts here set up for me? I can provide my hosting login information.
P.S.
1. I already uploaded the linux Revolution-2.5.1 engine to the cgi-bin directory.
2. I also CHMOD the cgi-bin directory to 755
3. I also uploaded a test file (test.cgi) to cgi-bin directory and CHMOD to 755
Thanks and best regards
I tried to set up a Rev CGI Environment in my hosting account about 1.5 years ago, but failed. Now I changed the hosting (linux hosting) and would like to try again. I read and followed through the steps provided in many documents. However I still cannot set up the CGI enviroment after trying many times.
Could some experts here set up for me? I can provide my hosting login information.
P.S.
1. I already uploaded the linux Revolution-2.5.1 engine to the cgi-bin directory.
2. I also CHMOD the cgi-bin directory to 755
3. I also uploaded a test file (test.cgi) to cgi-bin directory and CHMOD to 755
Thanks and best regards
Alex
Nice to meet all of you.
Nice to meet all of you.
-
- VIP Livecode Opensource Backer
- Posts: 1236
- Joined: Sat Apr 08, 2006 1:10 pm
- Location: Zurich
- Contact:
When you call the cgi, what error do you get in your error log on the server?
What's the code you try (if it's long, then try something shorter)?
did you chmod the engine itself?
what's the line endings in your test cgi?
What's the code you try (if it's long, then try something shorter)?
did you chmod the engine itself?
what's the line endings in your test cgi?
Various teststacks and stuff:
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
Hi BvG,
Long time no see:)
## When you call the cgi, what error do you get in your error log on the server?
The most common cgi error for beginner - Internal Server Error
## What's the code you try (if it's long, then try something shorter)?
To avoid any unnecessary error, I only use:
#!revolution
## did you chmod the engine itself?
I only CHMOD the cgi-bin directory and the cgi script (test.cgi) to 755. Which files do I also need to CHMOD?
## what's the line endings in your test cgi?
I used Windows to wrtite the cgi script. I used ASII mode to FTP transfer, so the text should be in unix mode. Actually I also read the post of setting up cgi about this problem. The post only said he removed the line ending and the problem solved. I have no any idea how to remove the line ending in windows note pad or other text editor.
Thanks and best regards
Long time no see:)
## When you call the cgi, what error do you get in your error log on the server?
The most common cgi error for beginner - Internal Server Error
## What's the code you try (if it's long, then try something shorter)?
To avoid any unnecessary error, I only use:
#!revolution
## did you chmod the engine itself?
I only CHMOD the cgi-bin directory and the cgi script (test.cgi) to 755. Which files do I also need to CHMOD?
## what's the line endings in your test cgi?
I used Windows to wrtite the cgi script. I used ASII mode to FTP transfer, so the text should be in unix mode. Actually I also read the post of setting up cgi about this problem. The post only said he removed the line ending and the problem solved. I have no any idea how to remove the line ending in windows note pad or other text editor.
Thanks and best regards
Alex
Nice to meet all of you.
Nice to meet all of you.
-
- VIP Livecode Opensource Backer
- Posts: 1236
- Joined: Sat Apr 08, 2006 1:10 pm
- Location: Zurich
- Contact:
I wasn't asking what your browser shows you, I was asking about the error log of your server. If you use some webhosting service, their web interface most likely has an entry to look at error logs. If you have a dedicated server it is most likely found in /var/log/apache or /var/log/httpd.alex298 wrote:## When you call the cgi, what error do you get in your error log on the server?
The most common cgi error for beginner - Internal Server Error
This would always fail. I suggest you try this as a minimal cgi (where the rev engine is named "revolution":alex298 wrote:## What's the code you try (if it's long, then try something shorter)?
To avoid any unnecessary error, I only use:
#!revolution
Code: Select all
#!revolution
on startup
put "Hello, I'm a cgi!" into buffer
put "Content-Type: text/plain" & cr
put "Content-Length:" && the length of buffer & cr & cr
put buffer
end startup
You need to chmod the cgi file, and the engine, the directory only if you want to use stacks in the cgi-bin folder directly.alex298 wrote:## did you chmod the engine itself?
I only CHMOD the cgi-bin directory and the cgi script (test.cgi) to 755. Which files do I also need to CHMOD?
The line endings are what delimits the lines in your cgi. If you remove line endings, you would have everything on one line, which would not work at all, so I'd say no one ever suggested that.alex298 wrote:## what's the line endings in your test cgi?
I used Windows to wrtite the cgi script. I used ASII mode to FTP transfer, so the text should be in unix mode. Actually I also read the post of setting up cgi about this problem. The post only said he removed the line ending and the problem solved. I have no any idea how to remove the line ending in windows note pad or other text editor.
Line endings on windows are "cr"&"lf", on unix it's "lf", and on mac os it's "cr". Note that within rev, return, cr and lf are synonyms, which can be confusing. If you want your cgi to run on linux, you need to make sure that the last char of all lines in your file is a linefeed. to do this you could use rev. The following code will automatically change all line endings in a file from the system format (on windows that's carriage return & linefeed), to the unix form (only linefeeds):
Code: Select all
on mouseUp
answer file "a cgi text file"
if it = "" or the result <> "" then
exit mouseUp
else
put it into thePath
end if
put url ("file:" & thePath) into theData
put theData into url ("binfile:" & thePath)
end mouseUp
Various teststacks and stuff:
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
Hi BvG,
I used your script and change all line endings in the test file. However the problem still the same.
The error log is also a common error of CGI:
Premature end of script headers: /home/plygcom/public_html/cgi-bin/test2.cgi
It seems to fail to set a content type before printing the output code. I know how to solve this problem in VB, Perl and PHP. However I am a newbie in RR's CGI.
P.S.
I will only use stacks in the cgi-bin folder directly.
Thanks and best regards
I used your script and change all line endings in the test file. However the problem still the same.
The error log is also a common error of CGI:
Premature end of script headers: /home/plygcom/public_html/cgi-bin/test2.cgi
It seems to fail to set a content type before printing the output code. I know how to solve this problem in VB, Perl and PHP. However I am a newbie in RR's CGI.
P.S.
I will only use stacks in the cgi-bin folder directly.
Thanks and best regards
Alex
Nice to meet all of you.
Nice to meet all of you.
Hi,
I just learnt from other documents that the following libraries are also required in Apache server:
libXext.so.6
libX11.so.6
libm.so.6
libc.so.6
ld-linux.so.2
I also installed the above libraries in my dedicated server. However the problem is still the same:
Premature end of script headers: /home/plygcom/public_html/cgi-bin/test.cgi
Best regards
I just learnt from other documents that the following libraries are also required in Apache server:
libXext.so.6
libX11.so.6
libm.so.6
libc.so.6
ld-linux.so.2
I also installed the above libraries in my dedicated server. However the problem is still the same:
Premature end of script headers: /home/plygcom/public_html/cgi-bin/test.cgi
Best regards
Alex
Nice to meet all of you.
Nice to meet all of you.
-
- VIP Livecode Opensource Backer
- Posts: 1236
- Joined: Sat Apr 08, 2006 1:10 pm
- Location: Zurich
- Contact:
Premature end of script headers just means that the cgi is not recognised as cgi at all. Make sure to set up the cgi stuff like this:
1. Put the revolution engine into the cgi-bin directory, name it "revolution"
2. Put the script (as suggested above) into the same directory
3. Change all the line endings to lf
4. Chmod the script as well as the engine to 755
Report any errors in the log file of your http server.
1. Put the revolution engine into the cgi-bin directory, name it "revolution"
2. Put the script (as suggested above) into the same directory
3. Change all the line endings to lf
4. Chmod the script as well as the engine to 755
Report any errors in the log file of your http server.
Various teststacks and stuff:
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
Hi all,
Thanks for your kind assistance.
##Put the revolution engine into the cgi-bin directory, name it "revolution"
Actually I tried before. I did it again.
## Put the script (as suggested above) into the same directory
I always do it that way.
## Change all the line endings to lf
I used your RR script to do that.
## Chmod the script as well as the engine to 755
I also CHMOD the revolution.x86 to 755. For scripts I always CHMOD to 755 same as Perl scripts.
It is still not working. The error is still:
Premature end of script headers:
Any other possible reasons?
Thanks and best regards
Thanks for your kind assistance.
##Put the revolution engine into the cgi-bin directory, name it "revolution"
Actually I tried before. I did it again.
## Put the script (as suggested above) into the same directory
I always do it that way.
## Change all the line endings to lf
I used your RR script to do that.
## Chmod the script as well as the engine to 755
I also CHMOD the revolution.x86 to 755. For scripts I always CHMOD to 755 same as Perl scripts.
It is still not working. The error is still:
Premature end of script headers:
Any other possible reasons?
Thanks and best regards
Alex
Nice to meet all of you.
Nice to meet all of you.
-
- VIP Livecode Opensource Backer
- Posts: 1236
- Joined: Sat Apr 08, 2006 1:10 pm
- Location: Zurich
- Contact:
This can't work. Your script (respective mine) requests an engine named "revolution". Thats what the first line in the script means. If your engine is named "revolution.x86", then obviously the script can't find the engine, and won't run at all. Make sure the engine and the reference in the first line are the same.alex298 wrote:## Chmod the script as well as the engine to 755
I also CHMOD the revolution.x86 to 755. For scripts I always CHMOD to 755 same as Perl scripts.
your cgi-bin:
revolution 755
test.cgi 755
first line in test.cgi:
#!revolution
Various teststacks and stuff:
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
Dear BvG,
## Make sure the engine and the reference in the first line are the same.
Oh.... yes. How come I overlook this point?
You are really really very helpful! Are you still living in Switzerland? I will buy you a drink when I come to Switzerland Then on to way to Germany to have beer and sausages with Klaus and Malte
Best regards
## Make sure the engine and the reference in the first line are the same.
Oh.... yes. How come I overlook this point?
You are really really very helpful! Are you still living in Switzerland? I will buy you a drink when I come to Switzerland Then on to way to Germany to have beer and sausages with Klaus and Malte
Best regards
Alex
Nice to meet all of you.
Nice to meet all of you.