The Perfect Server [SOLVED]

Are you using LiveCode to create server scripts or CGIs?

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller, robinmiller

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

Re: The Perfect Server [SOLVED]

Post by ghettocottage » Tue Jun 02, 2020 9:48 pm

..also let us know what linux you are using: Ubuntu 18.04, Debian Stable, etc..

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

Re: The Perfect Server [SOLVED]

Post by sphere » Wed Jun 03, 2020 11:58 am

ghettocottage wrote:
Tue Jun 02, 2020 9:48 pm
..also let us know what linux you are using: Ubuntu 18.04, Debian Stable, etc..
The VPS is running on Ubuntu 18.04 Server 64bits.
I followed this fine tut which was previously based on 18.04 but now for 20.04 : How to Install Joomla with Apache2 and ... on Ubuntu
It uses also ISPconfig which you may not need, but with that you can be a hostcompany yourself.
But the tutorial was interesting for me as i had no knowhow enough to set it up, and this is just great with also good support.
It also uses Let's Encrypt so you can use HTTPS aswel on your server. ClamAV or other anitvirus. Email setup. and Fail2ban which blocks IP's when failing to login for 5 times etcetera.

And then for the server you can follow the post above where i finally got it working. I also asked a few question on their site and they helped me as far as they could.

Hope this helps. If not let me know.

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

Re: The Perfect Server [SOLVED]

Post by ghettocottage » Wed Jun 03, 2020 3:56 pm

Basically, you need to do the following:
  • put the livecode-server binary in /usr/lib/cgi-bin along with the folder it has in the zip file (when you download it)
  • make it executable: sudo chmod a+x /usr/lib/cgi-bin/livecode-server (or sudo chmod a+x /usr/lib/cgi-bin/livecode-community-server )
  • in your websites apache conf file in /etc/apache2/sites-enabled you want to add the following:

Code: Select all

<VirtualHost *:80>	
	AddHandler livecode-script .lc
       Action livecode-script /cgi-bin/livecode-community-server
       
       
       	<Directory /var/www/yourwebsitefolder>
		Options Indexes FollowSymLinks MultiViews
		AllowOverride all
		Order allow,deny
		allow from all
    		DirectoryIndex index.lc
    		DirectoryIndex index.html
    		DirectoryIndex index.php
    		Require all granted
	</Directory>
    
    	ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
		<Directory "/usr/lib/cgi-bin">
			AllowOverride All
			Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
			Order allow,deny
			Allow from all
		        Require all granted
		</Directory>
 ..
    
and further down or on your ssl site conf do the same thing:

Code: Select all


<IfModule mod_ssl.c>
<VirtualHost *:443>

	AddHandler livecode-script .lc
       Action livecode-script /cgi-bin/livecode-community-server
       
       
       	<Directory /var/www/yourwebsitefolder>
		Options Indexes FollowSymLinks MultiViews
		AllowOverride all
		Order allow,deny
		allow from all
    		DirectoryIndex index.lc
    		DirectoryIndex index.html
    		DirectoryIndex index.php
    		Require all granted
	</Directory>
    
    	ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
		<Directory "/usr/lib/cgi-bin">
			AllowOverride All
			Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
			Order allow,deny
			Allow from all
		        Require all granted
		</Directory>
		
		
...


  • Finally, enable the apache mods you need:
sudo a2enmod actions
sudo a2enmod rewrite
sudo a2enmod cgi
sudo a2enmod alias
  • sudo service apache2 restart


it should be working now.

keliko
Posts: 42
Joined: Thu Aug 01, 2019 8:15 am

Re: The Perfect Server [SOLVED]

Post by keliko » Wed Jun 03, 2020 8:49 pm

Big Thanks ghettocottage and sphere.

In case im using
- digital ocean ubuntu Ubuntu 18.04.3 (LTS) x64
- vestacp panel with configuration:
web: apache
DNS: No
Remi: Yes
FTP: vsftpd
Firewall: iptables+fail2ban.
System quota:no
mail: no
Softaculous:no
DB: Mysql

after successfully installing vestacp I add the domain. example: lcservertest.com

path lcservertest.com
/home/admin/web/lcservertest.com

- edit 000-default.conf
sudo nano /etc/apache2/sites-enabled/000-default.conf

this my 000-default.conf

Code: Select all

<VirtualHost *:80>
    ServerAdmin admin@example.com
    DocumentRoot /home/admin/web/lcservertest.com
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
    
    AddHandler livecode-script .lc
Action livecode-script /cgi-bin/livecode-server
       
       
       	<Directory /home/admin/web/lcservertest.com/public_html>
		Options Indexes FollowSymLinks MultiViews
		AllowOverride all
		Order allow,deny
		allow from all
    		DirectoryIndex index.lc
    		DirectoryIndex index.html
    		DirectoryIndex index.php
    		Require all granted
	</Directory>
    
    	ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
		<Directory "/usr/lib/cgi-bin">
			AllowOverride All
			Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
			Order allow,deny
			Allow from all
		        Require all granted
		</Directory>


<IfModule mod_ssl.c>
<VirtualHost *:443>

	AddHandler livecode-script .lc
       Action livecode-script /cgi-bin/livecode-server
       
       
       	<Directory /home/admin/web/lcservertest.com/public_html>
		Options Indexes FollowSymLinks MultiViews
		AllowOverride all
		Order allow,deny
		allow from all
    		DirectoryIndex index.lc
    		DirectoryIndex index.html
    		DirectoryIndex index.php
    		Require all granted
	</Directory>
    
    	ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
		<Directory "/usr/lib/cgi-bin">
			AllowOverride All
			Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
			Order allow,deny
			Allow from all
		        Require all granted
		</Directory>
</VirtualHost>
after restarting apache. i upload lc file with

Code: Select all

<?lc
put the version
?>
unsuccessfully displaying the lc server version. What wrong with my configuration?

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

Re: The Perfect Server [SOLVED]

Post by sphere » Wed Jun 03, 2020 9:21 pm

well this is where the tricky things start.
I had to alter a vhost file as mentioned in a post above. And i also had the opportunity to add a piece of script into ISPconfig which then takes care of it.
But i don't know if that counts for you too.

So different setups makes different possibilities/issues. For me the final point was the Alias which was not pointing correctly to the correct folder.

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

Re: The Perfect Server [SOLVED]

Post by ghettocottage » Wed Jun 03, 2020 10:09 pm

Do you own the domain lcservertest.com and have it pointed at your VPS? You cannot just make up a domain and have it work.

What happens when you go to the IP address of your server?

Also, when you put your website folder in your home directory rather than the default /var/www folder, you will also need to change permissions of that folder so apache2 user can access it:

sudo chown -R www-data:www-data /your/website/folder

keliko
Posts: 42
Joined: Thu Aug 01, 2019 8:15 am

Re: The Perfect Server [SOLVED]

Post by keliko » Thu Jun 04, 2020 6:37 am

yes mydomain lcservertest.com point "A" record to my ip.


when i go to my ip.
show only vestacp

Code: Select all

159.65.34.xx
vestacp.example.com
Powered by VESTA
maybe I will try to install the lamp stack whitout vestacp.

keliko
Posts: 42
Joined: Thu Aug 01, 2019 8:15 am

Re: The Perfect Server [SOLVED]

Post by keliko » Thu Jun 04, 2020 7:15 am

Big Thanks sphere and ghettocottage.
:D :D :D
finally succeeded install livecode server on vps.

i don't use vestcp
install lamp stack from digitalocen marketplace
https://marketplace.digitalocean.com/apps/lamp

then follow the steps from ghettocottage.
https://forums.livecode.com/posting.php ... 5#pr192600

surely succeed.

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

Re: The Perfect Server [SOLVED]

Post by sphere » Thu Jun 04, 2020 12:32 pm

Great! Good for you.

Post Reply

Return to “CGIs and the Server”