Page 1 of 2

The Perfect Server [SOLVED]

Posted: Sun Oct 20, 2019 1:16 pm
by sphere

although i'm almost ready having my webpart build with html and php.
I'm trying to get LC server running on my VPS. It's not easy, the lesson on how to install it, is not actually current, one of the comments comes close, but still no joy.

On you can find tutorials for several linux distributions with complete in depth howto's in combination with ISPconfig. (search for The Perfect Server on that site or just look under tutorials) i used Ubuntu 18.04 LTS server with Apache.

So it seems the apache things have to be set in ISPconfig onder the website options tab. This way it should not be needed to fiddle with any files.
With ispconfig you can setup multiple domains so you could play your own host. And this way you can allow LC server for just one domain.
It's not working yet, so i posted a few questions there, and hopefully figure it out.
When it works i'll post here of course.

Re: The Perfect Server

Posted: Sun Oct 20, 2019 5:26 pm
by FourthWorld
Would a shell script to automate installation of LC Server on a VPS be useful?

Or an Ansible playbook?

I believe there's a Docker container out there already.

Installing LC by hand is a good thing to do once, to know how the parts come together. But production systems need to automated deployment for portability and recovery.

I had considered writing a shell script, but with all the benefits of modern containers I've been considering adopting Docker for deployments.

Too many compelling options. It's funny how all the freedom of choice we have in tech these days sometimes makes getting started hard as we sort through them all.

Re: The Perfect Server

Posted: Sun Oct 20, 2019 5:48 pm
by sphere
Perhaps a shell script would be usefull, but i'm not sure how it would go with ISPconfig running.

I also don't know i can use a docker. First have to check what it exactly does, as i just quickly checked it's a container with stuff in it, it seems.
But it's new for me.

I think i'm almost there, the last part is to let the server use lc server when .lc files are called. As that is still refusing, not when altering conf files and not when the apache directives are added in ISPconfig to the domain. Although ISPconfig also seems to be a cgi executable.

*edit* someone made one for ispconfig:

and the one you've mentioned

Re: The Perfect Server

Posted: Sun Oct 20, 2019 6:18 pm
by FourthWorld
Is the ISPconfig dependency necessary?

I've been deploying LC on VPSes for more than a decade and I've never had to contend with that. I prefer to keep production systems pared down to the packages needed for customer delivery.

A solution dependent on a specific external package can be useful to some, but something that can run on any Linux system would benefit all VPS deployments.

That's not to discourage you from pursuing whatever works well within your configuration. But for myself, I'm most motivated to flesh out solutions that can help anyone running any stock Linux system, or at least a stock Debian-based system, but I can't afford the time to help with anything more restricted than that.

Re: The Perfect Server

Posted: Sun Oct 20, 2019 7:38 pm
by sphere
No it's not necessary to have ISPconfig, but for me it was my first VPS set-up ever. It's as you know completely different than running Xampp or the like packages, or even separate Apache and php packages on local Windows or other OS.
And there are several setup tutorials for centos debian ubuntu with also a good support via their forum. So it's a good place to start.

For me it's not even needed to run an website there, i only have my php files as middle-ware to connect to the DB.
I wanted the DB total separate from the main website, as the mobile app also uses the DB on the VPS.
And will now only put some html/php and html/lc files there, but run them via an i-frame on another site.

Re: The Perfect Server

Posted: Sun Oct 20, 2019 8:33 pm
by FourthWorld
That makes good sense for what you're doing. And that's why I haven't take the time to write a shell script to automate LC Server installs. So many devs are doing so many different things that attempting a single solution becomes difficult to justify.

Re: The Perfect Server

Posted: Sun Oct 20, 2019 10:10 pm
by sphere
I totally agree

Re: The Perfect Server

Posted: Wed Oct 30, 2019 1:19 pm
by sphere
Had no luck yet with altering some conf files.
So i will try if i can do similar as with xammp which is working.
Seems on the other forum from ISPconfig they are out of options too.

Mostly it is something simple in hindsight.

Re: The Perfect Server

Posted: Wed Oct 30, 2019 4:19 pm
by FourthWorld
If you wish to bypass ISPconfig and work directly with Apache via shell, the LC Server installation lesson works well on Ubuntu.

If you run into any snags with it (missing an a2enmod command is common) I may be able to help with a stock setup.

Re: The Perfect Server

Posted: Wed Oct 30, 2019 10:01 pm
by sphere
Thanks Richard very kind, i will just try for a few days more :)

I'm trying according the .htaccess lesson now and have reversed the conf version.
Also reversed the ispconfig version. When one added a website in ispconfig, you can add apache directives specific for that website, so i removed that.

Module actions and cgi are already enabled

First the server was placed here:

The index.php or are here: /var/www/clients/client1/web1/web
Now i added a folder cgi-bin into the web folder

Now i had a 404 and now an error 500 so we're getting somewhere i guess.

I also read some threads where someone had luck by putting .cgi behind livecode-community-server and change it also in .htaccess accordingly

will try some more

Re: The Perfect Server

Posted: Wed Oct 30, 2019 10:22 pm
by FourthWorld
At the point you're at 500s are probably related to permissions. Setting the engine to 755 may help if you haven't done that already. Some configurations require setting the cgi-bin folder to 644 also.

Re: The Perfect Server

Posted: Wed Oct 30, 2019 10:33 pm
by sphere
i just checked, the permissions are set, also for the server file itself.

I noticed that even for a index.html file i get an error 500 when using the .htaccess file

it contains:

Code: Select all

#Options ExecCGI FollowSymLinks
AddHandler livecode-script .lc
DirectoryIndex index.irev index.php index.html
Action livecode-script /web/cgi-bin/livecode-community-server

<IfModule mod_rewrite.c>
  RewriteEngine on
  RewriteBase /
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond $1 !^(index\.lc|image|img|assets|robots\.txt|css|js)
  RewriteRule ^(.*)$$1 [L]
will try tomorrow again,thx!

Re: The Perfect Server

Posted: Sat Nov 02, 2019 3:25 pm
by sphere
Yes!! got it running finally, never give up. :mrgreen:
So got 2 choices which both work: alter 2 scripts on the server or alter 1 script and add a piece to ISPconfig website-->option tab
I tested them both and work ok now pfeew!

First i added a folder cgi-bin into /var/www/clients/client1/web1/web/ so i'm not using the cgi-bin which is already in web1, and copied the LC server into it

i added this to 000-default.conf which is in etc/lib/apache2/sites-available (make a backup of the file first)
You need this else either choice below will not work:

Code: Select all

AddHandler livecode-script .lc 
	Action livecode-script /cgi-bin/livecode-community-server

Then added this to (which is also in etc/lib/apache2/sites-available)(make a backup first) just before the rewrite part in both the 80 and 443 (http/https) section:
Or the other choice is when using ISPconfig add this to the website-->options tab into the Apache directives

Code: Select all

<Directory /var/www/clients/client1/web1/web/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
AddHandler livecode-script .lc
Action livecode-script /livecode-cgi/livecode-community-server

<Directory /var/www/clients/client1/web1/web/cgi-bin>
Options ExecCGI
Order allow,deny
Allow from all

ScriptAlias /livecode-cgi/ /var/www/clients/client1/web1/web/cgi-bin/
But most important here was the ScriptAlias which was pointing to the wrong dir and does not need quotes and neither the lc-community-server at the end
I blindly copied it from the LC lessons, but examining the vhost script which also contains directives to perl and apache it becomes clear it's not correct
.htaccess is not needed

then sudo service apache restart in Putty terminal
and run a test lc script like

This lesson needs a massive update: ... ith-apache

Re: The Perfect Server [SOLVED]

Posted: Tue Jun 02, 2020 9:20 pm
by keliko
Hai Sphere,

can you share step by step install livecode server via vps. This will really help us all.


Re: The Perfect Server [SOLVED]

Posted: Tue Jun 02, 2020 9:43 pm
by sphere
Hi Keliko,

installing the LC server is not so difficult, it's merely unzipping and copying to the correct cgi folder.
the difficulty is in the script aliases like in the post above.

And that can be different per vps setup.

What is the point where you are stuck, maybe we can help, I'm not an expert on Linux, it's trial and error and some basics i know or find.