• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1203
  • Last Modified:

C++ Web Server - Getting Started

I would like to implement a web server written entirely in C++.  I am told that there are alot of hosting services that use C++ technology.  I need the following info:

(1) the most current, robust, stable technologies that will help me implement such a server
(2)  some examples of hosting services that use C++ technology so I can vailidate (1) with the assumption that there are more C++ hosting services than say Java or .NET

In other words, I need someone to help get me started.
0
lcor
Asked:
lcor
1 Solution
 
Infinity08Commented:
The vast majority of websites run on the Apache web server :

        http://httpd.apache.org/

It is open-source, free, and runs on UNIX/Linux as well as Windows systems. And it is written in C. How's that for a reference :)
0
 
jkrCommented:
If you are trying to create a web server in C++, you are reinventing the wheel (unless you want to do that for educational purposes. What you need is

- a good understanding of TCP/IP:
http://beej.us/guide/bgnet/
http://www.cs.rpi.edu/courses/sysprog/sockets/sock.html

- knowledge of the HTTP protocol:
http://www.faqs.org/rfcs/rfc2616.html

- a multithreaded model to serve more than one request at a time:
http://www.llnl.gov/computing/tutorials/pthreads/

To start out, you might want to take a look at some OSS web servers, e.g. http://sourceforge.net/projects/ehttpd/
0
 
grg99Commented:
If you want to write a server from scratch, it's EASY to do a very basic server, less than 30 lines of code.  

It's very HARD to write a good, reliable, fast, flexible, standards-conforming and de-facto conforming server.  Like at least 9 months of very heavy coding, and debugging, and testing.

On the other hand you could just grab one of the many existing, well-tested servers out there.  Apache would be a good choice.

0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now