Question

How to run c programmes in browser using apache2 in ubuntu 14.04 ?

  • Posted on September 5, 2014
  • yogasuhasAsked by yogasuhas

Hi, I am basically from electronics background, but i have got interest in programing for web application, i am very new to it. Find very interesting and moreover i am enjoying it. I installed apache2 on ubuntu, i hosted some virtual host sites with index.html files. but i want to run c programme on browser. i went through cgi configuration for apache2, but was not successful. when i try for any /home/*/public_html/cgi-bin/ for DocumentRoot. apache2 gives DocumentRoot not found error, and get 403 and 404 error when try to access on browser. So how to run c executable file on browser using apache2 in ubuntu 14.04.


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

This comment has been deleted

To enable cgi-bin run:

sudo a2enmod cgi
sudo service apache2 restart

Then copy your executable to the directory /usr/lib/cgi-bin/ Assuming the name of your program is hello.cgi it will now be available at http://your.ip.address/cgi-bin/hello.cgi