How do I install LiveCode Server on Linux with Apache?
The LiveCode Server product brings our english like language to the server environment. The server engine is a separate build of the LiveCode engine with specific syntax and functionality that makes it suitable for use in command-line contexts and, in particular, as a CGI processor.
This lesson will walk you through the steps required to install LiveCode Server on Linux with Apache.
This lessons assumes you have access to your system's Apache configuration files. If you do not, see the the lesson "How to install LiveCode Server with Apache via .htaccess?"
Prerequisites
Before starting, read the lesson "How do I install LiveCode Server".
Apache is the most most popular web server package available today. Installing Apache will allow your machine to function as a web server, hosting websites and serving web pages. Most Linux distributions come with Apache installed by default. If not, you can either install it using the appropriate package manager for your system, download pre-built binaries for your system or build it from source.
For example, on Debian based distributions, you can install Apache using apt with the following command:
sudo apt-get install apache2
For more information on building Apache for your system, navigate to http://httpd.apache.org/docs/2.0/install.html.
You will need to ensure that your install of Apache has following three modules are enabled:
This lessons assumes you have access to your system's Apache configuration files. If you do not, see the the lesson "How to install LiveCode Server with Apache via .htaccess?"
32bit libraries are required for LiveCode server to run on a 64bit Linux distribution
These can be installed via the following (or similar) commands-
yum install glibc.i686 glibc-2.12-1.107.el6_4.2.i686
yum install libgcc.i686
Download LiveCode Server
Begin by downloading the LiveCode server zip file for Linux using the instructions detailed in the lesson "How do I install LiveCode Server?". Unzip the package into your desired location - for example in your home folder.
Access Apache configuration files
The location of your Apache configuration files will depend upon the setup of your system. Â They are often located located in either in /etc/apache2/ or /etc/httpd/. There is usually on main httpd.conf file in this folder that includes several sub configuration files. For example, on Debain based systems, the site configuration is often included in a sub folder /sites-enabled/.
Set up LiveCode Server as a CGI engine
Next, you need to alter the Apache configuration file so that it associates .lc extensions with the LiveCode Server engine. To do this, open up the main Apache configuration file in a text editor. Your configuration file should contain an entry like the following:
DocumentRoot /var/www
This details the folder where Apache looks for its web pages. This folder will have a directory directive that by default will look something like the following:
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
AddHandler livecode-script .lc
Action livecode-script /livecode-cgi/livecode-server
</Directory>
Update this directory directive to look like the following:
<Directory "/var/www/">
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
AddHandler livecode-script .lc
Action livecode-script /livecode-cgi/livecode-server
</Directory>
<Directory "<path to LiveCode Server folder>">
Options ExecCGI
Order allow,deny
Allow from all
</Directory>
ScriptAlias /livecode-cgi/livecode-server "<path to LiveCode Server folder>/livecode-server"
Here <path to LiveCode Server folder>
is the full path to the folder you unzipped the LiveCode Server files into.
Important: These instructions apply to Apache v2.2. If you are using a newer version of Apache, you need to replace every occurence of:
Order allow,deny
Allow from all
with
Require all granted
Restart Apache
Once you have updated your configuration file, you must restart Apache. You can do this by running the following command in the terminal (may vary, depending upon you Apache install):
sudo apache2ctl restart
Create and view a test page

You are now ready to test your installation. To do this, create a file named "test.lc" in your document root folder. Your document root folder is defined in your Apache configuration file and can be found using the interactions defined in the step "Set up LiveCode Server as a CGI engine".
To access the test script, navigate to http://localhost/test.lc using your browser. The above image shows the expected output if "test.lc" contains the following script:
<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>
For more detailed information on installing LiveCode server, see the server release notes distributed with the server package.
NB Depending on your Linux install you may need to set ownership/permissions of livecode-server file
e.g.
chown owner-user livecode-server
I have set everything up as per instructions above but when I navigate to test.lc in a browser I see the hmtl script instead of the livecode expected output. I didn't get any release notes when I downloaded the server software so I cannot refer back to it.
Does the result I'm getting have a known fix?
I'm thinking the changes I've made to the directives in httpd.conf file are not correct.