Monkey: Palm Protocol / Application Server

In some previous post about Monkey HTTP Daemon project, i have been describing some parts of the new architecture and goals that we are trying to accomplish. Now we have a faster asynchronous web server, very lightweight and with a good designed API to extend the features through plugins.

I have received some questions about dynamic content generation support, specifically questions like “what about CGI and PHP support ?”, so now is time to describe more in detail how we are handle this through our Palm Protocol.

Palm Protocol, aims to provide a simple CGI applications server which work over TCP. Is pretty much similar to FastCGI or SimpleCGI, but still more simple :) , basically is a TCP server listening in different ports to serve different dynamic content in a pre-forked model. To explain it better take a look to the following diagram:

Server Side

Palm server create specific handlers per configuration, for example, it can be configured to serve PHP and Python scripts, each handler contains information about how many child process will be available, the executable interpreter and optional arguments for it, for example, in order to define a handler for PHP we could add this entry in palm.conf:

[PHP]
Port = 2010
Exec = /usr/bin/php-cgi
Arguments = -f
Childs = 5

That entry specify that the handler will be listening in TCP port 2010, it will create 5 child process and each request will be server by the php-cgi program, adding the -f argument before the script to be called.

Each handler created is called a ‘Palm’, you can configure as many Palms as you want.

Client Side

In the client side, the Palm Plugin for Monkey HTTP Daemon will be listening for specific file extension on each HTTP request, so it can be configured to handle files with .php extension and connect to the right Palm. Here’s a simple configuration line for PHP in the client side, this configuration take place in the plugins/palm/palm.conf file:

Palm   php   application/x-httpd-php    127.0.0.1     2010

Each row in the configuration file represents a Palm entry, the fields required are: protocol, file extension, mime type, palm server address and palm server port. This configuration must match the Palm server configuration. So every time that a PHP file is requested, the Palm client will connect to the Palm server to the specific port, send the request and wait for a response.

Protocol details

The protocol as mentioned before, is very basic, is composed by the following:

absolute_script_path + CRLF    (mandatory)
cgi_header = value + CRLF      (optional)
CRLFCRLF                                (mandatory)

a text example could be:

/home/foo/monkeyd/htdocs/info.php\r\n
SERVER_SOFTWARE=Monkey/0.11.0-dev\r\n
SERVER_PROTOCOL=HTTP/1.1\r\n
HTTP_HOST=localhost\r\n
QUERY_STRING=a=1&b=2&c=3\r\n
\r\n\r\n

The first mandatory row indicates the absolute script path to be interpreted or executed, the second optional row represent the CGI/1.1 headers used by the interpreters, you can add N cgi headers as required, and the final mandatory row indicates the end of the request.

If any error occurred in the server side, the Palm server must return a formatted plain text or HTML error to the client side, Palm Protocol does not handle error codes.

Flisol Santiago 2010 + Monkey Project !!!

El Festival Latinoamericano de Instalación de Software Libre (FLISoL) es el evento de difusión de Software Libre más grande en Latinoamérica. Se realiza desde el año 2005 y su
principal objetivo es promover el uso del software libre, dando a conocer al  público en general su filosofía, alcances, avances y desarrollo.

El proyecto Monkey HTTP Daemon y su comunidad, participarán del ciclo de charlas denominadas Rincón del Hacker. El objetivo de nuestra participación, es introducir a los asistentes en la arquitectura de Monkey HTTP Daemon, sus distintos componentes y la interfaz para desarrolladores  (API).

El evento se llevará a cabo el día 29 de Mayo a las 9:30am en las dependencias de la Universidad de Santiago de Chile en el Centro de Eventos Nacionales e Internacionales, ubicado en Av. Libertador Bernardo  O’Higgins #3363.

Quienes deseen cooperar a publicitar el evento, pueden hacer uso de los siguientes recursos:

1) Web     :   http://www.monkey-project.com/flisol2010

2) Banner :  http://www.monkey-project.com/img/monkey_flisol2010.png

Más detalles de como llegar al evento… ver aqui:  http://santiago.flisol.cl/donde-y-cuando/

Los esperamos !

Monkey Project Supported by OSUOSL

I’m proud to announce that Monkey HTTP Daemon Project now is officially supported by the Open Source Lab of the Oregon State University.

The OSUOSL has provided a full Virtual Machine which is dedicated to Monkey Project, now we will can host our own services and reduce to zero the hosting costs that we were assuming. Now we are free to add new features, create a demo section and shortly serve the content with Monkey HTTP Daemon :)

Just thanks to all OSUOSL team who have make this possible!, thanks for support us!

As an additional reference, OSUOSL support great scale projects as Inkscape, Enlightenment, CentOS and others, check more details in http://osuosl.org/services/hosting/communities