I need my apache web server to run c++ compiled binary files. I’ve done everything I’m told in different tutorials to set my cgi-bin directory but nothing has helped!
I’ve added to apache config (sites-available/default):
ScriptAlias /cgi-bin/ /var/www/cgi-bin/
<Directory "/var/www/cgi-bin">
AllowOverride None
Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
AddHandler cgi-script .cgi
</Directory>
my c++ file (/var/www/cgi-bin/test.cgi) just simply couts hello world!, but when i ask for this file on the browser, I get the error: Internal Server Error!
Your test.cgi does not output any headers. It should output a set of headers and a body, separated by a blank line, something like this:
There are many more things that could be the problem, but start by adding a “content type” header and an empty line to your test programs output.