Setting-up CGI on Hostgator hosting

Are you using LiveCode to create server scripts or CGIs?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
arombauts
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 50
Joined: Tue Jul 07, 2009 6:56 am

Setting-up CGI on Hostgator hosting

Post by arombauts » Wed Dec 02, 2009 10:45 am

I'm completely new to CGIs...
As I have problems using reWeb and revBrowser in a Linux environement (I need to develop app running exactly the same way on OS, Win and Linux), I would like to try CGIs.
My sites are hosted by Hostgator.
I have cgi-bin dir at the root level of each domain I use.
I'm developing on OSX with Enterprise 4.
I read:
Installing the Revolution engine
To create and run a CGI, you will need at least two things: the Revolution engine and a script. The remainder of this tutorial addresses the scripts. But to begin with, make a copy of your Revolution application and place it in the cgi folder on your server. If you are running Apache, this is most likely a folder called "cgi" or "cgi-bin" located in your main web directory. You do not need to install any additional stacks — only the Revolution executable is required.
What Revomution engine executable is required on Hostgator?
Hostgator returns the following:
Apache: 2.2.11
CentOS:.
cPanel: 11.24.5-RELEASE
Curl: 7.12.1
MySQL: 5.1.30
phpMyAdmin: 2.11.9.5
Python: 2.4.3
Perl: 5.8.8
PHP: 5.2.9
ionCube Loader: 3.3.1
Zend Optimizer: 3.3.3
Ruby: 1.8.7
Rails: 2.3.4
OpenSSL: 0.9.8e-fips-rhel5
Do I have to upload my OS Enterprise to the cgi dir? in each hosted domain?

Thanks in advance
André Rombauts, Liège (Belgium).
Retired teacher ( French language, History, English language and Computer science).
LC 9.6.6 (Business / HTML5 edition), testing LC 10 DP1.
Mac OS 11.6.2 Big Sur, MacBook Pro 16" 2019 (and other computers...).

SparkOut
Posts: 2944
Joined: Sun Sep 23, 2007 4:58 pm

Re: Setting-up CGI on Hostgator hosting

Post by SparkOut » Wed Dec 02, 2009 11:17 am

There is a question mark about the RunRev 4.0 and command line operation (essentially what is happening in CGI conditions).
When I say "question mark" I mean that at present, RunRev 4.0 can not be used to act as a CGI engine, and it does not come with a standalone engine that can be used.
An older (v. 3.5 engine) is the preferred standalone engine required under these circumstances, but I am unaware where it might be possible to download. The downloads page does offer older engines (for compatability reasons) but although they should work, I believe that there are some improvements in the more recent engine which makes it desireable to get hold of the most up to date version that works.
If you have Studio 3.5 then on Windows in the program folder where you have RunRev installed, there should be a subfolder called Runtime, which contains versions for you to select according to the host - ie Linux, x86-32, and you need to find the file called "standalone". For Mac I'm not sure - it's in the guide below, but find something like "Standalone.app" and view the bundle contents to locate the standalone engine.
Copy that to your host, rename it to match the declaration in your scripts (ie "revolution"), set the right permissions and follow Jacqueline Landman Gay's guide http://www.hyperactivesw.com/cgitutoria ... altoc.html
If you don't have version 3.5 then I think contacting support would be best, as I'm not sure what their policy is/will be on the CGI engine distribution.
HTH
SparkOut

arombauts
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 50
Joined: Tue Jul 07, 2009 6:56 am

Re: Setting-up CGI on Hostgator hosting

Post by arombauts » Wed Dec 02, 2009 11:28 am

Thanks for your reply!
SparkOut wrote:RunRev 4.0 can not be used to act as a CGI engine, and it does not come with a standalone engine that can be used.
.../..
If you have Studio 3.5 then on Windows in the program folder where you have RunRev installed, there should be a subfolder called Runtime, which contains versions for you to select according to the
I checked in my Enterprise 4.0.0-gm-1 OS X version and there is a Runtime dir with a x386-32 Linux dir containing a 'standalone' file. I guess it should work. Where did you read 4.0 cannot act as a CGI engine?

André
André Rombauts, Liège (Belgium).
Retired teacher ( French language, History, English language and Computer science).
LC 9.6.6 (Business / HTML5 edition), testing LC 10 DP1.
Mac OS 11.6.2 Big Sur, MacBook Pro 16" 2019 (and other computers...).

SparkOut
Posts: 2944
Joined: Sun Sep 23, 2007 4:58 pm

Re: Setting-up CGI on Hostgator hosting

Post by SparkOut » Wed Dec 02, 2009 11:41 am

In the change log of v 4.0-gm-1, under the "Standalone Building" heading, second paragraph
In order to achieve this, it has been necessary to implement the core operation of standalone building in the (ide) engine. This means that the standalone engine provided in the distribution is no longer generally useful as anything other than the shell which is used to form the standalone. In particular, it cannot be used to build standalones using the method previously used nor can it be used as a generic command line engine.
Bold and italics added by me. There has been some commentary about this on the improve- list (for Enterprise developers) but no actual roadmap from RunRev about the command line engine options for the future. (CGI being a command line engine situation.)

arombauts
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 50
Joined: Tue Jul 07, 2009 6:56 am

Re: Setting-up CGI on Hostgator hosting

Post by arombauts » Wed Dec 02, 2009 11:48 am

SparkOut wrote:In the change log of v 4.0-gm-1, under the "Standalone Building" heading, second paragraph
...as anything other than the shell which is used to form the standalone. In particular, it cannot be used to build standalones using the method previously used nor can it be used as a generic command line engine.
... but no actual roadmap from RunRev about the command line engine options for the future. (CGI being a command line engine situation.)
... :-(

Thanks again for your reply...
I have an old 3.5. Will try...
André Rombauts, Liège (Belgium).
Retired teacher ( French language, History, English language and Computer science).
LC 9.6.6 (Business / HTML5 edition), testing LC 10 DP1.
Mac OS 11.6.2 Big Sur, MacBook Pro 16" 2019 (and other computers...).

SparkOut
Posts: 2944
Joined: Sun Sep 23, 2007 4:58 pm

Re: Setting-up CGI on Hostgator hosting

Post by SparkOut » Wed Dec 02, 2009 12:04 pm

I can't think of anything that would be significantly affected by the difference between v. 3.5 and 4.0 when considering operation of a CGI. Most of the enhancements involve things like revlets and/or GUI based features, so if you have 3.5 to try the standalone engine then you should be OK. My concern is that the older downloads offered are not as memory-efficient and/or robust as 3.5, and that for someone just picking up with RunRev there is no source of a command line engine for them to try. CGI is a relatively antiquated concept, but it still has a role to fulfil, despite the direction of moving towards the onRev type server engine (which is projected "sometime" in the future) and revlets (which are here now).

RRobert
Posts: 151
Joined: Sat Feb 28, 2009 8:20 pm

Re: Setting-up CGI on Hostgator hosting

Post by RRobert » Thu Dec 03, 2009 2:13 am

If you like to use Revolution 4, why dont you build your own CGI?
(very basic) mycgi.rev --> linux standalone

local tFile
local tFileContent

on preopenstack
send "quit" to me in 10 seconds
put "file:" & $1 into tFile
put URL tFile into tFileContent
do tFileContent
quit
end preopenstack

--

cgitest.cgi
#!mycgi -ui

put "Content-Type: text/html" & cr & cr
put "Hello World!"
Robert

Post Reply