Build nekovm on linux

Debian / Ubuntu

It's recommended to first setup the prerequisites in order to build the neko vm and its extensions. The following packages are needed:

  • apache2-threaded-dev: For Apache module libraries such as mod_neko and mod_tora
  • libmysqlclient15-dev: For building the Mysql client library
  • libpcre3-dev: For building the regular expression library
  • libgc-dev: For the garbage collector of the neko vm
  • libgtk2.0-dev: For the GTK bindings

Install Requirements

Download all the needed system packages

$ sudo apt-get install apache2 apache2-threaded-dev libmysqlclient15-dev libpcre3-dev libgc-dev libgtk2.0-dev

Install nekovm and apache extensions

The following script downloads the official NekoVM release, compiles the C sources and installs it on your system. Alternatively, if you want to work with the latest features you can checkout the sources from CVS.

Install script

Shellscript for the complete build and install process.
1. Copy the contents into a shell script, like ""
2. Decide if you want to download the release or checkout from CVS
3. make it executable: sudo chmod 0755
3. run it: sudo ./ (It's important that you run the script as root with sudo)


# Build the neko VM
# =================
# Important: run the script as root with "sudo ./"

# ------- User Configuration BEGIN -----------

# $RELEASE: release or cvs?
# - If you want to build neko with a official release you have to define the
# release version 
# - If you want to build neko from CVS you have to comment out the following
# line


# -------- User Configuration END ------------

mkdir -p /usr/local/src && cd /usr/local/src
rm -rf /usr/local/src/neko*
rm -rf /usr/local/neko
rm -rf /usr/local/bin/neko*

if [ $RELEASE ]; then
    wget "$RELEASE.tar.gz"
    tar xfvz $RELEASE.tar.gz
    cd $RELEASE
    #cvs login
    #cvs co neko
    svn co neko
    cd neko

# build neko

# install neko
mkdir /usr/local/neko
cp bin/* /usr/local/neko
ln -s /usr/local/neko/neko* /usr/local/bin/
ln -s /usr/local/neko/ /usr/local/lib

# may be required if /usr/local/lib is not in your library search path
grep "/usr/local/lib" /etc/ || echo "/usr/local/lib" >> /etc/

# setup environment variables for neko
grep "NEKOPATH" /etc/environment || echo "export NEKOPATH=/usr/local/neko" >> /etc/environment

Quick notes about building Neko:

  • The build script will also build mod_neko (and mod_tora) so you will be prompted to choose to target apache 1.3 or apache 2. Please read the following section for more information.
  • Since subshell () is used in the Neko Makefile, you may get a segfault from bash because of insufficient stack. To avoid this problem, you can increase the stack size by 'ulimit -s 20000'.
  • If you are not using gcc or an earlier gcc version, the option -fno-stack-protector may not be recognized. All you need to do is to removed it from the Neko Makefile. (Also comment it out in src/tools/neko.install, line 82 and 83).


Compiling mod_neko is currently only compatible with Apache 2.2.x or Apache 1.3.

DEAPI Workaround (Apache 1.3.x only?)

If you are using 1.3.34 you may need to do this.

You'll have to make an modification to neko/src/tools/install.neko (this is the workaround):
Add -DEAPI to the list of cflags around line 75.

Apache 1.3.x

If you instead installed Apache2 DONT' FOLLOW THIS.

Compiling mod_neko...
The file httpd.h provided when installing Apache 1.3.x was not found
Please enter a valid include path to look for it
Or 's' to skip this library

Apache 2.2.x

Compiling mod_neko...
The file httpd.h provided when installing Apache 1.3.x was not found
Please enter a valid include path to look for it
Or 's' to skip this library
> s
Compiling mod_neko2...

Now let's install it and run ldconfig for good measure.

$ sudo make install
$ sudo ldconfig

Apache 1.3 Configuration

I don't have any details about how to complete the configuration on 1.3. It's something like this...
  • add LoadModule neko_module /usr/local/lib/neko/mod_neko.ndll
  • add AddModule mod_neko.c
  • add AddHandler neko-handler .n
  • add index.n to the list of DirectoryIndex

Apache 2 Configuration

# add NEKOPATH variable to apache2 environment vars
sudo grep "NEKOPATH" /etc/apache2/envvars || echo "export NEKOPATH=/usr/local/neko" >> /etc/apache2/envvars

# create a neko.conf in available modules
sudo test -f /etc/apache2/mods-available/neko.conf || echo "AddHandler neko-handler .n" >> /etc/apache2/mods-available/neko.conf

# create a neko.load in available modules
sudo test -f /etc/apache2/mods-available/neko.load || echo "LoadModule neko_module /usr/local/neko/mod_neko2.ndll" >> /etc/apache2/mods-available/neko.load

# enable neko module
sudo ln -s /etc/apache2/mods-available/neko.* /etc/apache2/mods-enabled

# add index.n to DirectoryIndex in dir.conf
sudo grep "index.n" /etc/apache2/mods-available/dir.conf || cat /etc/apache2/mods-available/dir.conf | sed -r 's/DirectoryIndex (.*?)/DirectoryIndex index.n \1/' > dir.conf.tmp && cp dir.conf.tmp /etc/apache2/mods-available/dir.conf 
sudo test -f dir.conf.tmp && rm dir.conf.tmp

# restart apache2
/etc/init.d/apache2 restart

Neko from

Download and install neko from Debian Backports

version #15396, modified 2012-08-20 09:51:47 by BernardV