This question I\'m sure has been answered, I honestly don\'t know how to ask it via search though. So please excuse my lack of knowledge as this one of the only place I really h
One way is to run it as CGI, as @paddy already mentioned. However, the program will run slow, long startup time.
Another way is to run it using FastCGI. It will be much more faster, you just need a few modifications on your code to make it works, for example as CGI:
#include
#include
int main(int argc, char **argv)
{
time_t timer;
char time_str[25];
struct tm* tm_info;
time(&timer);
tm_info = localtime(&timer);
strftime(time_str, sizeof(time_str), "%Y/%m/%d %H:%M:%S", tm_info);
/* Without this line, you will get 500 error */
puts("Content-type: text/html\n");
puts("");
puts("");
puts(" ");
puts("");
puts("");
puts(" Hello world!
");
printf(" %s
\n", time_str);
puts("");
puts("