Kepler
The Lua Web Development Platform

Using Kepler with Apache 2 in Unix

You can configure Kepler with Apache 2 with the following launchers:

Please check the corresponding launcher section for the configuration details.

mod_lua

mod_lua allows the use of the Apache native API. This is usually the easier option for Kepler on an Apache 2 Server.

The Apache 2 installation directory will be refered here as APACHE_DIR. In Unix this is usually the diretory /usr/local/apache2.

To use Kepler as a mod_lua application you have to configure Apache to associate URLs ending in .lua or .lp with Kepler. In order to do that, open the Apache configuration file (APACHE_DIR/conf/httpd.conf) on your editor, search for a series of LoadModule directives and add the following one:

# Lua module for Apache2 configuration file.
LoadModule lua_module modules/mod_lua.so

<IfModule mod_lua.c>
    # Definition of file types
    AddHandler lua_module .lua
    AddHandler lua_module .lp
    # Definition of Lua module handlers for file types
    LuaHandler lua_module
</IfModule>

Debian-based distributions have an /etc/apache2/conf.d directory where you can put Apache configuration snippets. Just create a file called kepler.conf with the directives above and put it there.

Save the file and restart Apache. In case of errors, check if mod_lua.so is present on the APACHE_DIR/modules directory. If not present you'll need to check the building steps for the mod_lua launcher.

If you want your Apache configured as a Kepler-only server you can change the DocumentRoot to point to the Kepler web directory. Change the following sections in your Apache configuration file:

#
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "/usr/local/kepler/web"

...

#
# This should be changed to whatever you set DocumentRoot to.
#
<Directory "/usr/local/kepler/web">

FastCGI

FastCGI is also a good option for Kepler on an Apache 2 Server. You need to have mod_fcgid, the new FastCGI module for Apache. To use Kepler as a FastCGI application, you have to configure Apache to associate .lua and .lp extensions with the Kepler FastCGI launcher (/usr/local/bin/fastcgi) in the default installation. Edit the Apache configuration file (usually /usr/local/apache2/conf/httpd.conf if you compiled Apache from source) to include the following:

<IfModule mod_fcgid.c>
  SocketPath /tmp/kepler-fcgi
  AddHandler fcgid-script .lua .lp
  FCGIWrapper /usr/local/bin/fastcgi .lua
  FCGIWrapper /usr/local/bin/fastcgi .lp
</IfModule>

Debian-based distributions have an /etc/apache2/conf.d directory where you can put Apache configuration snippets. Just create a file called kepler.conf with the directives above and put it there. Save the file and restart Apache.

If you want your Apache configured as a Kepler-only server you can change the DocumentRoot to point to the Kepler web directory. Change the following sections in your Apache configuration file:

#
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "/usr/local/kepler/web"

...

#
# This should be changed to whatever you set DocumentRoot to.
#
<Directory "/usr/local/kepler/web">

For further information check mod_fastcgi documentation.

CGI

Kepler can be used as a standard Apache CGI application.

This part of the documentation is still under development.

Valid XHTML 1.0!

$Id: install.unix.apache2.html,v 1.13 2007/11/19 20:22:03 hisham Exp $