Build nekovm and extensions on Linux

Compiling NekoVM & mod_neko in Ubuntu (Gutsy 7.10)

Compatibility


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

Version            Works?
1.3.34             Requires -DEAPI workaround?
2.0.55             No
2.2.4-3ubuntu0.1   Yes

Retrieve

Download all the needed system packages

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

Next, download the latest official NekoVM source release from

http://nekovm.org/download

Alternatively, you can access the CVS version of the Neko sources by using the following server :

cvs -d:pserver:anonymous@cvs.motion-twin.com:/cvsroot login
(enter for empty password)
cvs -d:pserver:anonymous@cvs.motion-twin.com:/cvsroot co neko

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.

Compile


You're ready to compile nekoVM & mod_neko.ndll:
$ sudo make

The Neko make process will ask you about compiling some extra libraries like mod_neko and mysql support.

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
>/usr/include/apache-1.3

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...

Finishing


So your compilation should finish now. If it asks prompts you for more library paths you probably need to install whatever development library corresponds to what it is asking for. To help try `apt-cache search library name` or Google it. You might also be able to use the `locate` command to find the .h file that you need.

When it's finished and it's ok you'll see "Install done, all files are available in /bin directory"

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/lib/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/lib/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
version #4584, modified 2008-10-07 04:05:18 by baurel