How do I install LiveCode Server on OS X 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 OS X 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. By default, OS X comes with Apache installed with the relevant files being contained in the folder /etc/apache2/. To enable Apache, you need to turn on "Web Sharing" from within the "Sharing" pane of "System Preferences", as in the image above.
If you are using a custom install of Apache, you will need to ensure that the 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?"
Download LiveCode Server
Begin by downloading the LiveCode server zip file for OS X 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.
Accessing Apache configuration files

Next, you need to modify your Apache configuration files. To get access to you Apache configuration files, navigate to the folder /etc/apache2/. To do this, open up finder, click on the "Go" menu, select "Go to Folder", type in /etc/apache2/ and click on "Go". This should open up a new finder window displaying the contents of the Apache folder.
Setup LiveCode Server as a CGI engine

The main Apache configuration file is "httpd.conf". In addition to "httpd.conf", each user has their own configuration file named "<username>.conf" located in the users sub-folder. Open up the configuration file for your user in TextEdit and replace its contents with the following:
<Directory "/Users/<username>/Sites/">
Options Indexes 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 <username> is the name of the user whose conf file you are editing and <path to LiveCode Server folder> is the full path to the folder you unzipped the LiveCode Server files into.
Restart Apache

Once you have updated your configuration file, you must restart Apache. You can do this by either turning "Web Sharing" on and off from the "Sharing" pane of "System Preferences" or by running the following command in the terminal:
sudo apachectl restart
Create & view a web page

You are now ready to test your installation. To do this, create a file named "test.lc" in the "Sites" folder in the home folder of the user you have configured for. The "Sites" folder is the location for all the user's web pages.
To access the test script, navigate to http://localhost/~<username>/test.lc. 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.
The "AddHandler" directive can take more than one suffix. Like this:
AddHandler livecode-script .lc .irev
So if some of your HTML/LiveCode pages are named with the .lc suffix and others have the .irev (or some other) suffix, you can include both suffixes in "AddHandler" and all your LC pages will be handled correctly.