Advice on implementing a web server
Has anyone got the experience to implement a web server? I got the following questions:
Q1 - What major problems could be involved during the design and implementing a web server?
Q2 - What major开发者_C百科 technologies could be used to solve the problems in Q1?
Q3 - Are there any books related to this area? I know Apache is open source, is there any book addrssing it?
This could be a big problem. Any comments will be deeply appreciated, be it general or detailed.
Many thanks.
Although this thread is more than a year old, it still merits from the fact that no one mentioned about the not so recent innovations of nginx, lighty, and other web servers which scale much better than apache at higher concurrency and consume lesser resources.
Contending ourselves with the laurels of past achievements would make us stagnant and backward looking, rather it is always better to encourage future research albeit with some sincere warning and advise.
Please do not discourage folks who would want to redo things hoping for better results just because it is a "redo"; history is replete with examples of "redoing" the same old stuff resulted in discovering what we did wrong and identifying what needs to done for a better future.
I worked on a simple one written in C for an university course. Our version implemented HTTP version 0.9, much simpler than 1.0 or 1.1.
We started reading the specs (here you find rfc for HTTP/1.1). We had this book as reference for the course. It's a very good read! There you can find in detail how tcp and ip works. It builds the basis for programming network stuff. Another good reference book is "Unix network programming" (same author) or if you already have some background you might take a look at Beej's Guide to Network Programming .
The experience for me was very enlightening on how a server works, how to read specs and in general on unix programming. My suggestions: if you want to give a try at implementing one start with a small subset of the specs and use a high level programming language.
As others said there's probably no need for yet another webserver, but it's a good learning excercise.
The best advice would be "don't, unless you have a really good reason to". The architectural issues have been addressed for you within already available options, such as Apache and IIS.
Why duplicate code that you can already use -- if you need to do some hardcore ninja coding, you could write your own plugin for you webservers of choice.
精彩评论