Shared Hosting (Solved)

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: Shared Hosting

Post by bogs » Sun May 03, 2020 4:52 pm

EddieLee wrote:
Sun May 03, 2020 4:45 pm
Doesn’t livecode server only included in livecode Indy?
While I don't use server often, or know much about how to use it, I can at least answer that for you.
aPic_LcServer.png
How to serve your community...
As you can see, anyone can download and run Lc server, although if you start making money off it, I'm not sure how that works out.
Image

EddieLee
Posts: 118
Joined: Thu Oct 25, 2018 1:06 pm

Re: Shared Hosting

Post by EddieLee » Sun May 03, 2020 5:05 pm

bogs wrote:
Sun May 03, 2020 4:52 pm
EddieLee wrote:
Sun May 03, 2020 4:45 pm
Doesn’t livecode server only included in livecode Indy?
While I don't use server often, or know much about how to use it, I can at least answer that for you.
aPic_LcServer.png
As you can see, anyone can download and run Lc server, although if you start making money off it, I'm not sure how that works out.
Hi bogs,

Thanks for letting me know I can do that hahaha, is it from this website?

https://downloads.livecode.com/livecode/
Eddie :D

ghettocottage
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 366
Joined: Tue Apr 10, 2012 9:18 am

Re: Shared Hosting

Post by ghettocottage » Sun May 03, 2020 5:49 pm

Personally I would use a fresh VPS and set up livecode server on my own, but it looks like these people have Livecode Server Hosting for a reasonable fee:
https://www.hostm.com/livecode-hosting

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

Re: Shared Hosting

Post by FourthWorld » Sun May 03, 2020 6:29 pm

I prefer VPSes myself, but I've only started using them after I spent considerable time learning sys admin.

Shared hosting is managed by pros, so it's not a bad choice at all for those with modest traffic and who aren't yet comfortable being responsible for the entire system.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

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

Re: Shared Hosting

Post by SparkOut » Sun May 03, 2020 7:57 pm

Managing your own VPS can be daunting, or easy depending on the hosting package and what's included. Some packages over here are quite cheap at face value but charge an extra £15 / month just for cPanel access, plus more for regular backups and guaranteed uptime is a premium. Other packages are slightly pricier but have such features bundled in.

After reflecting on the impression of Eddie's experience and needs, I would say it's a good start to use the hostm package mentioned which will be a nice price to begin with and has the features needed (or handy - LC Community Server preinstalled and maintained) but can also be scaled up in future if it's necessary.

kdjanz
Posts: 300
Joined: Fri Dec 09, 2011 12:12 pm
Location: Fort Saskatchewan, AB Canada

Re: Shared Hosting

Post by kdjanz » Sun May 03, 2020 10:02 pm

https://livecode.com/introducing-livecloud/

is another alternative that might be a lot simpler for you. You could use this very simply as you work through development.
By LiveCode for LiveCode - simple...

EddieLee
Posts: 118
Joined: Thu Oct 25, 2018 1:06 pm

Re: Shared Hosting

Post by EddieLee » Mon May 04, 2020 2:33 am

SparkOut wrote:
Sun May 03, 2020 7:57 pm
Managing your own VPS can be daunting, or easy depending on the hosting package and what's included. Some packages over here are quite cheap at face value but charge an extra £15 / month just for cPanel access, plus more for regular backups and guaranteed uptime is a premium. Other packages are slightly pricier but have such features bundled in.

After reflecting on the impression of Eddie's experience and needs, I would say it's a good start to use the hostm package mentioned which will be a nice price to begin with and has the features needed (or handy - LC Community Server preinstalled and maintained) but can also be scaled up in future if it's necessary.
Hi Sparkout

Thanks for the recommendations, I have checked with hostm customer service and realise I can get the package without a domain name. I’ll probably try to use it for a month to see how it goes. How about hosting a local host website to connect with hostm services? Any idea? And also after subscribing to hostm, I should just follow the tutorial to establish a secure connection?

https://www.hostm.com/tutorials/livecod ... iadb-mysql

Thanks!
Eddie :D

bangkok
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 937
Joined: Fri Aug 15, 2008 7:15 am

Re: Shared Hosting

Post by bangkok » Mon May 04, 2020 4:06 am

EddieLee wrote:
Mon May 04, 2020 2:33 am
Thanks for the recommendations, I have checked with hostm customer service and realise I can get the package without a domain name. I’ll probably try to use it for a month to see how it goes. How about hosting a local host website to connect with hostm services? Any idea? And also after subscribing to hostm, I should just follow the tutorial to establish a secure connection?
I bought a package with MostM a few weeks ago.

Very easy.

Very intuitive.

Very efficient.

You are good to go in a matter of minutes.

And a part from LC Server you can enjoy other stuff as well : email, FTP accounts, etc. Again, super easy to setup and to use

As for the "secure connection" with MySQL database, I didn' try it but I saw the tutorial.

You can easily create your own system, much more simple.

-a webpage that receives a POST (containing your SQL query, encrypted in an easy way) sent by your LiveCode app (mobile or not)
-this page decrypts the query, opens the connexion to the database server, executes the query, closes the connexion
-then "displays" the result (encrypted or not)

LC server is the perfect tool to experiment different ways.

EddieLee
Posts: 118
Joined: Thu Oct 25, 2018 1:06 pm

Re: Shared Hosting

Post by EddieLee » Mon May 04, 2020 4:14 am

bangkok wrote:
Mon May 04, 2020 4:06 am
EddieLee wrote:
Mon May 04, 2020 2:33 am
Thanks for the recommendations, I have checked with hostm customer service and realise I can get the package without a domain name. I’ll probably try to use it for a month to see how it goes. How about hosting a local host website to connect with hostm services? Any idea? And also after subscribing to hostm, I should just follow the tutorial to establish a secure connection?
I bought a package with MostM a few weeks ago.

Very easy.

Very intuitive.

Very efficient.

You are good to go in a matter of minutes.

And a part from LC Server you can enjoy other stuff as well : email, FTP accounts, etc. Again, super easy to setup and to use

As for the "secure connection" with MySQL database, I didn' try it but I saw the tutorial.

You can easily create your own system, much more simple.

-a webpage that receives a POST (containing your SQL query, encrypted in an easy way) sent by your LiveCode app (mobile or not)
-this page decrypts the query, opens the connexion to the database server, executes the query, closes the connexion
-then "displays" the result (encrypted or not)

LC server is the perfect tool to experiment different ways.
Hi Bangkok,

Thanks for letting me know the benefits, I’ll probably will get it for a month to try out the service and if it’s good, I will continue it in the long term. I don’t get what you mean I can have a simpler system/web page to receive a POST. How do I go around doing it?
Eddie :D

bangkok
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 937
Joined: Fri Aug 15, 2008 7:15 am

Re: Shared Hosting

Post by bangkok » Mon May 04, 2020 10:43 am

EddieLee wrote:
Mon May 04, 2020 4:14 am
I don’t get what you mean I can have a simpler system/web page to receive a POST. How do I go around doing it?
In your app (Windows, MacOS or Android), create a button with this script :

Code: Select all

on mouseup
   set httpheaders to empty
   put "select * from mytable" into tSQLQuery
   put "query="&urlencode(tSQLQuery) into tSQLQuery
   post tSQLQuery to url "http://mywebsite.com/mysecretpage.lc"
   put it into tResult        
   answer tResult
end mouseup
Now on your website, hosted by HostM, create this web page (for LC Server) with file name "mysecretpage.lc" :

Code: Select all

<?lc
put $_POST["query"] into tSQLQuery     ----- the POST made by the app is received and stored in a variable
put revOpenDatabase("mysql","127.0.0.1","mydatabase","mylogin","mypassword") into tDBID     ----open connexion to your DB
put revDataFromQuery(,,tDBID,tSQLQuery) into tResult             --------perform the query
revclosedatabase tDBID                       ---------- close connexion
put tResult                                      -----and just "display" the result of the query
?>
Voilà. You have a very basic (but functional) system where an app created by LC can send a SQL query to your website/database hosted somewhere on the Internet, and fetch the results.

As I wrote, you would need to encrypt/decrypt the query and add some system to prevent "injection SQL attacks" (if you wish to perform INSERT or UPDATE queries etc.)... But this is just a simple example.

Thierry
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 875
Joined: Wed Nov 22, 2006 3:42 pm

Re: Shared Hosting

Post by Thierry » Mon May 04, 2020 12:07 pm

SparkOut wrote:
Sun May 03, 2020 7:57 pm
After reflecting on the impression of Eddie's experience and needs, I would say it's a good start to use the hostm package mentioned which will be a nice price to begin with and has the features needed (or handy - LC Community Server preinstalled and maintained) but can also be scaled up in future if it's necessary.
+1

For how helpful it could be here is my experience a couple of years ago:

I have a shared hosting at a low price. It's a French company but doesn't change anything.

Via ssh and terminal I upload the zip LC server on my host, unzip and add 3 or 4 lines in .htaccess file,
and it just works. I did some successful tests at this time, and didn't see any major problems.

If you want those .htaccess extra-lines, I can send them to you... (don't have them at hand right now)

My 2 cents

Thierry
!
SUNNY-TDZ.COM doesn't belong to me since 2021.
To contact me, use the Private messages. Merci.
!

EddieLee
Posts: 118
Joined: Thu Oct 25, 2018 1:06 pm

Re: Shared Hosting

Post by EddieLee » Mon May 04, 2020 1:11 pm

Thierry wrote:
Mon May 04, 2020 12:07 pm
+1

For how helpful it could be here is my experience a couple of years ago:

I have a shared hosting at a low price. It's a French company but doesn't change anything.

Via ssh and terminal I upload the zip LC server on my host, unzip and add 3 or 4 lines in .htaccess file,
and it just works. I did some successful tests at this time, and didn't see any major problems.

If you want those .htaccess extra-lines, I can send them to you... (don't have them at hand right now)

My 2 cents

Thierry
Hi Thierry,

Yes I don’t mind having those .htaccess extra lines, I can try your method or the POST method which was mentioned above and see which is the best way to do it.

Thanks for your help!
Eddie :D

EddieLee
Posts: 118
Joined: Thu Oct 25, 2018 1:06 pm

Re: Shared Hosting

Post by EddieLee » Mon May 04, 2020 1:16 pm

bangkok wrote:
Mon May 04, 2020 10:43 am
EddieLee wrote:
Mon May 04, 2020 4:14 am
I don’t get what you mean I can have a simpler system/web page to receive a POST. How do I go around doing it?
In your app (Windows, MacOS or Android), create a button with this script :

Code: Select all

on mouseup
   set httpheaders to empty
   put "select * from mytable" into tSQLQuery
   put "query="&urlencode(tSQLQuery) into tSQLQuery
   post tSQLQuery to url "http://mywebsite.com/mysecretpage.lc"
   put it into tResult        
   answer tResult
end mouseup
Now on your website, hosted by HostM, create this web page (for LC Server) with file name "mysecretpage.lc" :

Code: Select all

<?lc
put $_POST["query"] into tSQLQuery     ----- the POST made by the app is received and stored in a variable
put revOpenDatabase("mysql","127.0.0.1","mydatabase","mylogin","mypassword") into tDBID     ----open connexion to your DB
put revDataFromQuery(,,tDBID,tSQLQuery) into tResult             --------perform the query
revclosedatabase tDBID                       ---------- close connexion
put tResult                                      -----and just "display" the result of the query
?>
Voilà. You have a very basic (but functional) system where an app created by LC can send a SQL query to your website/database hosted somewhere on the Internet, and fetch the results.

As I wrote, you would need to encrypt/decrypt the query and add some system to prevent "injection SQL attacks" (if you wish to perform INSERT or UPDATE queries etc.)... But this is just a simple example.
Hi bangkok,

Thanks for the codes but however does this establish a connection with the database securely so that I can perform my SELECT, INSERT and UPDATE queries? Because the main reason for this thread is for me to find a way to communicate with the database in a secure way for the benefits of security. And also for the code on the app, before you use the SELECT query shouldn’t it be to establish a connection to the database first to collect the data?

Hope to hear from you soon!
Eddie :D

bangkok
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 937
Joined: Fri Aug 15, 2008 7:15 am

Re: Shared Hosting

Post by bangkok » Mon May 04, 2020 2:00 pm

EddieLee wrote:
Mon May 04, 2020 1:16 pm
Thanks for the codes but however does this establish a connection with the database securely so that I can perform my SELECT, INSERT and UPDATE queries? Because the main reason for this thread is for me to find a way to communicate with the database in a secure way for the benefits of security.
No offense, but before absolute security, you have to understand the basic underlying processes (and here the interactions between a desktop or Android app and a remote database hosted somewhere on the Internet).

That's the point of my very simple example.

The library designed by HostM is perfect from a security point of view, but I guess it would be a little bit hard for you to use it first.
EddieLee wrote:
Mon May 04, 2020 1:16 pm
And also for the code on the app, before you use the SELECT query shouldn’t it be to establish a connection to the database first to collect the data?
The webpage collects the data from the POST, and then opens the connexion to the database.

It's more logical, because it allows you first to decrypt the data, and to be sure that those data are valid and legitimate (coming from your App, instead of a third party trying to hack your system).

So you can do several tests on the data received by the POST, and when everything is okay, you open the connexion to the database and perform the query.

EddieLee
Posts: 118
Joined: Thu Oct 25, 2018 1:06 pm

Re: Shared Hosting

Post by EddieLee » Mon May 04, 2020 4:14 pm

bangkok wrote:
Mon May 04, 2020 2:00 pm
EddieLee wrote:
Mon May 04, 2020 1:16 pm
Thanks for the codes but however does this establish a connection with the database securely so that I can perform my SELECT, INSERT and UPDATE queries? Because the main reason for this thread is for me to find a way to communicate with the database in a secure way for the benefits of security.
No offense, but before absolute security, you have to understand the basic underlying processes (and here the interactions between a desktop or Android app and a remote database hosted somewhere on the Internet).

That's the point of my very simple example.

The library designed by HostM is perfect from a security point of view, but I guess it would be a little bit hard for you to use it first.
EddieLee wrote:
Mon May 04, 2020 1:16 pm
And also for the code on the app, before you use the SELECT query shouldn’t it be to establish a connection to the database first to collect the data?
The webpage collects the data from the POST, and then opens the connexion to the database.

It's more logical, because it allows you first to decrypt the data, and to be sure that those data are valid and legitimate (coming from your App, instead of a third party trying to hack your system).

So you can do several tests on the data received by the POST, and when everything is okay, you open the connexion to the database and perform the query.
Hi Bangkok,

Thanks, I misread the codes which caused me to asked a stupid question, I understand what you said now and thanks for the explanation. I will give your way a run tomorrow and compare it with hostm tutorial method to see which is suitable for me. So from my understanding, for every query that I need to perform, I need to send it to mysecretfile.lc and this is where the command would be executed? I tried the server code and this error shows up
revdberr,Query was empty
Is it normal to be this way? On my app side, i received the information i need from the database!
Thanks for your help!
Eddie :D

Post Reply

Return to “Talking LiveCode”