Question

I'm very new to Web server matters, and relatively a naive student of C++. I'm now working on a project where I have to create a Plugin to an existing web server. It is a commercial project for a company, but it's also my bachelor thesis project. I'm not quite sure which web server would be suitable for my project. The web server that I am looking for should handle the Network socket and present the http or https request as object,from which the plugin(That I want to develop) should read the header,url,data and translate(translating specially the SOAP and REST) it accordingly for the company's Data storage's Filesystem API and vice versa.The plugin has to be developed using C++.The server environment is Linux Cent OS 6. The normal staffs of 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.

I see that people talk a lot about Nginx, G-WAN, Cherokee, Lightspeed, Varnish, Tntnet etc. But I didn't really find any standarad source of judgement about the comparison of these web servers. So, please let me know, which web server would be preferable for me. Waiting for response.

Was it helpful?

Solution

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.

OTHER TIPS

"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++).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top