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 startsAddHandler neko-handler .n: this will bind the.nfile extension to the handler declared inmod_neko.- Add
index.nto the list ofDirectoryIndexto enable a default index page
Each of these lines should be added in thehttpd.conffile 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 startsAddModule mod_neko.c(only for Apache 1.3)AddHandler neko-handler .n: this will bind the.nfile extension to the handler declared inmod_neko.- Add
index.nto the list ofDirectoryIndexto enable a default index page
Each of these lines should be added in thehttpd.conffile 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.exeeverything should be correctly configured - on OSX/Linux, you need to add your Neko install path the
%%/etc/ld.so.conf%%and then run theldconfigcommand. One other possibility is to modify yourLD_LIBRARY_PATHso Apache is able to loadlibneko.so(libneko.dylibon 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