First of all, why Monkey http?

What is it?
From the monkey-project site:
"Monkey is a small, fast and lightweight open source Web Server for GNU/Linux. It has been designed with focus in embedded devices, therefore its scalable by nature having a low memory and CPU consumption and an excellent performance.

Monkey is properly supported on ARM, x86 and x64, being able to work in any architecture and device capable to run a Linux Kernel.

Features

  • HTTP/1.1 compliant
  • Virtual Hosts
  • Asynchronous networking model (event-driven)
  • Indented configuration
  • Plugins Support
  • C API Interface
  • Other features through base plugins:
  • SSL
  • Security
  • Log writter
  • Directory Listing
  • Shell: Command line


How it Works internal architecture
Monkey uses an hybrid mechanism composed by a fixed number of threads being each one capable to attend thousands of clients thanks to the event-driven model based in asyncrhonous sockets.

The interaction between the scheduler and each worker thread is lock free, avoiding race conditions and exposing a huge performance compared to other available options. It also takes the most of the Linux Kernel to optimize the work using specific system calls based on zero-copy strategy."

Performances
Monkey has great performances as shown in this post by jeremymorgan

The Community
Monkey is catching up fast. There seems to be a lot of enthusiasm for the project, the documentation is poor but the team promises to make a complete documentation in short time.


Let's start
Now we are going to install the Monkey web server from scratch on a Raspbian wheezy operating system. Since the web server can be executed by a user without root privilegies we are going to make the installation as normal user.


Download the full source code
$ wget http://monkey-project.com/releases/1.2/monkey-1.2.0.tar.gz

 

Extract the tarball archive

$ tar zxvf monkey-1.2.0.tar.gz

 

move on the created directory

$ cd monkey-1.2.0

 

configure the build

$ ./configure --enable-plugins=cgi,auth,cheetah,dirlisting,fastcgi,liana,logger,mandril

 

run the make command to build the executables

$ make

The compiling process will end in about three minutes. Now you are ready to run your brand new web server.

Simply run it without install anything.

$ ./bin/monkey -D

with the -D option the server will be backgrounded.
Now point your web browser to http://127.0.0.1:2001/ and that's it.

Next time I'll show to you how to do simple configuration of the server with authorization plugin and how to run cgi scripts.


Gg1