Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which has a better code base to learn from: nginx or lighttpd?

Tags:

c

nginx

lighttpd

Primary goal is to learn from a popular web server codebase (implemented in C) with priority given to structure/design instead of neat tricks throughout the code.

I didn't include Apache since its code base is an order of magnitude larger than the two mentioned.

like image 786
droidix Avatar asked Feb 27 '23 19:02

droidix


1 Answers

Ngxinx might just be the best straight-c code-base I have encountered. I have read large chunks of Apache, and I always came out feeling unclean, it is a monolithic mess.

You will not just learn about web-servers by exploring Nginx, but pretty much the best practises for writing networked software under Unix and straight-c, from code architecture to meta-programming techniques.

I have heard nothing but good things about Lighttpd, however it is limited in scope compared to Nginx. therefore I would invest time in nginx if I was you. Although lighttpd's limited scope might be beneficial to you, as a first target to study.

like image 107
Hassan Syed Avatar answered Mar 07 '23 05:03

Hassan Syed