Your Own Personal WEB Server

"Нечего делать" - это очень сильный стимул. Иногда человек от нечего делать делает гораздо больше, чем от стимула "надо сделать". Это типа эпиграф такой, хех...

YOPS (people who speak russian, don't put the bite on me ,) is a small SEDA-like HTTP server for Linux OS written in C. The idea behind SEDA is to decompose the process of servicing a client into several stages, each stage being fulfilled by one or more threads. Stages communicate with each other through channels of some kind.

There are 4 stages in YOPS currently:

There is also main thread, that performs some monitoring

There were 7 stages earlier, but Errorer stage (HTTP errors handling) and Launcher stage (CGI) were removed; also Acceptor and Parser stages were merged into one single stage.

Only one thread is working at each stage in YOPS. Actually there was a possibilty to have more than 1 thread at each stage, but after Acceptor and Sender were redesigned to use epoll() this possibility was removed.

Standart Unix pipes are used as channels between stages.

YOPS has been tested on Debian 5.02 (Lenny, 2.6.26-2-686 #1 SMP Linux kernel, gcc 4.3.2) and Debian 6.0 (Squeeze, 2.6.32-5-686 kernel, gcc 4.4.5) distributions on a single CPU machine.

Adjective personal in the name of the server means that all files accessed by the server (e.g. config, log, web pages) reside in '~/www', i.e. in 'www' subdir of home directory of a user, and not in system dirs ('/etc', '/var/log', etc). Moreover, YOPS refuses to run with uid=0 or euid=0.

Also note YOPS is not a "daemon" program, i.e. it runs in the foreground, not in the background.

And, yeah... YOPS has been written by the author, so to say, absolutely unintentionally. My initial intention was to write some simple server example (for students) that would demonstrate SEDA approach in designing internet servers, but i could not help myself from coding and polishing the code, and eventually this "simple example" became quite usable HTTP-server.