Beesnest - Personal Application Server

Home Documents Downloads/Code About Contact Me

The Beesnest HTTP Server.

The Beesnest HTTP Server is part of the Beesnest system. The HTTP server follows fully the HTTP 1.1 protocol, and this is a multithread multi-host server. The server has a built in login system as well.

What you get using Beesnest as an HTTP Server

What you wont get...

Hosts:

This server can support more then one host. You set the hosts list in the configuration file. There always has to be a host named Default-Host, this is the main host and the host a HTTP 1.0 requests will be directed to. The other hosts can be named as you wish. Each host has a list of aliases names (or IP address) in the configuration file. In addition each host has a root folder, and default file name. The path name to the root folder can be absolute or relative. In this folder you will put your files to publish (you can use sub-folder obviously).

Files:

The server returns only files under the host root, and just files from one of the types you defined for this host in the configuration file. Each type of file you want the host to return has to have an entry in the configuration file under the File-Types entry. The name of the entry will be the name of the extension of the file to handle (in lower case letters). Under this entry you should specify the Contact-Type of the file, as you want the browser to receive it. The server will return the file just if in the Accept header it will find the Client-Type type, or more general type. In addition you have to write the list of hosts that will be permitted to return this file type. You can write all if all the hosts allowed returning this file type. Look at the configuration file for an example.

Accept:

This server supports just one resource for a URL. So it does not check the Accept-Charset and Accept-Language headers. The server does not encode the response in any way, so it does not check the Accept-Encoding header. And it does not support ranges (for now at least), so it does not check the Accept-Range header. The server does check the Accept header though.

Log File:

This server creates a log. You can set the log file to rotate every day, week, month or never. You can set the format of an entry in this log file. Do it in the configuration file. You can also set the server to write some general messages by setting the Log-Level to more than 2. Note that this will slow down the server, practically under high load. If you don't want the general messages, just keep the log level at 2, in the configuration file.

Cache:

This server stores the last files it returned in it's memory. If a new request for one of these files will arrive, and the file has not been changed, the server will not access the file system again, and return the file from it's memory. The number of files to store is set in the configuration file. When the server exceeds this number, it erases the last accessed file.

Load Control:

The server has a system to control the load of requests it will replay to. You can set the maximum total number of requests (threads) that will be handled simultaneously. As well as the maximum number of request from one client (one IP address) that will be handled simultaneously. see the configuration file for details.
I set my server to handle 20 total threads and just five from one client. So the computer will be protected from Denial of Service attack. Further more one client will not be able to overload the server, but a group of 4 clients will be able to jam the server in an organized attack (then the Beesnest just go to sleep, so it will not block the entire computer).

Server Side Includes:

Beesnest support the server side instructions: include, echo and set. They all come in an instruction that looks like:
<!--# command name = value ... -->
In all instructions you can use double quotes, single quotes or no quotes. Beesnest executes SSI instructions before it executes any scripts, in all the files that set to type text/html. Important note about the combination of SSI and scripts: It is not existing! You cannot combine SSI instructions in a script. Beesnest doesn't check for it, but it will not work. In any script you should have functions to get and set request variables. If you need an access to a file, you need to do it with your script, you cannot use #include. Never write an SSI instruction inside the bnscript tag.

Here is an example of how to use SSI

Home Documents Downloads/Code About Contact Me