Microscopic Web Server

This program runs under windows, and is designed to provide the minimum services required from a web server. It will deliver documents and run CGI programs, and not much else. If you feel the need to modify it, be very careful with security: one little mistake, and you could leave your entire computer open to viewing and interference from outside.

Create a directory, put webs.exe in it, and put the documents you want to be available in it too. The program is designed so that no matter what is requested, it will never deliver a document from outside the folder it is running from.

CGI programs should be created as normal windows CONSOLE APPLICATIONS. All you have to do is change the ".exe" to ".cgi".

Run the webs program from a normal DOS shell. ust type "webs" and leave it running. There are two optional command line parameters: "webs xxx" will treat the folder xxx as the repository of documents instead of the current folder. "webs xxx NNN" will set up the server on port number NNN instead of the standard 80. This may be helpful if you are behind a fire wall or something similar.

Here is the executable

The source code is not pretty, but you can see it if you like. (here it is). If you recompile it for your self, it must be set up as a console application, and the library "ws2_32.lib" must be added under the "advanced" or "command line" linker options.