Showing posts with label Installation & Configuration. Show all posts
Showing posts with label Installation & Configuration. Show all posts

Wednesday, July 9, 2014

Install LiveCode Community Server 6.6.2 on Debian

Pre-Conditions

This tutorial is written explicitly for LiveCode 6.6.2 Stable and might not work with other versions. The tutorial will not be updated!

Install Apache

sudo apt-get install apache2

LiveCode currently depends on 32bit libraries. If the Debian distribution is 64bit then following commands need to be executed:

dpkg --add-architecture i386
apt-get update
apt-get install libc6:i386

Setup directory structure

cd /var/www
sudo mkdir cgi-bin
sudo mkdir www.yourhostname.com
sudo mkdir www.yourhostname.com/public
sudo mkdir www.yourhostname.com/log

Download the LiveCode Community Server

Login to the LiveCode site. Or you can also go to downloads.livecode.com.

Click on to the Download link on the left and then click on to View All LiveCode Downloads

downloads

Click on to Linux just below the header called Community Server

downloads-community-server

Upload the zip file to your server:

scp ~/Downloads/LiveCodeCommunityServer-6_6_2-Linux.zip user@your.server.com:./

Unzip the file in your home directory on the server:

mkdir livecode662
mv LiveCodeCommunityServer-6_6_2-Linux.zip livecode662
cd livecode662
unzip LiveCodeCommunityServer-6_6_2-Linux.zip

Make sure that the livecode-community-server file is executable:

chmod 755 livecode-community-server

Move the folder in to /var/www/cgi-bin

sudo mv livecode662 /var/www/cgi-bin/

Setup the Apache configuration

Enable mod_actions:

cd /etc/apache2/mods-enabled
ln -s ../mods-available/actions.conf .
ln -s ../mods-available/actions.load .

Go in to the configuration directory:

cd /etc/apache2/sites-available

Create Apache configuration file /etc/apache2/sites-available/www.yourhostname.com:

<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName www.yourhostname.com

DocumentRoot /var/www/www.yourhostname.com/public
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>

<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>

<Directory "/var/www/www.yourhostname.com/public/">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
AddHandler livecode-script .lc
Action livecode-script /livecode-cgi/livecode-community-server
</Directory>

<Directory "/usr/lib/cgi-bin/livecode662/">
Options ExecCGI
Order allow,deny
Allow from all
</Directory>

ScriptAlias /livecode-cgi/livecode-community-server /usr/lib/cgi-bin/livecode662/livecode-community-server

ErrorLog ${APACHE_LOG_DIR}/error.log

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.

LogLevel warn

CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>

Enable the configuration:

cd /etc/apache2/sites-enabled/
ln -s ../sites-available/www.yourhostname.com .

Restart apache:

sudo apache2ctl start

Once finished try logging in over following URL: http://www.yourhostname.com/

Troubleshooting

  • Make sure that the directories are "chmod 755" within the cgi-bin folder.
  • Make sure that the slashes at the end of the directory pathes are present in the user apache conf script.

Development Frameworks

RevIgniter - Full blown MVC Framework - Use with TextMate 2.0-Alpha for Color Coding
RevSpark - Minimal Web Framework - Use with TextMate 2.0-Alpha for Color Coding

Monday, June 16, 2014

Install LiveCode Community Server 6.6.2 on MacOS X

Pre-Conditions

This tutorial is written explicitly for LiveCode 6.6.2 Stable and might not work with other versions. The tutorial will not be updated!

Create Directories and copy community server directory

Go in to the user directory and create the Sites and cgi-bin folder:

cd ~/
mkdir Sites
mkdir Sites/cgi-bin
Copy the LiveCode Directory that you downloaded and unzipped over to the cgi-bin directory:
cp -R ~/Downloads/LiveCodeCommunityServer-6_6_2-Mac ~/Sites/cgi-bin/livecode662

Create Apache Configuration in user directory

Edit /etc/apache2/users/your_mac_user.conf file and add following configuration:

<Directory "/Users/your_mac_user/Sites/">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
AddHandler livecode-script .lc
Action livecode-script /livecode-cgi/livecode-community-server
</Directory>
<Directory "/Users/your_mac_user/Sites/cgi-bin/livecode662/">
Options ExecCGI
Order allow,deny
Allow from all
</Directory>
ScriptAlias /livecode-cgi/livecode-community-server /Users/your_mac_user/Sites/cgi-bin/livecode662/livecode-community-server

Create file ~/Sites/test.lc for testing:

<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>"
?>

The Apache Webserver is installed by default on MacOS X. To start Apache you can type following command:

sudo apache2ctl start

Once finished try logging in over following URL: http://127.0.0.1/~your_mac_user/

Troubleshooting

  • Make sure that the directories are "chmod 755" within the cgi-bin folder.
  • Make sure that the slashes at the end of the directory pathes are present in the user apache conf script.

Some notes on Yosemite

After upgrading to Yosemite I had to do following:

In /etc/apache2/httpd.conf - Comment all modules except:

  • LoadModule authz_host_module libexec/apache2/mod_authz_host.so
  • LoadModule authz_core_module libexec/apache2/mod_authz_core.so
  • LoadModule access_compat_module libexec/apache2/mod_access_compat.so
  • LoadModule mime_module libexec/apache2/mod_mime.so
  • LoadModule log_config_module libexec/apache2/mod_log_config.so
  • LoadModule log_debug_module libexec/apache2/mod_log_debug.so
  • LoadModule log_forensic_module libexec/apache2/mod_log_forensic.so

In /etc/apache2/extra/httpd-userdir.conf - Uncomment following line:

  • Include /private/etc/apache2/users/*.conf

Do a restart:

apachectl restart

Development Frameworks

RevIgniter - Full blown MVC Framework - Use with TextMate 2.0-Alpha for Color Coding
RevSpark - Minimal Web Framework - Use with TextMate 2.0-Alpha for Color Coding