+---------------------+
| Scrinchy Web Server |
+---------------------+
Introduction
Scrinchy is a tiny 26 kB HTTP server that I wrote for myself, but which is also a fitting response to now fairly bloated 304kB Apache.
The name Scrinchy derives from the obscure English verb "to scrinch" which roughly means to willfully compress a thing that is not large to a yet smaller size. For instance, "to scrinch one's eyes". This is an appropriate name for Scrinchy, since the goal is to pack as much functionality into it and yet always seek to make it smaller.
License
Note, Scrinchy is provided AS-IS without any warranty and is covered by the GNU Public License. You should have received a copy of this license in the form of the file COPYING with the Scrinchy source code.
Size
Scrinchy is 26 kB if compiled without support for the Scrinchyspecific object-oriented stack language Lapis.
With Lapis (which is not yet complete) it is about 62 kB.
Features
Scrinchy will serve the following kinds of non-script files:
HTML JPEG MPEG PNG GIF MP3 OGG JS AVI
It can also run the following types of scripts externally (there are no modules):
Perl (.pl) Python (.py) PHP (.php)
And this type internally:
Lapis (.-)
What is Lapis?
Lapis is a computer language that has come about out of necessity. It exists to address the issue of bloat in the area of scripting languages just as Scrinchy is addresses the issue of bloated web servers.
Keep in mind, Lapis is brand new and most of it is still unimplemented; and the code is not optimized. Therefore I have left it disabled in the server and you must uncomment a #define to use it.
Also, yes, you saw that right: the extension for Lapis is a dash.
Caveat about PHP
PHP is nowadays being used mainly as a module for Apache, and its command-line interface which Scrinchy relies upon seems to be quite broken. I have seen PHP crash running a Hello World program -- and I have seen it return inappropriate errors when used with Scrinchy. Meanwhile Perl and Python work just fine! Therefore I do not recommend using PHP.
Concerning KeepAlive
This is currently not implemented.
Concerning POST
At this stage, Scrinchy does not support POST, because I didn't need it for my purposes. But it will later.
Anti-Hacking Features
Scrinchy also has some anti-hacker features, such as
- blocking preset IP ranges in case hosts.deny isn't working
- blocking requests from IPs that sent requests with far too many params
- blocking requests from IPs that sent requests with inappropriate params
- blocking requests from IPs that sent GET requests that had "http://" in them
- it stores attacker IPs to a file and loads that file at startup.
- it even offers witty responses before blocking attacker IPs.
In case of HTTP errors, educational material is also sent.
Files
- Config files go in /etc/scrinchy.
- The log file is /tmp/scrinchy.log.
- All html, lapis, perl, python, php, jpeg, etc go in /var/scrinchy.
Config files presently consist only of the "attackers" file, which Scrinchy updates as new baddies are detected. You should not edit this file while the server is running.
Note, after you have run Scrinchy for a few days, you really ought to add the attacker IPs in /etc/scrinchy/attackers to your hosts.deny. It's best to block them at the source.
Zack Smith
fbui@comcast.net
28 Aug 2005
