C ++ compatibility for lightweight web servers

I am very new to web server matters and a relatively naive C ++ student. I am currently working on a project where I need to create a plugin for an existing web server. This is a commercial project for a company, but it is also my bachelor's project. I'm not entirely sure which web server is right for my project. The webserver I'm looking for should handle the network socket and present the HTTP or https request as an object from which the plugin (which I want to develop) should read the header, url, data and translate (translate specifically SOAP and REST), this is respectively for the Data Files Filesystem API company and vice versa. The plugin must be developed using C ++. The server environment is Linux Cent OS 6. The company's regular staff members have never worked with a Linux server environment. This is a small company.Previously, they only worked with windows and IIS web server. Our project manager is reluctant to use Apache as it has a large footprint and is slow, while IIS is not suitable for Linux. So we are looking for a free lightweight web server for Linux.

I see people talking a lot about Nginx, G-WAN, Cherokee, Lightspeed, Varnish, Tntnet, etc. But I really haven't found a standard source of judgment on comparing these web servers. So please let me know which web server would be my preference. Waiting for an answer.

+3


source to share


3 answers


There are several such as lighttpd. Here's a description of how C plugins can be created for it.

Note



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

The length of the source code is not a good indicator of the performance and memory usage of a program.

+2


source


“I really haven't found any standard source of judgment when comparing these web servers.

The academy has done this comparison for most of the servers you listed . Tntnet is being tested elsewhere .

"please let me know which web server I prefer."

Considering the restrictions that you indicated:

"the company has never worked with a Linux server environment before. This is a small company. They only worked with windows and IIS web server before. Our project manager is reluctant to use Apache as it has a heavy footprint and is slow while IIS is not suitable for Linux. So we're looking for a free lightweight web server for Linux. "



G-WAN (150KB) is the lightest and C/C++ scripts

saves you the hassle of recompiling and linking modules

for other servers.

G-WAN was originally written in Windows by people who never dared to Linux (until the Linux port, which came 6 months after the release of Windows).

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

But don't take my word for it (I'm part of the G-WAN team) and letting it try is the only way to see if it suits your needs.

+2


source


If you want to code a web application from C ++, Wt .

You can also code a FastCGI ou SCGI application in C ++ and register it by configuring your webserver accordingly (like lighttpd or good old Apache).

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

+1


source







All Articles