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 have a lack of knowledge in the world of Computer Science.
How can I/ Is it possible, to run a C program on a Hosted Server. To where I could go to http://mysite.com/myspecialcprogram.c and it would run? Or better yet, to what extent can I use a high level language like C to program for my server?
It should also be noted that I have a Dedicated Linux box running apache. So I have full access.
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:
Compile it:
Using FastCGI:
Compile it:
In poth programes, there is:
This will prints:
Without it Apache will throw 500 server internal error.