PWebS HTTP Server
What is pwebs
PWebS is an HTTP server written in
It's in an early stage of development, and is not indicated for
any use other than testing.
However the basic features are working.
The server was only tested on Linux. By the way, being written in such
a multi-platform language like Python there are good chance that
it will work on other platforms too.
The only point that is sure that it doesn't work on Windows is the
The actual implementation uses the
exec() sequence to start the program; these functions
are unknown unde Windows..
Currently implemented features
- The server is based on a multi-thread architecture, for every
connection a new thread is spawned (instead of a new process
max_clients the connections will be
queued and served later.
- Support for HTTP
- CGI/1.1 support. It is possible to run CGI programs using both
methods to pass
data to the scripts.
- PHP support through the CGI interface. Most Php scripts are working,
the only limitations, at the moment, is the lacks of Sessions
- The configuration of the server is all done in the
file. From here it's possible to set many parameters of the server.
- The "MIME <==> extension" association is done
using an external file (
- Directory listing: if a directory doesn't contain a suitable
index document, an address like
will return the HTML formatted list of the files in that directory
- Caching system. All the pages (statics or dinamically generated) are
cached (this aspect is configurable) in memory to improve
the speed of the server and reduce the overall load.
When the cache is full (reached
When the file on disc is modified, the copy in cache is refreshed
some pages will be trashed out of the cache,
using a LRU (Least Recently Used) algoritm,
implemented with a separated stack.
- Log System. Requests and server errors are all logged in two
separeted files (
The logs are like the default
When the log files are bigger than 1 Mb, they are moved to a new
- Server Side Includes. At the moment Pwebs implement only a little
subset of SSI features.
This site make use of SSI and it has been developed with Pwebs.
A different user can be specified in the config file
nobody) and the server will drop
- Improve SSI parser
- Find bottle-necks
- Add support for Apache modules (this is a little bit tricky..)
- React better under heavy load.
When the server receive too many contemporary connections, there are
too many opened file descriptors and the OS is not too much happy.
ab, the Apache Benchmark software)
If you are interested in this project, please let me know:
any help is welcome.