tags:

views:

324

answers:

4

I am a .NET developer and I've been working in C# for almost 3.5 yrs. I want to understand how the web server works and I don't mean a 65,000 feet overview. I want to understand the inner workings of a web server.

What are some good resources to learn the nuts and bolts of how a web server works?

+3  A: 

Web servers are very simple to implement, and there are several tutorials on how to build one.

Here is such a tutorial for C#: http://www.codeguru.com/csharp/.net/net_general/article.php/c4603, this tutorial is nice because it implements the server down to raw sockets and HTTP header passing, so you learn a lot about the HTTP Spec. Unfortunatly, some tutorials and libraries abstract this away.

Implementing on yourself allow you to touch many topics:

  • Socket programming
  • HTTP Protocol (GET / POST)
  • Multi-threading

And once you get a basic webserver built you can extend your server and protocol into your own web-framework. should make a really cool pet-project.

I have done just this for Java, C++, and Python.

mmattax
+3  A: 

If you really want the nuts and bolts of how a web server is supposed to work read the HTTP Spec.

A good tool would be be fiddler. Using this tool browser about the net and examine the conversation between the browser and the servers. Combined with a reading of the HTTP spec this will give you some good insight into what is really going on on the net.

If you want to go further you need to decide which web server you spcecifically want to understand better. For example, if you want to understand IIS6/7 then David Wang's blog is a good place to search for under-the-hood details.

AnthonyWJones
A: 

IIS and Apache are likely the two most common Web server implementations though I'm not sure what you are really looking for here. Are you wanting to know how each runs, how to customize it, or how to roll your own?

JB King
A: 

I just happened on this question while looking for something else, but if you want to understand a web server I've recently started on a se of blog entries going though a custom built, open source web server.

It won't teach you exactly how IIS works, but the basic communication would be the same and, hence, is a good start. Here are the links for you to check out, including the link to the open source project:

Frank V