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.

Apache 2.2 httpd.conf


You can then edit the Apache configuration and add the following lines :
  • LoadModule neko_module your/path/to/mod_neko2.ndll : this will tell Apache to load the module mod_neko2.ndll when it starts
  • 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.

Under WIndows put absolute path of mod_neko2.ndll DO NOT COPY mod_neko2.ndll under apache module folder

  • LoadModule neko_module c:\Motion-Twin\neko\mod_neko2.ndll : this will tell Apache to load the module mod_neko2.ndll when it starts from neko install folder

Apache 1.3 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 mod_neko.ndll 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


Detailed information about configuring mod_neko in linux can be found here: mod_neko-Installation
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

Need more help setting up Mod Neko


Jan created a cheat sheet setup for Justin that may also be useful, a temp copy can be found here
version #15649, modified 2012-11-03 04:05:49 by JLM