What you call a "Web server" is essentially an "HTTP Server". Writing some rudimentary server, just compliant with HTTP protocol and serving up some content as is is not really a difficult problem, even if you do it from scratch, but even that is not needed if you start here:
https://msdn.microsoft.com/en-us/library/system.web.http.httpserver%28v=vs.118%29.aspx[
^].
"Real" HTTP server are different from that in the way they serve up content. They have some plug-in architecture which allows them to host all those server-side scripting technologies, and other server-side technologies, such as server-side includes, routing, URL rewrite and a lot more; another issue is some protection against malicious attacks. Even with all that, any good Web browser is much more complicated.
See also:
http://en.wikipedia.org/wiki/HTTP[
^],
http://en.wikipedia.org/wiki/HTTP_Server[
^].
—SA