This is not a real web server, although it might turn into one eventually!
You will need to modify %config (specifically the hostname) before it will do anything useful. You may also need to modify the allowed and forbidden anonymous arrays; these are given to provide an example of simple access control to a server.
shttpd understands a single HTTP command:
GET I<filename>
It looks for files in $htbase (defined in url_to_file(), the subroutine that maps HTTP requests to absolute pathnames). If a trailing slash is encountered, it appends $htdefault (currently set to index.html).
If the file is not found, it returns a 404: File not found response -- otherwise it assumes the file is HTML and sends it(!). This may not be what you want to do if the file is not HTML, so take care.
shttpd doesn't understand CGI scripts, relative URLs, or just about anything. However, it serves as a skeleton which can easily be extended to add these features.
To install NetServer::Generic, copy and paste the appropriate command in to your terminal.
cpanm
cpanm NetServer::Generic
CPAN shell
perl -MCPAN -e shell install NetServer::Generic
For more information on module installation, please visit the detailed CPAN module installation guide.