Forum Moderators: bakedjake
I don't think I'd follow the "wrapper" approach mentioned earlier, but I would suggest considering writing most of your app in a scripting language, and writing portions that are resource-intensive in C++. That way, you get the best of both worlds.
The simplest way to write a pure C++ server-side app is to write a CGI app. Of course, this won't get you a great deal of efficiency, as the app will be loaded each time a page is accessed. But it's simple (CGI apps use STDIN/STDOUT and environment variables), and this could get you started. You can often convert an existing text-oriented app to CGI rather quickly.
For maximum performance, look into Fast-CGI, and/or writing your own "modules" for your web server using the web-server's API. The latter will be specific to the particular web server you use - you will have to refer to your web server's documentation.
The advantage of a module is that it is loaded when the server is loaded, and stays resident as long as the server is running. The module is passed control when certain events occur. (Such as a certain URL requires rendering.)
There are a number of libraries available to assist in CGI or module programming. Do some searching.
Building an Apache module needs however significant knowledge of C, Apache and the module API.
An entire new language (Java) was written to avoid the single largest programming problem in C/C++, which in turn has traditionally been the single largest source of security breaches on the Web, ie pointer handling and buffer overflow.
I run my Web applications as either totally static flat files under Apache (very safe and efficient) or as Java servlets under Apache Tomcat, which is (with a little care) safe and efficient also. Much faster than CGI-based applications for example.
Rgds
Damon