Almost each Linux user has a private web server and people may use it for providing an access to the information in the Internet or to participate in the applications development with the PHP or CGI languages. Some people can even use their own web server to read some documents in the web browser and sometimes play the role of a web master. Actually, exploiting the Apache web server for these purposes is a very exhaustive solution sometimes.
In these cases replacements of the own Apache web server with the micro HTTP server is a right way. This approach saves some volume of RAM and disk space, though these are not the main purposes and, at the same time, this server should support the indexing of catalogues, i.e. the redirection. Although you can perform this indexing with the help of the scripts, automatically started by a scheduler, simple integrated solutions are more preferable. It is recommended to implement such software by the principle of the TCP wrapper. An executable file of the server is called only when the request is received. This approach does not require any complex operations with the initialization scripts.
The web server micro_httpd fits all these requirements. This is a C program that consists of about hundred and fifty lines of the source code and it does exactly what we need. You can start this program via the TCP service and it does not include any CGI or PHP code.
To download the sources of micro_http and unpack them, you need to use a tar command. There is an opportunity to edit the source code if you need. After this operation, you will obtain the binary file micro_httpd in the /usr/local/sbin directory. To apply this service, you should restart the super server Internet inetd.
After all the installation procedures, there is high time to test the new micro web server. Place some html-files to the www root directory with a read permission for a user, who will start the micro web server.
Start your web browser from http://localhost/address. Then you will see the contents of index.html file or an automatically created list of the files in the catalogue. In this case you can be sure that your small web server really works!
You should note some specific features of the micro_httpd web server due to the specific implementation. The service TCP wrapper writes the log of connections to /var/log/messages file. However, you should not wait for a detailed report in the Apache style. There will be only simple records, demonstrating that the program was started from a certain IP address. Nevertheless, if the source codes of the micro_httpd and the HTTP protocol knowledge are available, you can extend the opportunities for the log processing.
Actually, any web-server, which may be started from the inetd system service, can be adjusted in a similar way. Indeed, all these programs are based on the standard Unix system utilities. You should only determine which functions are preferable for you and download the program that will satisfy the conditions. There are many small web servers of this type in the Internet. They have many advantages, comparing to the standard utilities, and they are free by the most part; hence, you can do some experiments with their source code.