LC Server on Inmotion Hosting

Are you using LiveCode to create server scripts or CGIs?

Moderators: heatherlaine, Klaus, FourthWorld, robinmiller, kevinmiller

Post Reply
bhall2001
Posts: 99
Joined: Thu Oct 30, 2014 3:54 pm

LC Server on Inmotion Hosting

Post by bhall2001 » Tue May 19, 2015 12:07 pm

For an exercise, I thought I'd try to get LC Community Server going on my Inmotion hosting vps. Of course I'm having a bit of a problem and am wondering if anyone else has had any luck getting this to work with inmotionhosting.com.

I followed the directions installing the server on Apache and will be using .htaccess to get LC server going. To test the install I am trying to test as a command line. I have the simple "hello.lc" file (in same directory as livecode-community-server) from the installation lesson. But when I try to reference the file I get a "segmentation fault". I assume this is related to 32 bit code on 64 bit system????

When I try to install the glib 32 bit libraries on the CentOS based virtual private server, I get "Package libgcc-4.4.7-11.el6.i686 already installed and latest version Nothing to do" returned by Yum (note: same message for all libraries).

Any thoughts? I haven't even tried to get the cgi working yet as I can't get the command line to parse the hello.lc file.

Thanks in advance,
Bob

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

Re: LC Server on Inmotion Hosting

Post by FourthWorld » Tue May 19, 2015 2:37 pm

Have you tried the 64-bit build of LiveCode Server?
Richard Gaskin
Community volunteer LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

bhall2001
Posts: 99
Joined: Thu Oct 30, 2014 3:54 pm

Re: LC Server on Inmotion Hosting

Post by bhall2001 » Wed May 20, 2015 2:44 am

I was pretty sure that I had installed the 64 bit version but I went ahead and re-installed to be sure. I got the same result.

Also, I'd like to confirm I executing the command line correctly. I'm changing into the cgi-bin directory (location I installed lc server) and typing "./livecode-community-server test.lc"

This results in the segmentation fault.

Thanks again,
Bob

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

Re: LC Server on Inmotion Hosting

Post by FourthWorld » Wed May 20, 2015 5:47 am

What's in test.lc?


And if it's a VPS why use .htaccess instead of editing the Apache config directly?
Richard Gaskin
Community volunteer LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

bhall2001
Posts: 99
Joined: Thu Oct 30, 2014 3:54 pm

Re: LC Server on Inmotion Hosting

Post by bhall2001 » Wed May 20, 2015 11:54 am

test.lc contains....

Code: Select all

<?lc
     put "Hello World!" && the date && the time
?>
Here's my logic:

Step 1 - server runs with command line
Step 2 - server runs with .htaccess
Step 3 - server runs with apache config

To me on the VPS, each step adds a level of complexity and uncertainty. From what I can see, I do not have full access to apache config files so I'm am attempting to go in bit size morsels with hopefully a Step 3 successful outcome eventually.

Thanks,
Bob

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

Re: LC Server on Inmotion Hosting

Post by FourthWorld » Wed May 20, 2015 3:32 pm

The Apache docs recommend using .htaccess when you don't have access to the main server configuration file:
http://httpd.apache.org/docs/2.2/howto/ ... .html#when

I sometimes use .htaccess on dedicated servers when the system is a test bed for something I'll later deploy to a shared host, but most of the time changing the Apache config will be simpler and more efficient.

A VPS can be a great way to bypass some of the resource-sharing constraints of shared hosting, but depending on the service provider it will usually require more responsibility to set up the system and harden it against attacks. Some VPSes come pre-configured, but many are just the stock OS installed with a basic LAMP setup and little else.

For example, depending on the distro you're running, mod_rewrite and mod_action may not be enabled by default, and will have to be enabled manually. On Ubuntu and some others this is done with the a2enmod command (may be true for CentOS as well, but I haven't used that distro myself yet), as discussed here:
https://www.digitalocean.com/community/ ... od_rewrite

If bash isn't returning any error info specific enough to act on, you might try accessing the page through the Web and then checking /var/log/apache2/error.log for details.

You may also want to check for missing library dependencies with ldd:
ldd ./livecode-community-server test.lc
Richard Gaskin
Community volunteer LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

bhall2001
Posts: 99
Joined: Thu Oct 30, 2014 3:54 pm

Re: LC Server on Inmotion Hosting

Post by bhall2001 » Fri May 22, 2015 12:06 pm

Here are the results of ldd on the executable in the cgi-bin directory...

Code: Select all

ldd ./livecode-community-server test.lc
./livecode-community-server:
	not a dynamic executable
test.lc:
	not a dynamic executable
and I saw a post online where strace might be helpful too

Code: Select all

strace ./livecode-community-server
execve("./livecode-community-server", ["./livecode-community-server"], [/* 33 vars */]) = -1 EFAULT (Bad address)
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV +++
Segmentation fault
When I try to access the hello.lc I get a 404 error from Apache but I really hadn't looked much into my .htaccess file at all as I wasn't able to get the command line to work and didn't go any further down the path with trying to get LC server web page. I'm going through the apache log now to see if there is a clue there though.

hello.lc contents:

Code: Select all

<html>

<head>
    <title>My LiveCode Server Test Page</title>
</head>

<body>
     <h1>My LiveCode Server Test Page</h1>
<?lc
     put "<p>Hello World! from LiveCode Server</p>"
     put "<p>The date is" && the date & "</p>"
?>
</body>

</html>
Thanks again for any thoughts on which way to proceed.
Bob

bhall2001
Posts: 99
Joined: Thu Oct 30, 2014 3:54 pm

Re: LC Server on Inmotion Hosting

Post by bhall2001 » Fri May 22, 2015 12:24 pm

And to confirm that I do have the 64 bit version installed I ran the following

Code: Select all

file -s ./livecode-community-server
and got as a result

Code: Select all

./livecode-community-server: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), stripped
Should I attempt to compile the community server code on my VPS?

Bob

bhall2001
Posts: 99
Joined: Thu Oct 30, 2014 3:54 pm

Re: LC Server on Inmotion Hosting

Post by bhall2001 » Fri May 22, 2015 12:57 pm

While I'm not going to mark this as solved just yet, I do have an update.

Since I have a VPS, I setup a new "reseller" in WHM with a domain that I own but have parked, basically I created a brand spanking new shared host in my VPS account. I installed LC Server (community) and created the basic hello.lc file. Setup .htaccess (it was just easier) and loaded hello.lc from my browser.

Viola! It worked! There's obviously a configuration issue on my main site that I've got to figure out but in my book, LC Server works no problem on an inmostionhosting server (atleast with .htaccess). COOL!

When I figure out what I've got messed up on the server I'll pass it on just incase someone else runs into the same issue.

Bob

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

Re: LC Server on Inmotion Hosting

Post by FourthWorld » Fri May 22, 2015 3:37 pm

Is the shared host running within the same VM instance?

Also, what are the permission on your LC executable in the VM?
Richard Gaskin
Community volunteer LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

bhall2001
Posts: 99
Joined: Thu Oct 30, 2014 3:54 pm

Re: LC Server on Inmotion Hosting

Post by bhall2001 » Fri May 29, 2015 12:14 pm

The shard host that LC server works on is not on the same VM instance. I created a new VM as a "reseller" in WHM within my VPS.

I have the permissions set to 755 for all directories and files.

Still have not been able to figure out why it doesn't work off the main VPS. It's almost like it's being blocked by the system for some reason in the VPS but not in VM's created in the VPS.

Bob

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

Re: LC Server on Inmotion Hosting

Post by FourthWorld » Fri May 29, 2015 7:08 pm

If you're able to get .htaccess working on a shared host but not a VPS, that suggest the Apache setup on the VPS may not have the required modules enabled for that, as would be customary for a shared host.

Have you had a chance to check is mod_rewrite and mod_action have been enabled on the VPS with a2endmod? Those are normally enabled by administrators of shared hosts, but since .htaccess is not recommended for a dedicated host they're not enabled on such a system by default.
Richard Gaskin
Community volunteer LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

bhall2001
Posts: 99
Joined: Thu Oct 30, 2014 3:54 pm

Re: LC Server on Inmotion Hosting <SOLVED>

Post by bhall2001 » Wed Sep 30, 2015 3:24 pm

Finally figured out what was happening. The LC Server that did not work I uploaded the individual files to my hosting site after unzip them locally. I suspect there was an FTP conversion of some sort that happened on the upload of the individual files that messed things up.

By chance, I uploaded the LC Server .zip file directly and did the unzip on the host in Cpanel's file area. ALL IS GOOD! Livecode server fired up with no issues as soon as I went to my hello world test script.

Bob

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

Re: LC Server on Inmotion Hosting

Post by FourthWorld » Thu Oct 01, 2015 12:52 am

Glad you got that worked out. I've never understood why so many FTP clients have an Alter Data On Transfer mode turned on by default.

If you use rsync going forward you'll get a faster, more efficient transfer in addition to being bit-perfect.

Even better, if you set up a shared SSH key with your server you can even call rsync from LiveCode's shell function to automate such transfers easily.
Richard Gaskin
Community volunteer LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

Post Reply

Return to “CGIs and the Server”