logoon  windows
Apache Lounge



Forum Index Downloads Search Register Log in  RSS Apache Lounge


22 July 2015

httpd 2.4.16 VC14 build with
Visual Sudio 2015 RTM

Do not forget to install
the new C++ Redistributable

Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.



A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Apache Lounge is not sponsored by anyone.

Your donations will help to keep this site alive and well, and continuing the building of the binaries.

client/server and database with C++

Post new topic   Reply to topic    Apache Forum Index -> Coding & Scripting Corner

View previous topic :: View next topic  
Author Message

Joined: 26 Apr 2007
Posts: 2

PostPosted: Thu 26 Apr '07 9:43    Post subject: client/server and database with C++ Reply with quote


I'm working on a small project with C++ and apache httpd.
In this project a client send a request for a file to the server and, depending on datas from the database, the server send a file and save some statistics. It's a bit like a web browser client/server, but I don't want to use php/mysql. The system must be quick and the client is made with c++.
I'm new to client/server coding with c++ (I do it every day with php/mysql in my job), and I can't find a good tutorial about building and linking a c++ software to apache.
Should it be a dll or not ? how to connect the client with winsock ? there is so many question without answer at this time.

thanks for your help Smile
Back to top
James Blond

Joined: 19 Jan 2006
Posts: 5459
Location: Germany, Next to Hamburg

PostPosted: Thu 26 Apr '07 10:15    Post subject: Reply with quote

With c++ you could run it as cgi.
Back to top

Joined: 17 Dec 2005
Posts: 610
Location: Milford, MA, USA

PostPosted: Thu 26 Apr '07 14:24    Post subject: Reply with quote

If you want to link your code with Apache, an option is to write an Apache module.

This is not a trivial task - it requires a good knowledge of both Apache and of thread-safe C programming.
C++ can be used, although the Apache API uses the C calling standard.

The best reference book for writing an Apache module is "The Apache Modules Book" by Nick Kew which was published in January of this year.
It is a bit advanced to be considered a tutorial.

re: "how to connect the client with winsock?":
That probably wouldn't be necessary. An Apache module could perform the database steps and then direct Apache to send the file.
A module certainly would be quick enough, as it is a .dll which runs inside the Apache process.

re: "I'm new to client/server coding with c++":
That argues against writing your own Apache module; but maybe you want to look over the Modules book and the Apache modules docs and see if this is something you want to tackle.

Back to top

Joined: 26 Apr 2007
Posts: 2

PostPosted: Thu 26 Apr '07 19:48    Post subject: Reply with quote

Thank you very much, I'll take a look to all this.
Back to top

Post new topic   Reply to topic    Apache Forum Index -> Coding & Scripting Corner
Page 1 of 1