C++ compatibility for lightweight web servers C++ compatibility for lightweight web servers nginx nginx

C++ compatibility for lightweight web servers


There are several, for example lighttpd. Here is a description of how C plugins can be built for it.

NOTE

I want the source code of web server to be as less as possible.

The length of the source code is not a good metric for performance and memory use of a program.


"I didn't really find any standarad source of judgement about the comparison of these web servers."

An academic has done such a comparison of most of the servers that you have cited. Tntnet is tested elsewhere.

"please let me know, which web server would be preferable for me."

Given the constraints that you have expressed:

"the company has never worked with linux server environment before. Its a small company. They only worked with windows and IIS web server before. Our project manager is reluctant to use Apache because it has heavy footprint and it's slow, while IIS is not suitable for linux. So, we are looking for a free light-weight web server for linux"

G-WAN (150 KB) is the most lightweight, and its C/C++ scripts will save you the trouble of having to recompile and link the modules that other servers need.

G-WAN was initially written on Windows by people who never ventured on Linux (before making a Linux port, which came 6 months after the Windows release).

As a result, G-WAN was designed to be as simple as possible (optimal settings are applied without configuration files or system scripts) because that was making life easier for the developers.

But don't take my word for it (I am part of the G-WAN team) and give it a try - that's the only way to see if it matches your needs.


If you want to code a web application with C++, the Wt toolkit comes to mind.

You could also code a FastCGI ou SCGI application in C++ and register it by configuring appropriately your web server (e.g. lighttpd or the good old Apache).

And there are several libraries to make your application an HTTP server. For instance Onion (which is in C, but can be used from C++).