Configure mod_neko

Mod_neko

Mod_neko is an Apache module which embeds the Neko Virtual Machine that can runs haXe programs on the HTTP Server-side in order to generate dynamic web pages. For development purposes, it's better to use the Neko Dev Server which does not require any specific configuration.

Configuration

Mod_neko can be compiled for both Apache and Apache 2.2.x :

Since haXe 1.08, both versions are provided as part of the haXe or Neko distribution, they are named mod_neko.ndll for Apache 1.3 and mod_neko2.ndll for Apache 2.2.

Please note that if using Apache2 you should use an Apache2 prefork configuration or you may get into trouble when requesting a neko file.

Httpd.conf

You can then edit the Apache configuration and add the following lines :

  • LoadModule neko_module (your path to mod_neko.ndll) : this will tell Apache to load the module when it starts
  • AddModule mod_neko.c (only for Apache 1.3)
  • AddHandler neko-handler .n : this will bind the .n file extension to the handler declared in mod_neko.
  • Add index.n to the list of DirectoryIndex to enable a default index page

Each of these lines should be added in the httpd.conf file at the appropriate place.

LibNeko

Also, Neko needs to be accessible from Apache :

  • on Windows, there should not be any problem since when running haxesetup.exe everything should be correctly configured
  • on OSX/Linux, you need to add your Neko install path the %%/etc/ld.so.conf%% and then run the ldconfig command. One other possibility is to modify your LD_LIBRARY_PATH so Apache is able to load libneko.so (libneko.dylib on OSX).

Mod_neko on Apache in Linux

Mod_neko is currently compatible with Apache 2.2.x or Apache 1.3.
Most distributions don't have Apache 2.2 at their repositories.
They do have Apache 1.3.x. For Installing mod_neko in Ubuntu use this tutorial: Build nekovm on linux

version #4649, modified 2008-10-07 12:41:32 by baurel