Click here to Skip to main content
15,912,932 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am looking at writing c++ webservice for linux with apache being the webserver.i am working on linux for first time so i needed your help.

Am follwing the instructions given by Fast_Cgi site.





I have downloaded the toolkit "mod_fast_cgi-2.4.6.tar.tar" from the site " http://www.fastcgi.com/drupal/".

Then i followed the instructions given in "INSTALL.AP2" file which is present in toolkit.

I was able to generate “fast_cgi.so file”. Now this file is located in my directory







Configuring httpd.conf



next step is to make changes in my



In http.conf file –

I have added "LoadModule fastcgi_module modules/mod_fastcgi.so" in the begining of the httpd.conf file



then they have said to add these things before virtual host directive





FastCgiIpcDir /tmp/fcgi_ipc/

AddHandler fastcgi-script .fcgi





Sample C++ program



my test program "Testwebservice.cpp" looks like this



#include "fcgi_stdio.h" /* fcgi library; put it first*/



#include



int count;



void initialize(void)

{

count=0;

}



int main(void)

{

/* Initialization. */

initialize();



/* Response loop. */

while (FCGI_Accept() >= 0) {

printf("Content-type: text/html\r\n"

"\r\n"

"<title>FastCGI Hello! (C, fcgi_stdio library)</title>"

"FastCGI Hello! (C, fcgi_stdio library)"

"Request number %d running on host %s\n",

++count, getenv("SERVER_HOSTNAME"));

}

return 0;

}



I feel am missing something in the directive which i added just before the virtual host directive.

could you help me to know what am i missing here.

what is that i have to add in httpd.conf file which will direct the http requests coming to the apache webserver to my c++ application.
Posted
Updated 2-Oct-11 20:46pm
v5

this is the third tread(if i am not wrong) for the same question...?? you can continue ask through comment in the same question...
follow the link..
link
if you dont understand feel free to ask in the same Question, no need to create multiple question for the same type.
 
Share this answer
 
v2
Comments
enhzflep 30-Sep-11 7:53am    
My 5.
1. Study and understand concepts
2. Get required tools
3. Write code
4. Compile
5. If no errors, goto 7.
6. Debug/Fix, goto #3.

7. .....


:reminds self to ignore posters suffering from the ID ten T error:
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900