how to implement a http server in c on linux

1.use existing open source

  • Apache
  • Nginx

2.use librarys

  • Python HTTPServer / CGIHTTPServer
  • libevent

3.implement it in c

  • basic (learn from APUE/UNP)
    1.HTTP protocol(RFC 2616)
    2.TCP server(select/poll/epoll)
    3.multi-process model(fork, one proces per connection)
    4.multi-thread model(one thread per connection)
    5.IPC (interprocess communication)
    6.NON-Block I/O, edge trigger

  • advanced (learn from open source, lots pagers)
    1.performance optimists: memory cached, I/O(linux AIO), TCP/IP
    2.support CGI/FastCGI/WSGI/AJK
    3.support HTTPS
    4.dynamic modules
    5.support cluster

4.Reference