I finally did it - after untold frustrating attempts I finally got my first:
from an LC server. My problem was that I'm on a shared server (allinkl.com), and have no access to the apache configuration & only limited access to the file system, so most of the advises given regarding the installation don't match.Hello World! 12:01 PM
For the benefit of other members of our community I decided to document what I've done, step by step. I'm using "Filezilla" as my FTP program, and "Putty" for SSL (You don't really need SSL, but it makes things easier). I assume that both are installed & configured to access our server.
- At first, we determine the type of server we're running on, using Putty:
This confirms my suspicion that we're on a 64bit Linux. So we need a Linux 64-bit LC server. (Guess any provider worth its salt will run x86-64 by now ... And "x$" is the long, cryptic linux start of the command line, shortened.)
Code: Select all
x$ uname -srm Linux 4.4.0-177-generic x86_64
. - Second, we grab our server from here.
Careful, the "last stable" 9.5.1-64 threw "Segmentation faults" reliably, whereas the 8.1-64 runs flawlessly.
. - Now we use Filezilla to create a directory "cgi-bin" in the base directory of the desired domain: "/" shows all of our webspace, "/domain.com" is where our domain specific data lives.
So what we create is "/domain.com/cgi-bin", and we change the access to "755".
. - Assuming we have SSH, we copy the downloaded, zipped LC server file via FileZilla into our "cgi-bin" & run "unzip [servername.zip]" via Putty. This assures we get unaltered files.
If we don't have SSH, we unzip the server locally & make sure to transfer it in "binary mode". And hope it works ...
. - We need to "chmod" (change acces privileges) our server application now to "755" via Filezilla or SSH, and we may rename it - I use "lcserver" for easy access. What we have now should look like this (I've renamed some things ...):
.
You'll see a file "test.lc" in cgi-bin that is explained below, and 2 zipped server installations - those we can delete. - To test our server we need a simple command file, a very basic one is:
Put this one into your cgi-bin as "test.lc", and make sure you have unix line endings (LF only)!
Code: Select all
<?lc put "Hello World!" && the time ?>
. - If we have SSH, we can test it now:
wOOt! :)
Code: Select all
x$ cd domain.com/cgi-bin x/domain.com/cgi-bin$ ./lcserver ./test.lc Hello World! 1:34 PM
. - If not, or if we want to call it as CGI (means using it via POST/ our web browser), we need some lines in the .htaccess file of our domain ("/domain.com/.htaccess"). If not (it exists), create it. If it exists, add these lines:
(Big "THANK YOU!" to Thierry!)
Code: Select all
Options +ExecCGI AddHandler livecode-script .lc Action livecode-script /cgi-bin/lcserver
If there are already lines like this, you may want to ask someone that's better in web server things than me ...
Again, make sure you have unix line endings (LF only)!
. - Last test: We go to our domain in the browser: ("https://domain.com/cgi-bin/test.lc") and get:
Bingo! Done.Hello World! 1:51 PM
- Making sure the installation is safe & will not get captured easily.
- Finding out which LC server version to use actually - which one is fastest & least buggy?
- Writing tons of .lc scripts to actually work with it :)
Have fun!