Server not working on Linux Ubuntu 20-04 64bits on Raspberry4 due to ARM

Are you using LiveCode to create server scripts or CGIs?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
sphere
Posts: 1145
Joined: Sat Sep 27, 2014 10:32 am
Location: Earth, Except when i Jump

Server not working on Linux Ubuntu 20-04 64bits on Raspberry4 due to ARM

Post by sphere » Mon Jun 07, 2021 8:37 pm

Hi,

after struggling for days again with the conf files, drove me back to the lesson again on how to install on Apache.
https://lessons.livecode.com/m/4070/l/3 ... ith-apache
Do NOT follow the lesson if you run Ubuntu Linux server.
The only correct set-up is in the comments below by Russell Martin.
And easy to forget if there are no (correct) setup notes anymore with the download.
To say is that it could work via the original setup following the lesson, but to save your precious time, don't.(had it running also that way before on a VPS, but playing with a Raspberry is more fun)

So now I'm convinced that the setup is working correct because now I get this error:

Code: Select all

Exec format error: exec of '/usr/lib/cgi-bin/livecode-community-server' failed: /usr/lib/cgi-bin/livecode-community-server
Which says actually that it is the wrong architecture. The Linux 64bit download is based x86 and not ARM.
It's an error I did not have before, so at least it's trying to run the hello.lc script.

I was planning and hoping to use LC partly for this, but I guess it's a no go. Wish I had been awake earlier and figured it could not work...

There are other solutions of course, but this would have saved me a lot of time for the web part.

Will the server ever be ported to ARM?

Thanks!

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9801
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Server not working on Linux Ubuntu 20-04 64bits on Raspberry4 due to ARM

Post by FourthWorld » Mon Jun 07, 2021 8:41 pm

ARM is increasingly popular in data centers, so an LC Server build for ARM seems an inevitability, sooner or later.

In the meantime, you can run a standalone as a CGI, which will give you everything you enjoy about the LC language except for Server's PHP-style implicit merge (which can be worked around easily enough in most cases using an explicit call to the merge function).
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

sphere
Posts: 1145
Joined: Sat Sep 27, 2014 10:32 am
Location: Earth, Except when i Jump

Re: Server not working on Linux Ubuntu 20-04 64bits on Raspberry4 due to ARM

Post by sphere » Mon Jun 07, 2021 9:04 pm

You mean the HTML5 standalone actually? That's a no-go for me. Impractical.

So I really hope an ARM server version is coming soon, fingers crossed.

So for now I will stick with PHP and Javascript then.

Thanks!

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9801
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Server not working on Linux Ubuntu 20-04 64bits on Raspberry4 due to ARM

Post by FourthWorld » Mon Jun 07, 2021 9:27 pm

sphere wrote:
Mon Jun 07, 2021 9:04 pm
You mean the HTML5 standalone actually?
LC's HTML export is for client-side browsers only. We're talking about the opposite end of that connection, on the server.

When I wrote "standalone" I meant exactly that, a standalone executable created as any other, using the Linux ARM engine rather than Linux x86.

Nearly any app that uses stdin/stdout can be used as a CGI. Any desktop LC standalone can be launched without GUI dependencies by adding a -ui flag, making them sell suited for faceless applications that use only stdin and stdout as the interface, such as CGIs running under Apache.

The majority of my server deployments have used standalones as CGI engines for decades. I've only recently begun use LC Server for anything beyond testing to help others, and only because it offers a few minor advantages for server work over standalones.

But since an RPi is already I/O-inhibited, any minor performance differences with parsing POST data and other such tasks in script (as one does in Perl, Python, or pretty much anything that isn't PHP or LC Server) is far from significant enough to worry about.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

sphere
Posts: 1145
Joined: Sat Sep 27, 2014 10:32 am
Location: Earth, Except when i Jump

Re: Server not working on Linux Ubuntu 20-04 64bits on Raspberry4 due to ARM

Post by sphere » Tue Jun 08, 2021 7:28 pm

Don't know if I follow correctly.
You mean that an ui less executable will run as CGI?
So actually created as standalone on a Raspberry using 7.04 ? or on an x86 server?

Can you explain a bit more on how you do that?
Thanks.

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9801
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Server not working on Linux Ubuntu 20-04 64bits on Raspberry4 due to ARM

Post by FourthWorld » Tue Jun 08, 2021 7:57 pm

sphere wrote:
Tue Jun 08, 2021 7:28 pm
You mean that an ui less executable will run as CGI?
A CGI is any program that Apache is set up to launch; it reads input from Apache in stdin, outputs its results back to Apache on stdout, and then Apache returns that over the wire to the client.

Running the app with the -ui flag bypasses graphics init, which makes it launch much faster and is more appropriate for server environments, which generally have no GUI.
So actually created as standalone on a Raspberry using 7.04 ? or on an x86 server?
If your server is x86, build for x86. If your server is a Raspberry Pi, build for ARM.

I find the LC IDE finicky on Raspberry Pi, so I prefer to work with it as we do mobile, building on my main machine and copying the executable to my RPi.

It gets cumbersome pretty quickly to build a standalone for every script change, so the standalone I use has a startup handler that looks for a library stack of a given name, and if found starts using it. The meat of the program is in the library stack.

LC Server automates parsing incoming POST data, so any CGI made from a standalone will need to handle that. There are scripts here in older posts in the forum (from back when everyone did their server work with standalones, since LC Server hadn't been invented), and if you need that and don't turn one I can dig up mine.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

sphere
Posts: 1145
Joined: Sat Sep 27, 2014 10:32 am
Location: Earth, Except when i Jump

Re: Server not working on Linux Ubuntu 20-04 64bits on Raspberry4 due to ARM

Post by sphere » Tue Jun 08, 2021 8:12 pm

Thanks for explaining.
I will think this over and see if I can use this way of working.

PaulDaMacMan
Posts: 616
Joined: Wed Apr 24, 2013 4:53 pm
Contact:

Re: Server not working on Linux Ubuntu 20-04 64bits on Raspberry4 due to ARM

Post by PaulDaMacMan » Wed Jun 09, 2021 2:01 am

Following

Suddenly very interested in Rasberry Pi since a co-worker gave me his unused Pi 3B+ to play around with... thinking of ways to use it as a LiveCode scripted (headless) appliance.
My GitHub Repos: https://github.com/PaulMcClernan/
Related YouTube Videos: PlayList

Post Reply

Return to “CGIs and the Server”